<?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>136445</bug_id>
          
          <creation_ts>2014-09-01 23:33:13 -0700</creation_ts>
          <short_desc>Assignment to a property on a primitive in strict mode should not throw</short_desc>
          <delta_ts>2014-09-02 19:40:43 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jordan Harband">ljharb</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>mathias</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1032569</commentid>
    <comment_count>0</comment_count>
    <who name="Jordan Harband">ljharb</who>
    <bug_when>2014-09-01 23:33:13 -0700</bug_when>
    <thetext>`(function () { &quot;use strict&quot;; 3.0.a = true; }())`
`(function () { &quot;use strict&quot;; &apos;foo&apos;.a = true; }())`
`(function () { &quot;use strict&quot;; true.a = true; }())`

None of these throw exceptions in Chrome, Firefox, Opera - but in Safari 7.1, these all throw a TypeError &quot;Attempted to assign to readonly property.&quot;.

According to the ES5 spec ( https://es5.github.io/#C ) and ES6 spec ( https://people.mozilla.org/~jorendorff/es6-draft.html#sec-strict-mode-of-ecmascript ), Safari is in error here. In addition, one of the TC39 spec maintainers confirmed via Twitter that this is a Safari bug ( https://twitter.com/awbjs/status/506687103506587648 )

Steps to Reproduce:
Run any of the JS functions in the console, or any other JS mechanism:

(function () { &quot;use strict&quot;; 3.0.a = true; }())

(function () { &quot;use strict&quot;; &apos;foo&apos;.a = true; }())

(function () { &quot;use strict&quot;; true.a = true; }())</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1032682</commentid>
    <comment_count>1</comment_count>
    <who name="Jordan Harband">ljharb</who>
    <bug_when>2014-09-02 10:10:41 -0700</bug_when>
    <thetext>Sorry for the noise - turns out Safari is the only browser doing this correctly. https://twitter.com/awbjs/status/506845194025594881

https://code.google.com/p/v8/issues/detail?id=3088 and https://bugzilla.mozilla.org/show_bug.cgi?id=779682</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>