<?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>121201</bug_id>
          
          <creation_ts>2013-09-11 19:06:14 -0700</creation_ts>
          <short_desc>Invalid exception trying to set property on primitive value in strict mode</short_desc>
          <delta_ts>2013-09-12 10:10:56 -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>NEW</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Arvidsson">arv</reporter>
          <assigned_to name="Oliver Hunt">oliver</assigned_to>
          <cc>barraclough</cc>
    
    <cc>ggaren</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>928096</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Arvidsson">arv</who>
    <bug_when>2013-09-11 19:06:14 -0700</bug_when>
    <thetext>The following throws an exception in JSC but works correctly in V8, SpiderMonkey and Chakra:

function f() {
  &apos;use strict&apos;;
  1 .foo = &apos;bar&apos;
}
f();

Here are the relevant spec parts:

http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.2.1

MemberExpression : MemberExpression [ Expression ]

1. Let baseReference be the result of evaluating MemberExpression.
2. Let baseValue be GetValue(baseReference).
...
10. If the code matched by the syntactic production that is being evaluated is strict mode code, let strict be true, else let strict be false.
11. Return a value of type Reference whose base value is bv and whose referenced name is propertyNameString, and whose strict reference flag is strict.


http://people.mozilla.org/~jorendorff/es6-draft.html#sec-6.2.4.2

PutValue (V, W)

5 is false, 6 is true, 6a is true. /base/ becomes ToObject(base) which is an object wrapper of the primitive.
6b calls [[Set]] which does not fail (the object wrapper is extensible)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>928354</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-09-12 09:56:13 -0700</bug_when>
    <thetext>Reading the spec to determine if this is correct behaviour or not.  It should be easy to fix if not.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>