<?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>47672</bug_id>
          
          <creation_ts>2010-10-14 08:37:40 -0700</creation_ts>
          <short_desc>ES5 strict mode bugs</short_desc>
          <delta_ts>2011-06-17 00:30:30 -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>PC</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://kangax.github.com/es5-compat-table/strict-mode/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>47788</dependson>
    
    <dependson>47791</dependson>
    
    <dependson>47833</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="kangax">kangax</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>erights</cc>
    
    <cc>ggaren</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>294123</commentid>
    <comment_count>0</comment_count>
    <who name="kangax">kangax</who>
    <bug_when>2010-10-14 08:37:40 -0700</bug_when>
    <thetext>There are 3 oversights in the way strict mode works in webkit, which results in 4 failing tests with the above example page — http://kangax.github.com/es5-compat-table/strict-mode/

Also, for the ref, early error on &quot;assignment to an unresolved reference&quot; was discussed here — https://mail.mozilla.org/pipermail/es5-discuss/2010-October/003742.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294927</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-10-15 14:36:54 -0700</bug_when>
    <thetext>The tests being:

__i_dont_exist = 1; is a ReferenceError
arguments++; is a SyntaxError
(function(){ return this === undefined; })();
(function(){ return this === undefined; }).call();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295296</commentid>
    <comment_count>2</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-17 16:26:39 -0700</bug_when>
    <thetext>Fixing the reference error for global properties at the moment</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295331</commentid>
    <comment_count>3</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-17 21:18:28 -0700</bug_when>
    <thetext>__i_dont_exist = blah should now be fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295349</commentid>
    <comment_count>4</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-17 22:43:46 -0700</bug_when>
    <thetext>pre-/post-fix operations on arguments are now disallowed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295591</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-18 10:21:10 -0700</bug_when>
    <thetext>i&apos;ve got the null vs. undefined |this| fix up for review now</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295653</commentid>
    <comment_count>6</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-18 11:33:47 -0700</bug_when>
    <thetext>And now the undefined vs null patch is landed.

kangax are there any other problems you&apos;ve found?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295714</commentid>
    <comment_count>7</comment_count>
    <who name="kangax">kangax</who>
    <bug_when>2010-10-18 13:04:38 -0700</bug_when>
    <thetext>Hey Oliver.

I don&apos;t have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example:

(function(){ &quot;use strict&quot;; eval(&apos;with({ }) { }&apos;) })(); // no error

To quote 10.1.1:

&quot;Eval code is strict eval code if it begins with a Directive Prologue that contains a Use Strict Directive or if the call to eval is a direct call (see 15.1.2.1.1) to the eval function that is contained in strict mode code.&quot;

Note &quot;direct call [...] contained in strict mode code&quot;. So based on my understanding (and actually, FF4 behavior) this should throw error, but currently doesn&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295835</commentid>
    <comment_count>8</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-18 16:42:00 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Hey Oliver.
&gt; 
&gt; I don&apos;t have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example:
&gt; 
&gt; (function(){ &quot;use strict&quot;; eval(&apos;with({ }) { }&apos;) })(); // no error

Was this in the inspector? I&apos;m seeing weird behaviour where code in the inspectors console fails to trigger strict mode</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295839</commentid>
    <comment_count>9</comment_count>
    <who name="kangax">kangax</who>
    <bug_when>2010-10-18 16:49:20 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Hey Oliver.
&gt; &gt; 
&gt; &gt; I don&apos;t have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example:
&gt; &gt; 
&gt; &gt; (function(){ &quot;use strict&quot;; eval(&apos;with({ }) { }&apos;) })(); // no error
&gt; 
&gt; Was this in the inspector? I&apos;m seeing weird behaviour where code in the inspectors console fails to trigger strict mode

Ah. yes it was. Doesn&apos;t happen when run from within &lt;script&gt; element. 

Well, then I have nothing else as far as strict mode. Will file bugs if I find anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>295842</commentid>
    <comment_count>10</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-10-18 16:57:32 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; &gt; (In reply to comment #7)
&gt; &gt; &gt; Hey Oliver.
&gt; &gt; &gt; 
&gt; &gt; &gt; I don&apos;t have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example:
&gt; &gt; &gt; 
&gt; &gt; &gt; (function(){ &quot;use strict&quot;; eval(&apos;with({ }) { }&apos;) })(); // no error
&gt; &gt; 
&gt; &gt; Was this in the inspector? I&apos;m seeing weird behaviour where code in the inspectors console fails to trigger strict mode
&gt; 
&gt; Ah. yes it was. Doesn&apos;t happen when run from within &lt;script&gt; element. 
&gt; 
&gt; Well, then I have nothing else as far as strict mode. Will file bugs if I find anything.

I just landed a fix for the Function constructor which should appear in the next nightly</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>297803</commentid>
    <comment_count>11</comment_count>
    <who name="kangax">kangax</who>
    <bug_when>2010-10-21 20:08:15 -0700</bug_when>
    <thetext>I think I&apos;m seeing browser crash under strict mode. Filed a separate bug for it — https://bugs.webkit.org/show_bug.cgi?id=48109

Oliver, can you please take a look?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>422457</commentid>
    <comment_count>12</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-06-17 00:30:30 -0700</bug_when>
    <thetext>All the strict mode tests pass for me in ToT.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>