Strict Mode and Function

Dmitry A. Soshnikov dmitry.soshnikov at gmail.com
Wed Jun 2 02:13:31 PDT 2010


Hello,

Recently I was writing an article about strict mode in ES5 
(http://bit.ly/928Jwl).

At the moment, the only implementation for testing is already mentioned 
here -- BESEN engine. BESEN still has some bugs (some of them I’ve 
reported while was writing the article and glad to see that several bugs 
are already fixed), but it is a good candidate for ES5 programming and 
testing.

Nevertheless, the talk isn't about BESEN, but about inconsistent of the 
"Annex C (informative) The Strict Mode of ECMAScript" entry and the test 
suite cases related with the strict mode and functions created via the 
Function constructor.

That bullet of the Annex C statements:

"It is a SyntaxError to use within strict mode code the identifiers 
/eval/ or /arguments/ as the Identifier of a FunctionDeclaration or 
FunctionExpression or as a formal parameter name (13.1). Attempting to 
/dynamically define such a strict mode function using the Function 
constructor/ (15.3.2) will throw a /SyntaxError/ exception."

I've posted a bug to the BESEN's author -- http://bit.ly/bmkN1p

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

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.

Dmitry.


More information about the es-discuss mailing list