{ "testCollection": { "name": "8.7.2", "numTests": 9, "tests": [ { "id": "8.7.2-1-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-1-s.js", "description": "Strict Mode - ReferenceError is thrown if LeftHandSide evaluates to an unresolvable Reference", "test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_8_7_2_1 = 11;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n", "precondition": "(fnSupportsStrict())", "strict_only": "" }, { "id": "8.7.2-2-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-2-s.js", "description": "Strict Mode - ReferenceError isn't thrown if LeftHandSide evaluates to a resolvable Reference", "test": "assertTrue((function testcase() {\n \"use strict\";\n var b = 11;\n return b === 11;\n }).call(this));\n", "strict_only": "" }, { "id": "8.7.2-3-1-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-3-1-s.js", "description": "eval - a property named 'eval' is permitted", "test": "assertTrue((function testcase() {\n 'use strict';\n\n var o = { eval: 42};\n return true;\n }).call(this));\n", "strict_only": "" }, { "id": "8.7.2-3-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-3-s.js", "description": "Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-writable data property", "test": "assertTrue((function testcase() {\n \"use strict\";\n var _8_7_2_3 = {};\n Object.defineProperty(_8_7_2_3, \"b\", {\n writable: false\n });\n\n try {\n _8_7_2_3.b = 11;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n", "precondition": "(fnExists(Object.defineProperty) && fnSupportsStrict())", "strict_only": "" }, { "id": "8.7.2-4-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-4-s.js", "description": "Strict Mode - TypeError is thrown if LeftHandSide is a reference to an accessor property with no setter", "test": "assertTrue((function testcase() {\n \"use strict\";\n var _8_7_2_4 = {};\n var _8_7_2_4_bValue = 1;\n Object.defineProperty(_8_7_2_4, \"b\", {\n get: function () { return _8_7_2_4_bValue; }\n });\n\n try {\n _8_7_2_4.b = 11;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n", "precondition": "(fnExists(Object.defineProperty) && fnSupportsStrict())", "strict_only": "" }, { "id": "8.7.2-5-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-5-s.js", "description": "Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-existent property of an non-extensible object", "test": "assertTrue((function testcase() {\n \"use strict\";\n var _8_7_2_5 = {};\n Object.preventExtensions(_8_7_2_5);\n\n try {\n _8_7_2_5.b = 11;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n", "precondition": "(fnExists(Object.preventExtensions) && fnSupportsStrict())", "strict_only": "" }, { "id": "8.7.2-6-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-6-s.js", "description": "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a writable data property", "test": "assertTrue((function testcase() {\n \"use strict\";\n var _8_7_2_6 = {};\n Object.defineProperty(_8_7_2_6, \"b\", {\n writable: true\n });\n\n _8_7_2_6.b = 11;\n\n return _8_7_2_6.b === 11;\n }).call(this));\n", "precondition": "(fnExists(Object.defineProperty))", "strict_only": "" }, { "id": "8.7.2-7-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-7-s.js", "description": "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to an accessor property with setter", "test": "assertTrue((function testcase() {\n \"use strict\";\n var _8_7_2_7 = {};\n var _8_7_2_7_bValue = 1;\n Object.defineProperty(_8_7_2_7, \"b\", {\n get: function () { return _8_7_2_7_bValue; },\n set: function (value) { _8_7_2_7_bValue = value; }\n });\n\n _8_7_2_7.b = 11;\n return _8_7_2_7.b === 11;\n }).call(this));\n", "precondition": "(fnExists(Object.defineProperty))", "strict_only": "" }, { "id": "8.7.2-8-s", "path": "TestCases/chapter08/8.7/8.7.2/8.7.2-8-s.js", "description": "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a property of an extensible object", "test": "assertTrue((function testcase() {\n \"use strict\";\n var _8_7_2_8 = {};\n\n _8_7_2_8.b = 11;\n\n return _8_7_2_8.b === 11;\n }).call(this));\n", "strict_only": "" } ] } }