{ "testCollection": { "name": "15.3.2.1", "numTests": 12, "tests": [ { "id": "15.3.2.1-11-1-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js", "description": "Duplicate seperate parameter name in Function constructor throws SyntaxError in strict mode", "test": "assertTrue((function testcase() { \n try {\n Function('a','a','\"use strict\";');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n \n }).call(this));\n", "precondition": "(fnSupportsStrict())", "strict_only": "" }, { "id": "15.3.2.1-11-1", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1.js", "description": "Duplicate separate parameter name in Function constructor allowed if body not strict", "test": "assertTrue((function testcase()\n{ \n Function('a','a','return;');\n return true;\n }).call(this));\n" }, { "id": "15.3.2.1-11-2-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js", "description": "Duplicate seperate parameter name in Function constructor called from strict mode allowed if body not strict", "test": "assertTrue((function testcase()\n{ \n \"use strict\"; \n try {\n Function('a','a','return;');\n return true;\n } catch (e) {\n return false;\n }\n }).call(this));\n", "strict_only": "" }, { "id": "15.3.2.1-11-3-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js", "description": "Function constructor having a formal parameter named 'eval' throws SyntaxError if function body is strict mode", "test": "assertTrue((function testcase() {\n \n\n try {\n Function('eval', '\"use strict\";');\n\treturn false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n", "precondition": "(fnSupportsStrict())", "strict_only": "" }, { "id": "15.3.2.1-11-3", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3.js", "description": "Function constructor may have a formal parameter named 'eval' if body is not strict mode", "test": "assertTrue((function testcase() {\n Function('eval', 'return;');\n return true;\n }).call(this));\n" }, { "id": "15.3.2.1-11-4-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js", "description": "Function constructor call from strict code with formal parameter named 'eval' does not throws SyntaxError if function body is not strict mode", "test": "assertTrue((function testcase() {\n \"use strict\";\n try { \n Function('eval', 'return;');\n\t return true;\n } catch (e) {\n return false;\n }\n \n }).call(this));\n", "strict_only": "" }, { "id": "15.3.2.1-11-5-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js", "description": "Duplicate combined parameter name in Function constructor throws SyntaxError in strict mode", "test": "assertTrue((function testcase()\n{ \n try \n {\n Function('a,a','\"use strict\";');\n\treturn false;\n }\n catch (e) {\n return(e instanceof SyntaxError);\n }\n }).call(this));\n", "precondition": "(fnSupportsStrict())", "strict_only": "" }, { "id": "15.3.2.1-11-5", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5.js", "description": "Duplicate combined parameter name in Function constructor allowed if body is not strict", "test": "assertTrue((function testcase()\n{ \n Function('a,a','return;');\n return true;\n }).call(this));\n" }, { "id": "15.3.2.1-11-6-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js", "description": "Duplicate combined parameter name allowed in Function constructor called in strict mode if body not strict", "test": "assertTrue((function testcase()\n{ \n \"use strict\"; \n try {\n Function('a,a','return a;');\n\t return true;\n } catch (e) {\n return false;\n }\n \n }).call(this));\n", "strict_only": "" }, { "id": "15.3.2.1-11-7-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js", "description": "Function constructor call from strict code with formal parameter named arguments does not throws SyntaxError if function body is not strict mode", "test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n Function('arguments', 'return;');\n return true;\n\t \n } catch (e) {\n return false;\n }\n }).call(this));\n", "strict_only": "" }, { "id": "15.3.2.1-11-8-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js", "description": "Strict Mode - SyntaxError is not thrown if a function is created using a Function constructor that has two identical parameters, which are separated by a unique parameter name and there is no explicit 'use strict' in the function constructor's body", "test": "assertTrue((function testcase() {\n \"use strict\";\n\n var foo = new Function(\"baz\", \"qux\", \"baz\", \"return 0;\");\n return true;\n\n }).call(this));\n", "strict_only": "" }, { "id": "15.3.2.1-11-9-s", "path": "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js", "description": "Strict Mode - SyntaxError is thrown if a function is created using the Function constructor that has three identical parameters and there is no explicit 'use strict' in the function constructor's body", "test": "assertTrue((function testcase() {\n \"use strict\";\n\n var foo = new Function(\"baz\", \"baz\", \"baz\", \"return 0;\");\n return true;\n }).call(this));\n", "strict_only": "" } ] } }