Strict Mode and Function

Allen Wirfs-Brock Allen.Wirfs-Brock at microsoft.com
Wed Jun 2 11:22:52 PDT 2010


> From: Dmitry A. Soshnikov
> 
> But he referenced to the conformance test suite --
> http://es5conform.codeplex.com/ and in particular for these test cases
> -- http://vserver.rosseaux.net/stuff/tests/
> 
> where is said that "arguments" and "eval" are allowed in such cases:
> 
> http://vserver.rosseaux.net/stuff/tests/15.3.2.1-11-7-s.js -- arguments
> http://vserver.rosseaux.net/stuff/tests/15.3.2.1-11-4-s.js -- eval
> 
These tests are valid.  The constructed function is not "strict" because its body does not contain a "use strict" directive. The strictness of the caller of the Function constructor does not affect the strictness of the constructed function. That's what these tests are verifying WRT strict function  formal parameter restrictions.

Test 15.3.2.1-11-3-s.js verifies that using 'eval' as a formal parameter to a constructed function containing a "use strict" directive throws a SyntaxError. The need be another similar test for 'arguments'.

> So, is it an err in the Annex C statement or the tests are incorrect? I don't see the
> same restriction in the exact 15.3.2 section as it mentioned in the Annex C.
>
See step 10 of 15.3.2.1

Allen


More information about the es-discuss mailing list