<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>163495</bug_id>
          
          <creation_ts>2016-10-15 17:15:19 -0700</creation_ts>
          <short_desc>JSON.parse should modify configurable non-writable properties.</short_desc>
          <delta_ts>2016-10-15 17:19:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>163446</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1240676</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2016-10-15 17:15:19 -0700</bug_when>
    <thetext>This is because the JSON.parse spec (see https://tc39.github.io/ecma262/#sec-json.parse and https://tc39.github.io/ecma262/#sec-internalizejsonproperty) uses CreateDataProperty to set properties that the reviver wants to set.  The CreateDataProperty spec (see https://tc39.github.io/ecma262/#sec-createdataproperty) says that it uses [[DefineOwnProperty]] to perform this set.  As a result, if the property was configurable to begin with, it&apos;s [[Writable]] will be overridden to be true, and the new value should be applied.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240677</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2016-10-15 17:17:34 -0700</bug_when>
    <thetext>We can&apos;t do this currently achieve this for array like objects, because the existing code path that does the &quot;put&quot; operation does not allow us to indicate that the put with a DefineOwnProperty mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240678</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2016-10-15 17:19:35 -0700</bug_when>
    <thetext>A test case in JSTests/stress/json-parse-on-non-configurable-non-writable-property.js (which should land with https://bugs.webkit.org/show_bug.cgi?id=163446) is commented out due to this bug.  Please uncomment that test when this is fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>