Much rougher: A first attempt at building the testcases for the website based on the new canonical test262 style testcase.

This commit is contained in:
Mark Miller 2011-09-07 00:02:16 -07:00
parent 2f25dc8f0c
commit 9fab5f9a3a
422 changed files with 76432 additions and 0 deletions

View File

@ -0,0 +1,248 @@
{
"testCollection": {
"name": "10.1.1",
"numTests": 32,
"tests": [
{
"id": "10.1.1-1-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-1-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is 'use strict'; which contains two space between 'use' and 'strict'",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var public = 1;\n return public === 1;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-10-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-10-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''USE STRICT';' in which all characters are uppercase",
"test": "assertTrue((function testcase() {\n \"USE STRICT\";\n var public = 1;\n return public === 1;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-11-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-11-s.js",
"description": "Strict Mode - Eval code is strict code with a Use Strict Directive at the beginning of the block",
"test": "assertTrue((function testcase() {\n try {\n eval(\"'use strict'; var public = 1; var anotherVariableNotReserveWord = 2;\");\n\n return false;\n } catch (e) {\n return e instanceof SyntaxError && typeof public === \"undefined\" &&\n typeof anotherVariableNotReserveWord === \"undefined\";\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-12-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-12-s.js",
"description": "Strict Mode - Eval code is strict eval code with a Use Strict Directive in the middle of the block",
"test": "assertTrue((function testcase() {\n eval(\"var public = 1; 'use strict'; var anotherVariableNotReserveWord = 2;\");\n return public === 1 && anotherVariableNotReserveWord === 2;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-13-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-13-s.js",
"description": "Strict Mode - Eval code is strict eval code with a Use Strict Directive at the end of the block",
"test": "assertTrue((function testcase() {\n eval(\"var public = 1; var anotherVariableNotReserveWord = 2; 'use strict';\");\n return public === 1 && anotherVariableNotReserveWord === 2;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-14-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-14-s.js",
"description": "Strict Mode - The call to eval function is contained in a Strict Mode block",
"test": "assertTrue((function testcase() {\n 'use strict';\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return true;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-15-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-15-s.js",
"description": "Strict Mode - Function code that is part of a FunctionDeclaration is strict function code if FunctionDeclaration is contained in use strict",
"test": "assertTrue((function testcase() {\n \"use strict\";\n function fun() {\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }\n\n return fun();\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-16-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-16-s.js",
"description": "Strict Mode - Function code that is part of a FunctionExpression is strict function code if FunctionExpression is contained in use strict",
"test": "assertTrue((function testcase() {\n \"use strict\";\n return function () {\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n } ();\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-17-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-17-s.js",
"description": "Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(getter)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n var obj = {};\n Object.defineProperty(obj, \"accProperty\", {\n get: function () {\n eval(\"public = 1;\");\n return 11;\n }\n });\n\n var temp = obj.accProperty === 11;\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "10.1.1-18-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-18-s.js",
"description": "Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(setter)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n var obj = {};\n var data = \"data\";\n Object.defineProperty(obj, \"accProperty\", {\n set: function (value) {\n eval(\"var public = 1;\");\n data = value;\n }\n });\n\n obj.accProperty = \"overrideData\";\n return false;\n } catch (e) {\n return e instanceof SyntaxError && data === \"data\";\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "10.1.1-19-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-19-s.js",
"description": "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the start of the block",
"test": "assertTrue((function testcase() {\n function fun() {\n \"use strict\";\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }\n return fun();\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-2-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-2-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''use strict'' which lost the last character ';'",
"test": "assertTrue((function testcase() {\n \"use strict\"\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-20-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-20-s.js",
"description": "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears in the middle of the block",
"test": "assertTrue((function testcase() {\n function fun() {\n eval(\"var public = 1;\");\n \"use strict\";\n return public === 1;\n }\n return fun();\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-21-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-21-s.js",
"description": "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the end of the block",
"test": "assertTrue((function testcase() {\n function fun() {\n eval(\"var public = 1;\");\n return public === 1;\n \"use strict\";\n }\n return fun();\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-22-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-22-s.js",
"description": "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the start of the block",
"test": "assertTrue((function () {\n \"use strict\";\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n } ()));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-23-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-23-s.js",
"description": "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears in the middle of the block",
"test": "assertTrue((function () {\n eval(\"var public = 1;\");\n return public === 1;\n \"use strict\";\n } ()));\n",
"strict_only": ""
},
{
"id": "10.1.1-24-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-24-s.js",
"description": "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the end of the block",
"test": "assertTrue((function () {\n eval(\"var public = 1;\");\n \"use strict\";\n return public === 1;\n } ()));\n",
"strict_only": ""
},
{
"id": "10.1.1-25-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-25-s.js",
"description": "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(getter)",
"test": "assertTrue((function testcase() {\n try {\n var obj = {};\n Object.defineProperty(obj, \"accProperty\", {\n get: function () {\n \"use strict\";\n eval(\"var public = 1;\");\n return 11;\n }\n });\n var temp = obj.accProperty === 11;\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "10.1.1-26-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-26-s.js",
"description": "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(setter)",
"test": "assertTrue((function testcase() {\n try {\n var obj = {};\n var data = \"data\";\n Object.defineProperty(obj, \"accProperty\", {\n set: function (value) {\n \"use strict\";\n eval(\"var public = 1;\");\n data = value;\n }\n });\n\n obj.accProperty = \"overrideData\";\n\n return false;\n } catch (e) {\n return e instanceof SyntaxError && data === \"data\";\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "10.1.1-27-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-27-s.js",
"description": "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears in the middle of the block(getter)",
"test": "assertTrue((function testcase() {\n var obj = {};\n Object.defineProperty(obj, \"accProperty\", {\n get: function () {\n eval(\"public = 1;\");\n \"use strict\";\n return 11;\n }\n });\n return obj.accProperty === 11 && public === 1;\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "10.1.1-28-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-28-s.js",
"description": "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the end of the block(setter)",
"test": "assertTrue((function testcase() {\n var obj = {};\n var data;\n \n Object.defineProperty(obj, \"accProperty\", {\n set: function (value) {\n var _10_1_1_28_s = {a:1, a:2};\n data = value;\n \"use strict\";\n }\n });\n obj.accProperty = \"overrideData\";\n return data===\"overrideData\";\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "10.1.1-29-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-29-s.js",
"description": "Strict Mode - The built-in Function constructor is contained in use strict code",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var funObj = new Function(\"a\", \"eval('public = 1;');\");\n funObj();\n return true;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-3-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-3-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is '' use strict';' which the first character is space",
"test": "assertTrue((function testcase() {\n \" use strict\";\n var public = 1;\n\n return public === 1;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-30-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-30-s.js",
"description": "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the start of the block",
"test": "assertTrue((function testcase() {\n try {\n var funObj = new Function(\"a\", \"'use strict'; eval('public = 1;');\");\n funObj();\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-31-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-31-s.js",
"description": "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears in the middle of the block",
"test": "assertTrue((function testcase() {\n var funObj = new Function(\"a\", \"eval('public = 1;'); 'use strict'; anotherVariable = 2;\");\n funObj();\n return public === 1 && anotherVariable === 2;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-32-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-32-s.js",
"description": "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the end of the block",
"test": "assertTrue((function testcase() {\n var funObj = new Function(\"a\", \"eval('public = 1;'); anotherVariable = 2; 'use strict';\");\n funObj();\n return public === 1 && anotherVariable === 2;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-4-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-4-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''use strict ';' which the last character is space",
"test": "assertTrue((function testcase() {\n \"use strict \";\n var public = 1;\n return public === 1;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-5-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-5-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the beginning of the block",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-6-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-6-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears in the middle of the block",
"test": "assertTrue((function testcase() {\n var interface = 2;\n \"use strict\";\n var public = 1;\n return public === 1 && interface === 2;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-7-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-7-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the end of the block",
"test": "assertTrue((function testcase() {\n var public = 1;\n return public === 1;\n \"use strict\";\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.1.1-8-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-8-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the directive prologue",
"test": "assertTrue((function testcase() {\n \"use strict\";\n \"use strict\";\n try {\n eval(\"var public = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.1.1-9-s",
"path": "TestCases/chapter10/10.1/10.1.1/10.1.1-9-s.js",
"description": "Strict Mode - Use Strict Directive Prologue is ''Use strict';' in which the first character is uppercase",
"test": "assertTrue((function testcase() {\n \"Use strict\";\n var public = 1;\n return public === 1;\n }).call(this));\n",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,56 @@
{
"testCollection": {
"name": "10.1.3_Variable_Instantiation",
"numTests": 8,
"tests": [
{
"section": "10.1.3",
"description": "Calling function excluding a few parameters",
"test": "//CHECK#1\nfunction f1(a, b){\n return (b === undefined);\n}\nif(!(f1(1, 2) === false)){\n $ERROR('#1: f1(1, 2) === false');\n} else if(!(f1(1) === true)){\n $ERROR('#1: f1(1) === true');\n}\n\n//CHECK#2\nfunction f2(a, b, c){\n return (b === undefined) && (c === undefined);\n}\nif(!(f2(1) === true)){\n $ERROR('#2: f2(1, 2) === true');\n}\n",
"id": "S10.1.3_A1"
},
{
"section": "10.1.3",
"description": "Creating functions initialized with two or more formal parameters, which have the same name",
"test": "//CHECK#1\nfunction f1(x, x) {\n return x;\n}\nif(!(f1(1, 2) === 2)) {\n $ERROR(\"#1: f1(1, 2) === 2\");\n}\n\n//CHECK#2\nfunction f2(x, x, x){\n return x*x*x;\n}\nif(!(f2(1, 2, 3) === 27)){\n $ERROR(\"f2(1, 2, 3) === 27\");\n}\n\n//CHECK#3\nfunction f3(x, x) {\n return 'a' + x;\n}\nif(!(f3(1, 2) === 'a2')){\n $ERROR(\"#3: f3(1, 2) === 'a2'\");\n}\n",
"id": "S10.1.3_A2"
},
{
"section": "10.1.3",
"description": "Creating functions with two or more formal parameters,\nthat have the same name. Calling this function excluding a few last parameters",
"test": "//CHECK#1\nfunction f1(x, a, b, x){\n return x;\n}\nif(!(f1(1, 2) === undefined)){\n $ERROR('#1: f1(1, 2) === undefined');\n}\n",
"id": "S10.1.3_A3"
},
{
"section": "10.1.3",
"description": "Checking existence of a function with passed parameter",
"test": "//CHECK#1\nfunction f1(x){\n return x;\n \n function x(){\n return 7;\n }\n}\nif(!(f1().constructor.prototype === Function.prototype)){\n $ERROR('#1: f1() returns function');\n}\n\n//CHECK#2\nfunction f2(x){\n return typeof x;\n \n function x(){\n return 7;\n }\n}\nif(!(f2() === \"function\")){\n $ERROR('#2: f2() === \"function\"');\n}\n\n//CHECK#3\nfunction f3() {\n return typeof arguments;\n function arguments() {\n return 7;\n }\n}\nif (!(f3() === \"function\")){\n $ERROR('#3: f3() === \"function\"');\n}\n",
"id": "S10.1.3_A4_T1"
},
{
"section": "10.1.3",
"description": "Checking existence of a function with declared variable",
"test": "//CHECK#1\nfunction f1(){\n var x;\n \n return x;\n \n function x(){\n return 7;\n }\n}\nif(!(f1().constructor.prototype === Function.prototype)){\n $PRINT('#1: f1() returns function');\n}\n\n//CHECK#2\nfunction f2(){\n var x;\n \n return typeof x;\n \n function x(){\n return 7;\n }\n}\nif(!(f2() === \"function\")){\n $PRINT('#2: f2() === \"function\"');\n}\n",
"id": "S10.1.3_A4_T2"
},
{
"section": "10.1.3",
"description": "Checking variable existence only",
"test": "//CHECK#1\nfunction f1(){\n var x;\n \n return typeof x;\n}\n\nif(!(f1() === \"undefined\")){\n $PRINT('#1: f1() === \"undefined\"');\n}\n\n//CHECK#2\nfunction f2(){\n var x;\n \n return x;\n}\n\nif(!(f2() === undefined)){\n $PRINT('#1: f2() === undefined');\n}\n",
"id": "S10.1.3_A5.1_T1"
},
{
"section": "10.1.3",
"description": "Checking existence of the variable object property with formal parameter",
"test": "//CHECK#1\nfunction f1(x){\n var x;\n \n return typeof x;\n}\n\nif(!(f1() === \"undefined\")){\n $PRINT('#1: f1(1) === \"undefined\"');\n}\n\n//CHECK#2\nfunction f2(x){\n var x;\n \n return x;\n}\n\nif(!(f2() === undefined)){\n $PRINT('#1: f2(1) === undefined');\n}\n",
"id": "S10.1.3_A5.1_T2"
},
{
"section": "10.1.3",
"description": "Checking existence of the variable object property with formal parameter",
"test": "//CHECK#1\nfunction f1(x){\n var x;\n \n return typeof x;\n}\n\nif(!(f1(1) === \"number\")){\n $PRINT('#1: f1(1) === \"number\"');\n}\n\n//CHECK#2\nfunction f2(x){\n var x;\n \n return x;\n}\n\nif(!(f2(1) === 1)){\n $PRINT('#1: f2(1) === 1');\n}\n",
"id": "S10.1.3_A5.2_T1"
}
]
}
}

View File

@ -0,0 +1,62 @@
{
"testCollection": {
"name": "10.1.4_Scope_Chain_and_Identifier_Resolution",
"numTests": 9,
"tests": [
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations",
"test": "var x = 0;\n\nfunction f1(){\n var x = 1;\n function f2(){\n return x;\n };\n return f2();\n}\n\nif(!(f1() === 1)){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T1"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations",
"test": "var x = 0;\n\nfunction f1(){\n function f2(){\n return x;\n };\n return f2();\n}\n\nif(!(f1() === 0)){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T2"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations",
"test": "var x = 0;\n\nfunction f1(){\n function f2(){\n return x;\n };\n return f2();\n \n var x = 1;\n}\n\nif(!(f1() === undefined)){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n\n",
"id": "S10.1.4_A1_T3"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations",
"test": "var x = 0;\n\nfunction f1(){\n function f2(){\n return x;\n };\n\n var x = 1;\n return f2();\n}\n\nif(!(f1() === 1)){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T4"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations and \"with\"",
"test": "var x = 0;\n\nvar myObj = {x : \"obj\"};\n\nfunction f1(){\n var x = 1;\n function f2(){\n with(myObj){\n return x;\n }\n };\n return f2();\n}\n\nif(!(f1() === \"obj\")){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T5"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations and \"with\"",
"test": "var x = 0;\n\nvar myObj = {x : \"obj\"};\n\nfunction f1(){\n function f2(){\n with(myObj){\n return x;\n }\n };\n return f2();\n}\n\nif(!(f1() === \"obj\")){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T6"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations and \"with\"",
"test": "var x = 0;\n\nvar myObj = {x : \"obj\"};\n\nfunction f1(){\n function f2(){\n with(myObj){\n return x;\n }\n };\n return f2();\n \n var x = 1;\n}\n\nif(!(f1() === \"obj\")){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T7"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations and \"with\"",
"test": "var x = 0;\n\nvar myObj = {x : \"obj\"};\n\nfunction f1(){\n function f2(){\n with(myObj){\n return x;\n }\n };\n\n var x = 1;\n return f2();\n}\n\nif(!(f1() === \"obj\")){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T8"
},
{
"section": "10.1.4",
"description": "Checking scope chain containing function declarations and \"with\"",
"test": "var x = 0;\n\nvar myObj = {x : \"obj\"};\n\nfunction f1(){\n with(myObj){\n return x;\n }\n}\n\nif(!(f1() === \"obj\")){\n $ERROR(\"#1: Scope chain disturbed\");\n}\n",
"id": "S10.1.4_A1_T9"
}
]
}
}

View File

@ -0,0 +1,152 @@
{
"testCollection": {
"name": "10.1.5_Global_Object",
"numTests": 24,
"tests": [
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Value Properties",
"test": "//CHECK#1\nif ( NaN === null ) {\n $ERROR(\"#1: NaN === null\");\n}\n\n//CHECK#2\nif ( Infinity === null ) {\n $ERROR(\"#2: Infinity === null\");\n}\n\n//CHECK#3\nif ( undefined === null ) {\n $ERROR(\"#3: undefined === null\");\n}\n",
"id": "S10.1.5_A1.1_T1"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Function Properties",
"test": "//CHECK#4\nif ( eval === null ) {\n $ERROR(\"#4: eval === null\");\n}\n\n//CHECK#5\nif ( parseInt === null ) {\n $ERROR(\"#5: parseInt === null\");\n}\n\n//CHECK#6\nif ( parseFloat === null ) {\n $ERROR(\"#6: parseFloat === null\");\n}\n\n//CHECK#7\nif ( isNaN === null ) {\n $ERROR(\"#7: isNaN === null\");\n}\n\n//CHECK#8\nif ( isFinite === null ) {\n $ERROR(\"#8: isFinite === null\");\n}\n\n//CHECK#9\nif ( decodeURI === null ) {\n $ERROR(\"#9: decodeURI === null\");\n}\n\n//CHECK#10\nif ( decodeURIComponent === null ) {\n $ERROR(\"#10: decodeURIComponent === null\");\n}\n\n//CHECK#11\nif ( encodeURI === null ) {\n $ERROR(\"#11: encodeURI === null\");\n}\n\n//CHECK#12\nif ( encodeURIComponent === null ) {\n $ERROR(\"#12: encodeURIComponent === null\");\n}\n",
"id": "S10.1.5_A1.1_T2"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Constructor Properties",
"test": "//CHECK#13\nif ( Object === null ) {\n $ERROR(\"#13: Object === null\");\n}\n\n//CHECK#14\nif ( Function === null ) {\n $ERROR(\"#14: Function === null\");\n}\n\n//CHECK#15\nif ( String === null ) {\n $ERROR(\"#15: String === null\");\n}\n\n//CHECK#16\nif ( Number === null ) {\n $ERROR(\"#16: Number === null\");\n}\n\n//CHECK#17\nif ( Array === null ) {\n $ERROR(\"#17: Array === null\");\n}\n\n//CHECK#18\nif ( Boolean === null ) {\n $ERROR(\"#20: Boolean === null\");\n}\n\n//CHECK#18\nif ( Date === null ) {\n $ERROR(\"#18: Date === null\");\n}\n\n//CHECK#19\nif ( RegExp === null ) {\n $ERROR(\"#19: RegExp === null\");\n}\n\n//CHECK#20\nif ( Error === null ) {\n $ERROR(\"#20: Error === null\");\n}\n\n//CHECK#21\nif ( EvalError === null ) {\n $ERROR(\"#21: EvalError === null\");\n}\n\n//CHECK#22\nif ( RangeError === null ) {\n $ERROR(\"#22: RangeError === null\");\n}\n\n//CHECK#23\nif ( ReferenceError === null ) {\n $ERROR(\"#23: ReferenceError === null\");\n}\n\n//CHECK#24\nif ( SyntaxError === null ) {\n $ERROR(\"#24: SyntaxError === null\");\n}\n\n//CHECK#25\nif ( TypeError === null ) {\n $ERROR(\"#25: TypeError === null\");\n}\n\n//CHECK#26\nif ( URIError === null ) {\n $ERROR(\"#26: URIError === null\");\n}\n\n",
"id": "S10.1.5_A1.1_T3"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Other Properties",
"test": "//CHECK#27\nif ( Math === null ) {\n $ERROR(\"#27: Math === null\");\n}\n",
"id": "S10.1.5_A1.1_T4"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Value Properties",
"test": "function test() {\n //CHECK#1\n if ( NaN === null ) {\n $ERROR(\"#1: NaN === null\");\n }\n\n //CHECK#2\n if ( Infinity === null ) {\n $ERROR(\"#2: Infinity === null\");\n }\n\n //CHECK#3\n if ( undefined === null ) {\n $ERROR(\"#3: undefined === null\");\n }\n}\n\ntest();\n",
"id": "S10.1.5_A1.2_T1"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Function Properties",
"test": "function test() {\n //CHECK#4\n if ( eval === null ) {\n $ERROR(\"#4: eval === null\");\n }\n\n //CHECK#5\n if ( parseInt === null ) {\n $ERROR(\"#5: parseInt === null\");\n }\n\n //CHECK#6\n if ( parseFloat === null ) {\n $ERROR(\"#6: parseFloat === null\");\n }\n\n //CHECK#7\n if ( isNaN === null ) {\n $ERROR(\"#7: isNaN === null\");\n }\n\n //CHECK#8\n if ( isFinite === null ) {\n $ERROR(\"#8: isFinite === null\");\n }\n\n //CHECK#9\n if ( decodeURI === null ) {\n $ERROR(\"#9: decodeURI === null\");\n }\n\n //CHECK#10\n if ( decodeURIComponent === null ) {\n $ERROR(\"#10: decodeURIComponent === null\");\n }\n\n //CHECK#11\n if ( encodeURI === null ) {\n $ERROR(\"#11: encodeURI === null\");\n }\n\n //CHECK#12\n if ( encodeURIComponent === null ) {\n $ERROR(\"#12: encodeURIComponent === null\");\n }\n}\n\ntest();\n",
"id": "S10.1.5_A1.2_T2"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Constructor Properties",
"test": "function test() {\n //CHECK#13\n if ( Object === null ) {\n $ERROR(\"#13: Object === null\");\n }\n\n //CHECK#14\n if ( Function === null ) {\n $ERROR(\"#14: Function === null\");\n }\n\n //CHECK#15\n if ( String === null ) {\n $ERROR(\"#15: String === null\");\n }\n\n //CHECK#16\n if ( Number === null ) {\n $ERROR(\"#16: Function === null\");\n }\n\n //CHECK#17\n if ( Array === null ) {\n $ERROR(\"#17: Array === null\");\n }\n\n //CHECK#18\n if ( Boolean === null ) {\n $ERROR(\"#20: Boolean === null\");\n }\n\n //CHECK#18\n if ( Date === null ) {\n $ERROR(\"#18: Date === null\");\n }\n\n //CHECK#19\n if ( RegExp === null ) {\n $ERROR(\"#19: RegExp === null\");\n }\n\n //CHECK#20\n if ( Error === null ) {\n $ERROR(\"#20: Error === null\");\n }\n\n //CHECK#21\n if ( EvalError === null ) {\n $ERROR(\"#21: EvalError === null\");\n }\n\n //CHECK#22\n if ( RangeError === null ) {\n $ERROR(\"#22: RangeError === null\");\n }\n\n //CHECK#23\n if ( ReferenceError === null ) {\n $ERROR(\"#23: ReferenceError === null\");\n }\n\n //CHECK#24\n if ( SyntaxError === null ) {\n $ERROR(\"#24: SyntaxError === null\");\n }\n\n //CHECK#25\n if ( TypeError === null ) {\n $ERROR(\"#25: TypeError === null\");\n }\n\n //CHECK#26\n if ( URIError === null ) {\n $ERROR(\"#26: URIError === null\");\n }\n}\n\ntest();\n",
"id": "S10.1.5_A1.2_T3"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Other Properties",
"test": "function test() {\n //CHECK#27\n if ( Math === null ) {\n $ERROR(\"#27: Math === null\");\n }\n}\n\ntest();\n",
"id": "S10.1.5_A1.2_T4"
},
{
"section": "10.1.5, 15.1",
"description": "Eval execution context - Value Properties",
"test": "var evalStr = \n'//CHECK#1\\n'+\n'if ( NaN === null ) {\\n'+\n' $ERROR(\"#1: NaN === null\");\\n'+\n'}\\n'+\n\n'//CHECK#2\\n'+\n'if ( Infinity === null ) {\\n'+\n' $ERROR(\"#2: Infinity === null\");\\n'+\n'}\\n'+\n\n'//CHECK#3\\n'+\n'if ( undefined === null ) {\\n'+\n' $ERROR(\"#3: undefined === null\");\\n'+\n'}\\n'+\n';\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A1.3_T1"
},
{
"section": "10.1.5, 15.1",
"description": "Eval execution context - Function Properties",
"test": "var evalStr = \n'//CHECK#4\\n'+\n'if ( eval === null ) {\\n'+\n' $ERROR(\"#4: eval === null\");\\n'+\n'}\\n'+\n\n'//CHECK#5\\n'+\n'if ( parseInt === null ) {\\n'+\n' $ERROR(\"#5: parseInt === null\");\\n'+\n'}\\n'+\n\n'//CHECK#6\\n'+\n'if ( parseFloat === null ) {\\n'+\n' $ERROR(\"#6: parseFloat === null\");\\n'+\n'}\\n'+\n\n'//CHECK#7\\n'+\n'if ( isNaN === null ) {\\n'+\n' $ERROR(\"#7: isNaN === null\");\\n'+\n'}\\n'+\n\n'//CHECK#8\\n'+\n'if ( isFinite === null ) {\\n'+\n' $ERROR(\"#8: isFinite === null\");\\n'+\n'}\\n'+\n\n'//CHECK#9\\n'+\n'if ( decodeURI === null ) {\\n'+\n' $ERROR(\"#9: decodeURI === null\");\\n'+\n'}\\n'+\n\n'//CHECK#10\\n'+\n'if ( decodeURIComponent === null ) {\\n'+\n' $ERROR(\"#10: decodeURIComponent === null\");\\n'+\n'}\\n'+\n\n'//CHECK#11\\n'+\n'if ( encodeURI === null ) {\\n'+\n' $ERROR(\"#11: encodeURI === null\");\\n'+\n'}\\n'+\n\n'//CHECK#12\\n'+\n'if ( encodeURIComponent === null ) {\\n'+\n' $ERROR(\"#12: encodeURIComponent === null\");\\n'+\n'}\\n'+\n';\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A1.3_T2"
},
{
"section": "10.1.5, 15.1",
"description": "Eval execution context - Constructor Properties",
"test": "var evalStr = \n'//CHECK#13\\n'+\n'if ( Object === null ) {\\n'+\n' $ERROR(\"#13: Object === null\");\\n'+\n'}\\n'+\n\n'//CHECK#14\\n'+\n'if ( Function === null ) {\\n'+\n' $ERROR(\"#14: Function === null\");\\n'+\n'}\\n'+\n\n'//CHECK#15\\n'+\n'if ( String === null ) {\\n'+\n' $ERROR(\"#15: String === null\");\\n'+\n'}\\n'+\n\n'//CHECK#16\\n'+\n'if ( Number === null ) {\\n'+\n' $ERROR(\"#16: Function === null\");\\n'+\n'}\\n'+\n\n'//CHECK#17\\n'+\n'if ( Array === null ) {\\n'+\n' $ERROR(\"#17: Array === null\");\\n'+\n'}\\n'+\n\n'//CHECK#18\\n'+\n'if ( Boolean === null ) {\\n'+\n' $ERROR(\"#20: Boolean === null\");\\n'+\n'}\\n'+\n\n'//CHECK#18\\n'+\n'if ( Date === null ) {\\n'+\n' $ERROR(\"#18: Date === null\");\\n'+\n'}\\n'+\n\n'//CHECK#19\\n'+\n'if ( RegExp === null ) {\\n'+\n' $ERROR(\"#19: RegExp === null\");\\n'+\n'}\\n'+\n\n'//CHECK#20\\n'+\n'if ( Error === null ) {\\n'+\n' $ERROR(\"#20: Error === null\");\\n'+\n'}\\n'+\n\n'//CHECK#21\\n'+\n'if ( EvalError === null ) {\\n'+\n' $ERROR(\"#21: EvalError === null\");\\n'+\n'}\\n'+\n\n'//CHECK#22\\n'+\n'if ( RangeError === null ) {\\n'+\n' $ERROR(\"#22: RangeError === null\");\\n'+\n'}\\n'+\n\n'//CHECK#23\\n'+\n'if ( ReferenceError === null ) {\\n'+\n' $ERROR(\"#23: ReferenceError === null\");\\n'+\n'}\\n'+\n\n'//CHECK#24\\n'+\n'if ( SyntaxError === null ) {\\n'+\n' $ERROR(\"#24: SyntaxError === null\");\\n'+\n'}\\n'+\n\n'//CHECK#25\\n'+\n'if ( TypeError === null ) {\\n'+\n' $ERROR(\"#25: TypeError === null\");\\n'+\n'}\\n'+\n\n'//CHECK#26\\n'+\n'if ( URIError === null ) {\\n'+\n' $ERROR(\"#26: URIError === null\");\\n'+\n'}\\n'+\n';\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A1.3_T3"
},
{
"section": "10.1.5, 15.1",
"description": "Eval execution context - Other Properties",
"test": "var evalStr = \n'//CHECK#27\\n'+\n'if ( Math === null ) {\\n'+\n' $ERROR(\"#27: Math === null\");\\n'+\n'}\\n'+\n';\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A1.3_T4"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Value Properties",
"test": "//CHECK#1\nfor (var x in this) {\n if ( x === 'NaN' ) {\n $ERROR(\"#1: 'NaN' have attribute DontEnum\");\n } else if ( x === 'Infinity' ) {\n $ERROR(\"#1: 'Infinity' have attribute DontEnum\");\n } else if ( x === 'undefined' ) {\n $ERROR(\"#1: 'undefined' have attribute DontEnum\");\n } \n}\n",
"id": "S10.1.5_A2.1_T1"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Function Properties",
"test": "//CHECK#1\nfor (var x in this) {\n if ( x === 'eval' ) {\n $ERROR(\"#1: 'eval' have attribute DontEnum\");\n } else if ( x === 'parseInt' ) {\n $ERROR(\"#1: 'parseInt' have attribute DontEnum\");\n } else if ( x === 'parseFloat' ) {\n $ERROR(\"#1: 'parseFloat' have attribute DontEnum\");\n } else if ( x === 'isNaN' ) {\n $ERROR(\"#1: 'isNaN' have attribute DontEnum\");\n } else if ( x === 'isFinite' ) {\n $ERROR(\"#1: 'isFinite' have attribute DontEnum\");\n } else if ( x === 'decodeURI' ) {\n $ERROR(\"#1: 'decodeURI' have attribute DontEnum\");\n } else if ( x === 'decodeURIComponent' ) {\n $ERROR(\"#1: 'decodeURIComponent' have attribute DontEnum\");\n } else if ( x === 'encodeURI' ) {\n $ERROR(\"#1: 'encodeURI' have attribute DontEnum\");\n } else if ( x === 'encodeURIComponent' ) {\n $ERROR(\"#1: 'encodeURIComponent' have attribute DontEnum\");\n } \n}\n",
"id": "S10.1.5_A2.1_T2"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Constructor Properties",
"test": "//CHECK#1\nfor (var x in this) {\n if ( x === 'Object' ) {\n $ERROR(\"#1: 'property 'Object' have attribute DontEnum\");\n } else if ( x === 'Function') {\n $ERROR(\"#1: 'Function' have attribute DontEnum\");\n } else if ( x === 'String' ) {\n $ERROR(\"#1: 'String' have attribute DontEnum\");\n } else if ( x === 'Number' ) {\n $ERROR(\"#1: 'Number' have attribute DontEnum\");\n } else if ( x === 'Array' ) {\n $ERROR(\"#1: 'Array' have attribute DontEnum\");\n } else if ( x === 'Boolean' ) {\n $ERROR(\"#1: 'Boolean' have attribute DontEnum\");\n } else if ( x === 'Date' ) {\n $ERROR(\"#1: 'Date' have attribute DontEnum\");\n } else if ( x === 'RegExp' ) {\n $ERROR(\"#1: 'RegExp' have attribute DontEnum\");\n } else if ( x === 'Error' ) {\n $ERROR(\"#1: 'Error' have attribute DontEnum\");\n } else if ( x === 'EvalError' ) {\n $ERROR(\"#1: 'EvalError' have attribute DontEnum\");\n } else if ( x === 'RangeError' ) {\n $ERROR(\"#1: 'RangeError' have attribute DontEnum\");\n } else if ( x === 'ReferenceError' ) {\n $ERROR(\"#1: 'ReferenceError' have attribute DontEnum\");\n } else if ( x === 'SyntaxError' ) {\n $ERROR(\"#1: 'SyntaxError' have attribute DontEnum\");\n } else if ( x === 'TypeError' ) {\n $ERROR(\"#1: 'TypeError' have attribute DontEnum\");\n } else if ( x === 'URIError' ) {\n $ERROR(\"#1: 'URIError' have attribute DontEnum\");\n }\n}\n",
"id": "S10.1.5_A2.1_T3"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Other Properties",
"test": "//CHECK#1\nfor (var x in this) {\n if ( x === 'Math' ) {\n $ERROR(\"#1: 'Math' have attribute DontEnum\");\n }\n}\n",
"id": "S10.1.5_A2.1_T4"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Value Properties",
"test": "function test() {\n //CHECK#1\n for (var x in this) {\n if ( x === 'NaN' ) {\n $ERROR(\"#1: 'NaN' have attribute DontEnum\");\n } else if ( x === 'Infinity' ) {\n $ERROR(\"#1: 'Infinity' have attribute DontEnum\");\n } else if ( x === 'undefined' ) {\n $ERROR(\"#1: 'undefined' have attribute DontEnum\");\n } \n }\n}\n\ntest();\n",
"id": "S10.1.5_A2.2_T1"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Function Properties",
"test": "function test() {\n //CHECK#1\n for (var x in this) {\n if ( x === 'eval' ) {\n $ERROR(\"#1: 'eval' have attribute DontEnum\");\n } else if ( x === 'parseInt' ) {\n $ERROR(\"#1: 'parseInt' have attribute DontEnum\");\n } else if ( x === 'parseFloat' ) {\n $ERROR(\"#1: 'parseFloat' have attribute DontEnum\");\n } else if ( x === 'isNaN' ) {\n $ERROR(\"#1: 'isNaN' have attribute DontEnum\");\n } else if ( x === 'isFinite' ) {\n $ERROR(\"#1: 'isFinite' have attribute DontEnum\");\n } else if ( x === 'decodeURI' ) {\n $ERROR(\"#1: 'decodeURI' have attribute DontEnum\");\n } else if ( x === 'decodeURIComponent' ) {\n $ERROR(\"#1: 'decodeURIComponent' have attribute DontEnum\");\n } else if ( x === 'encodeURI' ) {\n $ERROR(\"#1: 'encodeURI' have attribute DontEnum\");\n } else if ( x === 'encodeURIComponent' ) {\n $ERROR(\"#1: 'encodeURIComponent' have attribute DontEnum\");\n } \n }\n}\n\ntest();\n",
"id": "S10.1.5_A2.2_T2"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Constructor Properties",
"test": "function test() {\n //CHECK#1\n for (var x in this) {\n if ( x === 'Object' ) {\n $ERROR(\"#1: 'property 'Object' have attribute DontEnum\");\n } else if ( x === 'Function') {\n $ERROR(\"#1: 'Function' have attribute DontEnum\");\n } else if ( x === 'String' ) {\n $ERROR(\"#1: 'String' have attribute DontEnum\");\n } else if ( x === 'Number' ) {\n $ERROR(\"#1: 'Number' have attribute DontEnum\");\n } else if ( x === 'Array' ) {\n $ERROR(\"#1: 'Array' have attribute DontEnum\");\n } else if ( x === 'Boolean' ) {\n $ERROR(\"#1: 'Boolean' have attribute DontEnum\");\n } else if ( x === 'Date' ) {\n $ERROR(\"#1: 'Date' have attribute DontEnum\");\n } else if ( x === 'RegExp' ) {\n $ERROR(\"#1: 'RegExp' have attribute DontEnum\");\n } else if ( x === 'Error' ) {\n $ERROR(\"#1: 'Error' have attribute DontEnum\");\n } else if ( x === 'EvalError' ) {\n $ERROR(\"#1: 'EvalError' have attribute DontEnum\");\n } else if ( x === 'RangeError' ) {\n $ERROR(\"#1: 'RangeError' have attribute DontEnum\");\n } else if ( x === 'ReferenceError' ) {\n $ERROR(\"#1: 'ReferenceError' have attribute DontEnum\");\n } else if ( x === 'SyntaxError' ) {\n $ERROR(\"#1: 'SyntaxError' have attribute DontEnum\");\n } else if ( x === 'TypeError' ) {\n $ERROR(\"#1: 'TypeError' have attribute DontEnum\");\n } else if ( x === 'URIError' ) {\n $ERROR(\"#1: 'URIError' have attribute DontEnum\");\n } \n }\n}\n\ntest();\n",
"id": "S10.1.5_A2.2_T3"
},
{
"section": "10.1.5, 15.1",
"description": "Function execution context - Other Properties",
"test": "function test() {\n //CHECK#1\n for (var x in this) {\n if ( x === 'Math' ) {\n $ERROR(\"#1: 'Math' have attribute DontEnum\");\n }\n }\n}\n\ntest();\n",
"id": "S10.1.5_A2.2_T4"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Value Properties",
"test": "var evalStr = \n'//CHECK#1\\n'+\n'for (var x in this) {\\n'+\n' if ( x === \\'NaN\\' ) {\\n'+\n' $ERROR(\"#1: \\'NaN\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'Infinity\\' ) {\\n'+\n' $ERROR(\"#1: \\'Infinity\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'undefined\\' ) {\\n'+\n' $ERROR(\"#1: \\'undefined\\' have attribute DontEnum\");\\n'+\n' }\\n'+\n'}\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A2.3_T1"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Function Properties",
"test": "var evalStr = \n'//CHECK#1\\n'+\n'for (var x in this) {\\n'+\n' if ( x === \\'eval\\' ) {\\n'+\n' $ERROR(\"#1: \\'eval\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'parseInt\\' ) {\\n'+\n' $ERROR(\"#1: \\'parseInt\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'parseFloat\\' ) {\\n'+\n' $ERROR(\"#1: \\'parseFloat\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'isNaN\\' ) {\\n'+\n' $ERROR(\"#1: \\'isNaN\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'isFinite\\' ) {\\n'+\n' $ERROR(\"#1: \\'isFinite\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'decodeURI\\' ) {\\n'+\n' $ERROR(\"#1: \\'decodeURI\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'decodeURIComponent\\' ) {\\n'+\n' $ERROR(\"#1: \\'decodeURIComponent\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'encodeURI\\' ) {\\n'+\n' $ERROR(\"#1: \\'encodeURI\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'encodeURIComponent\\' ) {\\n'+\n' $ERROR(\"#1: \\'encodeURIComponent\\' have attribute DontEnum\");\\n'+\n' }\\n'+\n'}\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A2.3_T2"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Constructor Properties",
"test": "var evalStr = \n'//CHECK#1\\n'+\n'for (var x in this) {\\n'+\n' if ( x === \\'Object\\' ) {\\n'+\n' $ERROR(\"#1: \\'Object\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'Function\\') {\\n'+\n' $ERROR(\"#1: \\'Function\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'String\\' ) {\\n'+\n' $ERROR(\"#1: \\'String\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'Number\\' ) {\\n'+\n' $ERROR(\"#1: \\'Number\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'Array\\' ) {\\n'+\n' $ERROR(\"#1: \\'Array\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'Boolean\\' ) {\\n'+\n' $ERROR(\"#1: \\'Boolean\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'Date\\' ) {\\n'+\n' $ERROR(\"#1: \\'Date\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'RegExp\\' ) {\\n'+\n' $ERROR(\"#1: \\'RegExp\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'Error\\' ) {\\n'+\n' $ERROR(\"#1: \\'Error\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'EvalError\\' ) {\\n'+\n' $ERROR(\"#1: \\'EvalError\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'RangeError\\' ) {\\n'+\n' $ERROR(\"#1: \\'RangeError\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'ReferenceError\\' ) {\\n'+\n' $ERROR(\"#1: \\'ReferenceError\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'SyntaxError\\' ) {\\n'+\n' $ERROR(\"#1: \\'SyntaxError\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'TypeError\\' ) {\\n'+\n' $ERROR(\"#1: \\'TypeError\\' have attribute DontEnum\");\\n'+\n' } else if ( x === \\'URIError\\' ) {\\n'+\n' $ERROR(\"#1: \\'URIError\\' have attribute DontEnum\");\\n'+\n' }\\n'+\n'}\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A2.3_T3"
},
{
"section": "10.1.5, 15.1",
"description": "Global execution context - Other Properties",
"test": "var evalStr = \n'//CHECK#1\\n'+\n'for (var x in this) {\\n'+\n' if ( x === \\'Math\\' ) {\\n'+\n' $ERROR(\"#1: \\'Math\\' have attribute DontEnum\");\\n'+\n' }\\n'+\n'}\\n';\n\neval(evalStr);\n",
"id": "S10.1.5_A2.3_T4"
}
]
}
}

View File

@ -0,0 +1,86 @@
{
"testCollection": {
"name": "10.1.8_Arguments_Object",
"numTests": 13,
"tests": [
{
"section": "10.1.8",
"description": "Executing function which uses arguments object",
"test": "//CHECK#1\nfunction f1(){\n return arguments;\n}\n\ntry{\n var x = f1();\n}\ncatch(e){\n $ERROR(\"#1: arguments doesn't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){\n return arguments;\n}\n\ntry{\n var x = f2();\n}\ncatch(e){\n $ERROR(\"#2: arguments doesn't exists\");\n}\n",
"id": "S10.1.8_A1"
},
{
"section": "10.1.8",
"description": "Checking arguments.constructor.prototype===Object.prototype",
"test": "//CHECK#1\nfunction f1(){\n return arguments.constructor.prototype;\n}\ntry{\n if(f1() !== Object.prototype){\n $ERROR('#1: arguments.constructor.prototype === Object.prototype');\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments doesn't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){return arguments.constructor.prototype;};\ntry{\n if(f2() !== Object.prototype){\n $ERROR('#2: arguments.constructor.prototype === Object.prototype');\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments doesn't exists\");\n}\n",
"id": "S10.1.8_A2"
},
{
"section": "10.1.8",
"description": "Checking existence of arguments.callee property",
"test": "//CHECK#1\nfunction f1(){\n return arguments.hasOwnProperty(\"callee\");\n}\ntry{\n if(f1() !== true){\n $ERROR(\"#1: arguments object doesn't contains property 'callee'\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object doesn't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){return arguments.hasOwnProperty(\"callee\");};\ntry{\n if(f2() !== true){\n $ERROR(\"#2: arguments object doesn't contains property 'callee'\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object doesn't exists\");\n}\n",
"id": "S10.1.8_A3_T1"
},
{
"section": "10.1.8",
"description": "Checking if enumerating the arguments.callee property fails",
"test": "//CHECK#1\nfunction f1(){\n for(var x in arguments){\n if (x === \"callee\"){\n return false;\n }\n }\n return true;\n}\n\ntry{\n if(!f1()){\n $ERROR(\"#1: A property callee don't have attribute { DontEnum }\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object don't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){\n for(var x in arguments){\n if (x === \"callee\"){\n return false;\n }\n }\n return true;\n}\n\ntry{\n if(!f2()){\n $ERROR(\"#2: A property callee don't have attribute { DontEnum }\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object don't exists\");\n}\n",
"id": "S10.1.8_A3_T2"
},
{
"section": "10.1.8",
"description": "Checking if deleting arguments.callee property fails",
"test": "//CHECK#1\nfunction f1(){\n return (delete arguments.callee); \n}\n\ntry{\n if(!f1()){\n $ERROR(\"#1: A property callee have attribute { DontDelete }\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object don't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){\n return (delete arguments.callee); \n}\n\ntry{\n if(!f2()){\n $ERROR(\"#2: A property callee have attribute { DontDelete }\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object don't exists\");\n}\n",
"id": "S10.1.8_A3_T3"
},
{
"section": "10.1.8",
"description": "Overriding arguments.callee property",
"test": "var str = \"something different\";\n//CHECK#1\nfunction f1(){\n arguments.callee = str;\n return arguments; \n}\n\ntry{\n if(f1().callee !== str){\n $ERROR(\"#1: A property callee have attribute { ReadOnly }\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object don't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){\n arguments.callee = str;\n return arguments; \n }\ntry{\n if(f2().callee !== str){\n $ERROR(\"#2: A property callee have attribute { ReadOnly }\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object don't exists\");\n}\n",
"id": "S10.1.8_A3_T4"
},
{
"section": "10.1.8",
"description": "Checking that arguments.callee === function object",
"test": "//CHECK#1\nfunction f1(){\n return arguments.callee;\n}\n\ntry{\n if(f1 !== f1()){\n $ERROR('#1: arguments.callee === f1');\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object doesn't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){return arguments.callee;};\n\ntry{\n if(f2 !== f2()){\n $ERROR('#2: arguments.callee === f2');\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object doesn't exists\");\n}\n",
"id": "S10.1.8_A4"
},
{
"section": "10.1.8",
"description": "Checking existence of arguments.length property",
"test": "//CHECK#1\nfunction f1(){\n return arguments.hasOwnProperty(\"length\");\n}\ntry{\n if(f1() !== true){\n $ERROR(\"#1: arguments object doesn't contains property 'length'\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object doesn't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){return arguments.hasOwnProperty(\"length\");};\ntry{\n if(f2() !== true){\n $ERROR(\"#2: arguments object doesn't contains property 'length'\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object doesn't exists\");\n}\n",
"id": "S10.1.8_A5_T1"
},
{
"section": "10.1.8",
"description": "Checking if enumerating the arguments.length property fails",
"test": "//CHECK#1\nfunction f1(){\n for(var x in arguments){\n if (x === \"length\"){\n return false;\n }\n }\n return true;\n}\n\ntry{\n if(!f1()){\n $ERROR(\"#1: A property length don't have attribute { DontEnum }\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object don't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){\n for(var x in arguments){\n if (x === \"length\"){\n return false;\n }\n }\n return true;\n}\n\ntry{\n if(!f2()){\n $ERROR(\"#2: A property length don't have attribute { DontEnum }\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object don't exists\");\n}\n",
"id": "S10.1.8_A5_T2"
},
{
"section": "10.1.8",
"description": "Checking if deleting arguments.length property fails",
"test": "//CHECK#1\nfunction f1(){\n return (delete arguments.length); \n}\n\ntry{\n if(!f1()){\n $ERROR(\"#1: A property length have attribute { DontDelete }\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object don't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){\n return (delete arguments.length); \n}\n\ntry{\n if(!f2()){\n $ERROR(\"#2: A property length have attribute { DontDelete }\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object don't exists\");\n}\n",
"id": "S10.1.8_A5_T3"
},
{
"section": "10.1.8",
"description": "Overriding arguments.length property",
"test": "var str = \"something different\";\n//CHECK#1\nfunction f1(){\n arguments.length = str;\n return arguments; \n}\n\ntry{\n if(f1().length !== str){\n $ERROR(\"#1: A property length have attribute { ReadOnly }\");\n }\n}\ncatch(e){\n $ERROR(\"#1: arguments object don't exists\");\n}\n\n//CHECK#2\nvar f2 = function(){\n arguments.length = str;\n return arguments; \n }\ntry{\n if(f2().length !== str){\n $ERROR(\"#2: A property length have attribute { ReadOnly }\");\n }\n}\ncatch(e){\n $ERROR(\"#2: arguments object don't exists\");\n}\n",
"id": "S10.1.8_A5_T4"
},
{
"section": "10.1.8",
"description": "Create function, that returned arguments.length",
"test": "function f1(){\n return arguments.length;\n}\n\n//CHECK#1\nif(!(f1() === 0)){\n $ERROR('#1: argument.length === 0');\n}\n\n//CHECK#2\nif(!(f1(0) === 1)){\n $ERROR('#2: argument.length === 1');\n}\n\n//CHECK#3\nif(!(f1(0, 1) === 2)){\n $ERROR('#3: argument.length === 2');\n}\n\n//CHECK#4\nif(!(f1(0, 1, 2) === 3)){\n $ERROR('#4: argument.length === 3');\n}\n\n//CHECK#5\nif(!(f1(0, 1, 2, 3) === 4)){\n $ERROR('#5: argument.length === 4');\n}\n\nvar f2 = function(){return arguments.length;};\n\n//CHECK#6\nif(!(f2() === 0)){\n $ERROR('#6: argument.length === 0');\n}\n\n//CHECK#7\nif(!(f2(0) === 1)){\n $ERROR('#7: argument.length === 1');\n}\n\n//CHECK#8\nif(!(f2(0, 1) === 2)){\n $ERROR('#8: argument.length === 2');\n}\n\n//CHECK#9\nif(!(f2(0, 1, 2) === 3)){\n $ERROR('#9: argument.length === 3');\n}\n\n//CHECK#10\nif(!(f2(0, 1, 2, 3) === 4)){\n $ERROR('#10: argument.length === 4');\n}\n",
"id": "S10.1.8_A6"
},
{
"section": "10.1.8",
"description": "Use property arguments",
"test": "function f1() {\n return arguments;\n}\n \n//CHECK#1-5\nfor(var i = 1; i < 5; i++){ \nif (f1(1,2,3,4,5)[i] !== (i+1))\n $ERROR(\"#\"+i+\": Returning function's arguments work wrong, f1(1,2,3,4,5)[\"+i+\"] !== \"+(i+1));\n}\n",
"id": "S10.1.8_A7"
}
]
}
}

View File

@ -0,0 +1,56 @@
{
"testCollection": {
"name": "10.1_Definitions",
"numTests": 8,
"tests": [
{
"section": "10.1.1",
"description": "Defining function by a FunctionDeclaration",
"test": "//CHECK#1\nfunction f1(){\n return 1;\n}\nif(typeof(f1)!==\"function\")\n $ERROR('#1: typeof(f1)!==\"function\"');\n",
"id": "S10.1.1_A1_T1"
},
{
"section": "10.1.1",
"description": "Creating function dynamically by using a FunctionExpression",
"test": "//CHECK#1\nvar x=function f1(){return 1;}();\nif(x!==1)\n $ERROR('#1: Create function dynamically either by using a FunctionExpression');\n\n//CHECK#2\nvar y=function (){return 2;}();\nif(y!==2){\n $ERROR('#2: Create an anonymous function dynamically either by using a FunctionExpression');\n}\n\n//CHECK#2\nvar z = (function(){return 3;})();\nif(z!==3){\n $ERROR('#3: Create an anonymous function dynamically either by using a FunctionExpression wrapped in a group operator');\n}\n",
"id": "S10.1.1_A1_T2"
},
{
"section": "10.1.1",
"description": "Creating function dynamically by using the built-in Function object as a constructor",
"test": "//CHECK#1\nvar x=new function f1(){return 1;};\nif(typeof(x.constructor)!==\"function\")\n $ERROR('#1: typeof(x.constructor)!==\"function\"');\n",
"id": "S10.1.1_A1_T3"
},
{
"section": "10.1.1",
"description": "Checking types of parseInt and Math.exp",
"test": "//CHECK#1\nif(typeof(Math.exp)!==\"function\")\n $ERROR('#1: typeof(Math.exp(10))!==\"function\" '+typeof(Math.exp()));\n\n//CHECK#2\nif(typeof(parseInt)!==\"function\")\n $ERROR('#2: typeof(parseInt())!==\"function\" '+typeof(parseInt()));\n \n",
"id": "S10.1.1_A2_T1"
},
{
"section": "10.1.6",
"description": "Checking ifdeleting function parameter is possible",
"test": "//CHECK#1\nfunction f1(a){\n delete a;\n return a;\n}\nif (f1(1) !== 1)\n $ERROR('#1: Function parameter was deleted');\n \n",
"id": "S10.1.6_A1_T1"
},
{
"section": "10.1.6",
"description": "Checking funtion which returns property \"arguments\"",
"test": "var ARG_STRING = \"value of the argument property\";\n\nfunction f1() {\n this.constructor.prototype.arguments = ARG_STRING;\n return arguments;\n}\n \n//CHECK#1\nif ((new f1(1,2,3,4,5)).length !== 5)\n $ERROR('#1: (new f1(1,2,3,4,5)).length===5, where f1 returns \"arguments\" that is set to \"'+ ARG_STRING + '\"');\n\n//CHECK#2 \nif ((new f1(1,2,3,4,5))[3] !== 4)\n $ERROR('#2: (new f1(1,2,3,4,5))[3]===4, where f1 returns \"arguments\" that is set to \"'+ ARG_STRING + '\"');\n\n//CHECK#3\nvar x = new f1(1,2,3,4,5); \nif (delete x[3] !== true)\n $ERROR('#3.1: Function parameters have attribute {DontDelete}');\n \nif (x[3] === 4)\n $ERROR('#3.2: Function parameters have attribute {DontDelete}');\n",
"id": "S10.1.6_A1_T2"
},
{
"section": "10.1.6",
"description": "Checking function which returns \"this\"",
"test": "function f1() {\n if (delete arguments) {\n $ERROR(\"#1: Function parameters have attribute {DontDelete}\" + arguments);\n }\n return arguments;\n}\n\nf1();\n",
"id": "S10.1.6_A1_T3"
},
{
"section": "10.1.7",
"description": "Checking if deleting \"this\" fails",
"test": "//CHECK#1\nif (delete this !== true)\n $ERROR('#1: The this value associated with an executioncontext is immutable. Actual: this was deleted');\n \n",
"id": "S10.1.7_A1_T1"
}
]
}
}

View File

@ -0,0 +1,38 @@
{
"testCollection": {
"name": "10.2.1.1.3",
"numTests": 4,
"tests": [
{
"id": "10.2.1.1.3-4-16-s",
"path": "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js",
"description": "Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (NaN)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n NaN = 12;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.2.1.1.3-4-18-s",
"path": "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js",
"description": "Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (undefined)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n undefined = 12;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.2.1.1.3-4-22-s",
"path": "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js",
"description": "Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Object)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var objBak = Object;\n\n try {\n Object = 12;\n return true;\n } finally {\n Object = objBak;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.2.1.1.3-4-27-s",
"path": "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js",
"description": "Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Number)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n var numBak = Number;\n try {\n Number = 12;\n return true;\n } finally {\n Number = numBak;\n }\n }).call(this));\n",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,20 @@
{
"testCollection": {
"name": "10.2.1_Global_Code",
"numTests": 2,
"tests": [
{
"section": "10.2.1",
"description": "Checking if deleting variable x, that is defined as var x = 1, fails",
"test": "var x = 1;\n\nif (this.x !== 1) {\n $ERROR(\"#1: variable x is a property of global object\");\n}\n\nif(delete this.x !== false){\n $ERROR(\"#2: variable x has property attribute DontDelete\");\n}\n",
"id": "S10.2.1_A1_T1"
},
{
"section": "10.2.1",
"description": "Checking if deleting variable x, that is defined as x = 1, fails",
"test": "x = 1;\n\nif (this.x !== 1) {\n $ERROR(\"#1: variable x is a property of global object\");\n}\n\nif(delete this.x !== true){\n $ERROR(\"#2: variable x has property attribute DontDelete\");\n}\n",
"id": "S10.2.1_A1_T2"
}
]
}
}

View File

@ -0,0 +1,140 @@
{
"testCollection": {
"name": "10.2.2_Eval_Code",
"numTests": 22,
"tests": [
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nx = 1;\ny = 2;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.1_T1"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nvar x = 1;\nvar y = 2;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.1_T10"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\nthis.x = 1;\nthis.y = 2;\n",
"id": "S10.2.2_A1.1_T11"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\nvar x = 1;\nvar y = 2;\n",
"id": "S10.2.2_A1.1_T2"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nthis.x = 1;\nthis.y = 2;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.1_T3"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nx = 1;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\ny = 2;\n",
"id": "S10.2.2_A1.1_T4"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nvar x = 1;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\nvar y = 2;\n",
"id": "S10.2.2_A1.1_T5"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nthis.x = 1;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\nthis.y = 2;\n",
"id": "S10.2.2_A1.1_T6"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nx = 1;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\nvar y = 2;\n",
"id": "S10.2.2_A1.1_T7"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\nthis.x = 1;\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\nvar y = 2;\n",
"id": "S10.2.2_A1.1_T8"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "var i;\nvar j;\nstr1 = '';\nstr2 = '';\n\nfor(i in this){\n str1+=i;\n}\n\neval('for(j in this){\\nstr2+=j;\\n}');\n\nif(!(str1 === str2)){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\nx = 1;\ny = 2;\n",
"id": "S10.2.2_A1.1_T9"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n x = 1;\n y = 2;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n return (str1 === str2); \n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.2_T1"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n var x = 1;\n var y = 2;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2); \n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.2_T10"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2); \n\n this.x = 1;\n this.y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.2_T11"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2);\n var x = 1;\n var y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.2_T2"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n this.x = 1;\n this.y = 2;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2); \n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.2_T3"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n x = 1;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2); \n\n y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n",
"id": "S10.2.2_A1.2_T4"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n var x = 1;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2);\n \n var y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\n",
"id": "S10.2.2_A1.2_T5"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n this.x = 1;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2);\n \n this.y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\n",
"id": "S10.2.2_A1.2_T6"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n x = 1;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2);\n \n var y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\n\n",
"id": "S10.2.2_A1.2_T7"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n this.x = 1;\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2);\n \n var y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\n",
"id": "S10.2.2_A1.2_T8"
},
{
"section": "10.2.2",
"description": "eval within global execution context",
"test": "function f(){\n var i;\n var j;\n str1 = '';\n str2 = '';\n \n for(i in this){\n str1+=i;\n }\n \n eval('for(j in this){\\nstr2+=j;\\n}');\n\n return (str1 === str2);\n \n x = 1;\n y = 2;\n}\n\nif(!f()){\n $ERROR(\"#1: scope chain must contain same objects in the same order as the calling context\");\n}\n\n",
"id": "S10.2.2_A1.2_T9"
}
]
}
}

View File

@ -0,0 +1,20 @@
{
"testCollection": {
"name": "10.2_Entering_An_Execution_Context",
"numTests": 2,
"tests": [
{
"section": "10.2",
"description": "Sequence of function calls",
"test": "var y;\n\nfunction f(){\n var x;\n \n if(x === undefined) {\n x = 0;\n } else {\n x = 1;\n }\n \n return x;\n}\n\ny = f();\ny = f();\n\nif(!(y === 0)){\n $ERROR(\"#1: Sequenced function calls shares execution context\");\n}\n",
"id": "S10.2_A1.1_T1"
},
{
"section": "10.2",
"description": "Recursive function call",
"test": "var y;\n\nfunction f(a){\n var x;\n \n if (a === 1) \n return x;\n else {\n if(x === undefined) {\n x = 0;\n } else {\n x = 1;\n }\n return f(1);\n }\n}\n\ny = f(0);\n\nif(!(y === undefined)){\n $ERROR(\"#1: Recursive function calls shares execution context\");\n}\n",
"id": "S10.2_A1.1_T2"
}
]
}
}

View File

@ -0,0 +1,83 @@
{
"testCollection": {
"name": "10.4.2",
"numTests": 11,
"tests": [
{
"id": "10.4.2-1-1",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-1-1.js",
"description": "Indirect call to eval has context set to global context",
"test": "var __10_4_2_1_1_1 = \"str\";assertTrue((function testcase() {\n try {\n\n var _eval = eval;\n var __10_4_2_1_1_1 = \"str1\";\n if(_eval(\"\\'str\\' === __10_4_2_1_1_1\") === true && // indirect eval\n eval(\"\\'str1\\' === __10_4_2_1_1_1\") === true) { // direct eval\n return true;\n }\n return false;\n } finally {\n delete this.__10_4_2_1_1_1;\n }\n}).call(this));\n"
},
{
"id": "10.4.2-1-2",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-1-2.js",
"description": "Indirect call to eval has context set to global context (nested function)",
"test": "var __10_4_2_1_2 = \"str\";assertTrue((function testcase() {\n try {\n\n var _eval = eval;\n var __10_4_2_1_2 = \"str1\";\n function foo() {\n var __10_4_2_1_2 = \"str2\";\n if(_eval(\"\\'str\\' === __10_4_2_1_2\") === true && // indirect eval\n eval(\"\\'str2\\' === __10_4_2_1_2\") === true) { // direct eval\n return true;\n } else {\n return false;\n }\n }\n return foo();\n } finally {\n delete this.__10_4_2_1_1_2;\n }\n }).call(this));\n"
},
{
"id": "10.4.2-1-3",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-1-3.js",
"description": "Indirect call to eval has context set to global context (catch block)",
"test": "var __10_4_2_1_3 = \"str\";assertTrue((function testcase() {\n\n try {\n\n var _eval = eval;\n var __10_4_2_1_3 = \"str1\";\n try {\n throw \"error\";\n }\n catch (e) {\n var __10_4_2_1_3 = \"str2\";\n if (_eval(\"\\'str\\' === __10_4_2_1_3\") === true && // indirect eval\n eval(\"\\'str2\\' === __10_4_2_1_3\") === true) { // direct eval\n return true;\n } else {\n return false;\n }\n }\n } finally {\n delete this.__10_4_2_1_3;\n }\n }).call(this));\n"
},
{
"id": "10.4.2-1-4",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-1-4.js",
"description": "Indirect call to eval has context set to global context (with block)",
"test": "var __10_4_2_1_4 = \"str\";assertTrue((function testcase() {\n try {\n var o = new Object();\n o.__10_4_2_1_4 = \"str2\";\n var _eval = eval;\n var __10_4_2_1_4 = \"str1\";\n with (o) {\n if (_eval(\"\\'str\\' === __10_4_2_1_4\") === true && // indirect eval\n eval(\"\\'str2\\' === __10_4_2_1_4\") === true) { // direct eval\n return true;\n }\n }\n return false;\n } finally {\n delete this.__10_4_2_1_4;\n }\n }).call(this));\n"
},
{
"id": "10.4.2-1-5",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-1-5.js",
"description": "Indirect call to eval has context set to global context (inside another eval)",
"test": "var __10_4_2_1_5 = \"str\";assertTrue((function testcase() {\n try {\n\n var __10_4_2_1_5 = \"str1\";\n var r = eval(\"\\\n var _eval = eval; \\\n var __10_4_2_1_5 = \\'str2\\'; \\\n _eval(\\\"\\'str\\' === __10_4_2_1_5 \\\") && \\\n eval(\\\"\\'str2\\' === __10_4_2_1_5\\\")\\\n \");\n return r;\n } finally {\n delete this.__10_4_2_1_5;\n }\n }).call(this));\n"
},
{
"id": "10.4.2-2-c-1",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-2-c-1.js",
"description": "Direct val code in non-strict mode - can instantiate variable in calling context",
"test": "assertTrue((function testcase() {\n var x = 0;\n return function inner() {\n eval(\"var x = 1\");\n if (x === 1)\n return true;\n } ();\n }).call(this));\n"
},
{
"id": "10.4.2-2-s",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-2-s.js",
"description": "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval",
"test": "assertTrue((function testcase() {\n \"use strict\";\n eval(\"(function fun(x){ return x })(10)\");\n return typeof (fun) === \"undefined\";\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.4.2-3-c-1-s",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js",
"description": "Direct eval code in strict mode - cannot instantiate variable in the variable environment of the calling context",
"test": "assertTrue((function testcase() {\n var _10_4_2_3_c_1_s = 0;\n function _10_4_2_3_c_1_sFunc() {\n eval(\"'use strict';var _10_4_2_3_c_1_s = 1\");\n return _10_4_2_3_c_1_s===0;\n } \n return _10_4_2_3_c_1_sFunc();\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.4.2-3-c-2-s",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js",
"description": "Calling code in strict mode - eval cannot instantiate variable in the variable environment of the calling context",
"test": "assertTrue((function testcase() {\n var _10_4_2_3_c_2_s = 0;\n function _10_4_2_3_c_2_sFunc() {\n 'use strict';\n eval(\"var _10_4_2_3_c_2_s = 1\");\n return _10_4_2_3_c_2_s===0;\n }\n return _10_4_2_3_c_2_sFunc();\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.4.2.1-2-s",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2.1-2-s.js",
"description": "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n eval(\"function _10_4_2_1_2_fun(){}\");\n return typeof _10_4_2_1_2_fun === \"undefined\";\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.4.2.1-4-s",
"path": "TestCases/chapter10/10.4/10.4.2/10.4.2.1-4-s.js",
"description": "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval which is contained in strict mode code",
"test": "assertTrue((function testcase() {\n\n eval(\"'use strict'; function _10_4_2_1_4_fun(){}\");\n return typeof _10_4_2_1_4_fun === \"undefined\";\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,47 @@
{
"testCollection": {
"name": "10.4.3",
"numTests": 5,
"tests": [
{
"id": "10.4.3-1-1-s",
"path": "TestCases/chapter10/10.4/10.4.3/10.4.3-1-1-s.js",
"description": "this is not coerced to an object in strict mode (Number)",
"test": "assertTrue((function testcase() {\n\n function foo()\n {\n 'use strict';\n return typeof(this);\n } \n\n function bar()\n {\n return typeof(this);\n }\n\n\n return foo.call(1) === 'number' && bar.call(1) === 'object';\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.4.3-1-2-s",
"path": "TestCases/chapter10/10.4/10.4.3/10.4.3-1-2-s.js",
"description": "this is not coerced to an object in strict mode (string)",
"test": "assertTrue((function testcase() {\n\n function foo()\n {\n 'use strict';\n return typeof(this);\n } \n\n function bar()\n {\n return typeof(this);\n }\n\n\n return foo.call('1') === 'string' && bar.call('1') === 'object';\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.4.3-1-3-s",
"path": "TestCases/chapter10/10.4/10.4.3/10.4.3-1-3-s.js",
"description": "this is not coerced to an object in strict mode (undefined)",
"test": "assertTrue((function testcase() {\n\n function foo()\n {\n 'use strict';\n return typeof(this);\n } \n\n function bar()\n {\n return typeof(this);\n }\n return foo.call(undefined) === 'undefined' && bar.call() === 'object';\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.4.3-1-4-s",
"path": "TestCases/chapter10/10.4/10.4.3/10.4.3-1-4-s.js",
"description": "this is not coerced to an object in strict mode (boolean)",
"test": "assertTrue((function testcase() {\n\n function foo()\n {\n 'use strict';\n return typeof(this);\n } \n\n function bar()\n {\n return typeof(this);\n }\n\n\n return foo.call(true) === 'boolean' && bar.call(true) === 'object';\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.4.3-1-5-s",
"path": "TestCases/chapter10/10.4/10.4.3/10.4.3-1-5-s.js",
"description": "this is not coerced to an object in strict mode (function)",
"test": "assertTrue((function testcase() {\n\n function foo()\n {\n 'use strict';\n return typeof(this);\n } \n\n function bar()\n {\n return typeof(this);\n }\n\n function foobar()\n {\n }\n\n return foo.call(foobar) === 'function' && bar.call(foobar) === 'function';\n }).call(this));\n",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,46 @@
{
"testCollection": {
"name": "10.5",
"numTests": 5,
"tests": [
{
"id": "10.5-1-s",
"path": "TestCases/chapter10/10.5/10.5-1-s.js",
"description": "Strict Mode - arguments object is immutable",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n (function fun() {\n eval(\"arguments = 10\");\n })(30);\n return false;\n } catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.5-7-b-1-s",
"path": "TestCases/chapter10/10.5/10.5-7-b-1-s.js",
"description": "Strict Mode - arguments object is immutable in eval'ed functions",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"(function _10_5_7_b_1_fun() { arguments = 10;} ());\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.5-7-b-2-s",
"path": "TestCases/chapter10/10.5/10.5-7-b-2-s.js",
"description": "Strict Mode - arguments object index assignment is disallowed",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n function _10_5_7_b_2_fun() {\n arguments[7] = 12;\n return arguments[7] === 12;\n };\n\n return _10_5_7_b_2_fun(30);\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.5-7-b-3-s",
"path": "TestCases/chapter10/10.5/10.5-7-b-3-s.js",
"description": "Strict Mode - Adding property to the arguments object successful under strict mode ",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n function _10_5_7_b_3_fun() {\n arguments[1] = 12;\n return arguments[0] = 30 && arguments[1] === 12;\n };\n\n return _10_5_7_b_3_fun(30);\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.5-7-b-4-s",
"path": "TestCases/chapter10/10.5/10.5-7-b-4-s.js",
"description": "Strict Mode - Deleting property of the arguments object successful under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n function _10_5_7_b_4_fun() {\n var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12;\n delete arguments[1];\n var _10_5_7_b_4_2 = arguments[0] === 30 && typeof arguments[1] === \"undefined\";\n return _10_5_7_b_4_1 && _10_5_7_b_4_2;\n };\n return _10_5_7_b_4_fun(30, 12);\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,195 @@
{
"testCollection": {
"name": "10.6",
"numTests": 26,
"tests": [
{
"id": "10.6-10-c-ii-1-s",
"path": "TestCases/chapter10/10.6/10.6-10-c-ii-1-s.js",
"description": "arguments[i] remains same after changing actual parameters in strict mode",
"test": "assertTrue((function testcase() {\n function foo(a,b,c)\n {\n 'use strict';\n a = 1; b = 'str'; c = 2.1;\n return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1);\n }\n return foo(10, 'sss', 1);\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-10-c-ii-1",
"path": "TestCases/chapter10/10.6/10.6-10-c-ii-1.js",
"description": "arguments[i] change with actual parameters",
"test": "assertTrue((function testcase() {\n function foo(a,b,c)\n {\n a = 1; b = 'str'; c = 2.1;\n if(arguments[0] === 1 && arguments[1] === 'str' && arguments[2] === 2.1)\n return true; \n }\n return foo(10,'sss',1);\n }).call(this));\n"
},
{
"id": "10.6-10-c-ii-2-s",
"path": "TestCases/chapter10/10.6/10.6-10-c-ii-2-s.js",
"description": "arguments[i] doesn't map to actual parameters in strict mode",
"test": "assertTrue((function testcase() {\n \n function foo(a,b,c)\n {\n 'use strict'; \n arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;\n return 10 === a && 'sss' === b && 1 === c;\n }\n return foo(10,'sss',1);\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-10-c-ii-2",
"path": "TestCases/chapter10/10.6/10.6-10-c-ii-2.js",
"description": "arguments[i] map to actual parameter",
"test": "assertTrue((function testcase() {\n \n function foo(a,b,c)\n {\n arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;\n if(1 === a && 'str' === b && 2.1 === c)\n return true; \n }\n return foo(10,'sss',1);\n }).call(this));\n"
},
{
"id": "10.6-11-b-1",
"path": "TestCases/chapter10/10.6/10.6-11-b-1.js",
"description": "Arguments Object has index property '0' as its own property, it shoulde be writable, enumerable, configurable and does not invoke the setter defined on Object.prototype[0] (Step 11.b)",
"test": "assertTrue((function testcase() {\n try {\n var data = \"data\";\n var getFunc = function () {\n return data;\n };\n\n var setFunc = function (value) {\n data = value;\n };\n\n Object.defineProperty(Object.prototype, \"0\", {\n get: getFunc,\n set: setFunc,\n configurable: true\n });\n\n var argObj = (function () { return arguments })(1);\n\n var verifyValue = false;\n verifyValue = (argObj[0] === 1);\n\n var verifyEnumerable = false;\n for (var p in argObj) {\n if (p === \"0\" && argObj.hasOwnProperty(\"0\")) {\n verifyEnumerable = true;\n }\n }\n\n var verifyWritable = false;\n argObj[0] = 1001;\n verifyWritable = (argObj[0] === 1001);\n\n var verifyConfigurable = false;\n delete argObj[0];\n verifyConfigurable = argObj.hasOwnProperty(\"0\");\n\n return verifyValue && verifyWritable && verifyEnumerable && !verifyConfigurable && data === \"data\";\n } finally {\n delete Object.prototype[0];\n }\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
},
{
"id": "10.6-12-1",
"path": "TestCases/chapter10/10.6/10.6-12-1.js",
"description": "Accessing callee property of Arguments object is allowed",
"test": "assertTrue((function testcase() {\n try \n {\n arguments.callee;\n return true;\n }\n catch (e) {\n }\n }).call(this));\n"
},
{
"id": "10.6-12-2",
"path": "TestCases/chapter10/10.6/10.6-12-2.js",
"description": "arguments.callee has correct attributes",
"test": "assertTrue((function testcase() {\n \n var desc = Object.getOwnPropertyDescriptor(arguments,\"callee\");\n if(desc.configurable === true &&\n desc.enumerable === false &&\n desc.writable === true &&\n desc.hasOwnProperty('get') == false &&\n desc.hasOwnProperty('put') == false)\n return true; \n }).call(this));\n",
"precondition": "(fnExists(Object.getOwnPropertyDescriptor))"
},
{
"id": "10.6-13-1",
"path": "TestCases/chapter10/10.6/10.6-13-1.js",
"description": "Accessing caller property of Arguments object is allowed",
"test": "assertTrue((function testcase() {\n try \n {\n arguments.caller;\n return true;\n }\n catch (e) {\n }\n }).call(this));\n"
},
{
"id": "10.6-13-a-1",
"path": "TestCases/chapter10/10.6/10.6-13-a-1.js",
"description": "In non-strict mode, arguments object should have its own 'callee' property defined (Step 13.a)",
"test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Object.prototype, \"callee\", {\n value: 1,\n writable: false,\n configurable: true\n });\n\n var argObj = (function () { return arguments })();\n\n var verifyValue = false;\n verifyValue = typeof argObj.callee === \"function\";\n \n var verifyWritable = false;\n argObj.callee = 1001;\n verifyWritable = (argObj.callee === 1001);\n\n var verifyEnumerable = false;\n for (var p in argObj) {\n if (p === \"callee\" && argObj.hasOwnProperty(\"callee\")) {\n verifyEnumerable = true;\n }\n }\n\n var verifyConfigurable = false;\n delete argObj.callee;\n verifyConfigurable = argObj.hasOwnProperty(\"callee\");\n\n return verifyValue && verifyWritable && !verifyEnumerable && !verifyConfigurable;\n } finally {\n delete Object.prototype.callee;\n }\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
},
{
"id": "10.6-13-b-1-s",
"path": "TestCases/chapter10/10.6/10.6-13-b-1-s.js",
"description": "Accessing caller property of Arguments object throws TypeError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n try \n {\n arguments.caller;\n }\n catch (e) {\n if(e instanceof TypeError)\n return true;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-13-b-2-s",
"path": "TestCases/chapter10/10.6/10.6-13-b-2-s.js",
"description": "arguments.caller exists in strict mode",
"test": "assertTrue((function testcase() {\n \n 'use strict'; \n var desc = Object.getOwnPropertyDescriptor(arguments,\"caller\");\n return desc!== undefined;\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-13-b-3-s",
"path": "TestCases/chapter10/10.6/10.6-13-b-3-s.js",
"description": "arguments.caller is non-configurable in strict mode",
"test": "assertTrue((function testcase() {\n \n 'use strict'; \n var desc = Object.getOwnPropertyDescriptor(arguments,\"caller\");\n \n return (desc.configurable === false && \n desc.enumerable === false && \n desc.hasOwnProperty('value') == false && \n desc.hasOwnProperty('writable') == false &&\n desc.hasOwnProperty('get') == true && \n desc.hasOwnProperty('set') == true); \n \n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-13-c-1-s",
"path": "TestCases/chapter10/10.6/10.6-13-c-1-s.js",
"description": "Accessing callee property of Arguments object throws TypeError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n try \n {\n arguments.callee;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-13-c-2-s",
"path": "TestCases/chapter10/10.6/10.6-13-c-2-s.js",
"description": "arguments.callee is exists in strict mode",
"test": "assertTrue((function testcase() {\n \n 'use strict'; \n var desc = Object.getOwnPropertyDescriptor(arguments,\"callee\");\n return desc !== undefined;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.6-13-c-3-s",
"path": "TestCases/chapter10/10.6/10.6-13-c-3-s.js",
"description": "arguments.callee is non-configurable in strict mode",
"test": "assertTrue((function testcase() {\n \n 'use strict'; \n var desc = Object.getOwnPropertyDescriptor(arguments,\"callee\");\n return (desc.configurable === false &&\n desc.enumerable === false &&\n desc.hasOwnProperty('value') == false &&\n desc.hasOwnProperty('writable') == false &&\n desc.hasOwnProperty('get') == true &&\n desc.hasOwnProperty('set') == true);\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-14-1-s",
"path": "TestCases/chapter10/10.6/10.6-14-1-s.js",
"description": "Strict Mode - 'callee' exists and 'caller' exists under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var argObj = function () {\n return arguments;\n } ();\n return argObj.hasOwnProperty(\"callee\") && argObj.hasOwnProperty(\"caller\");\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-14-b-1-s",
"path": "TestCases/chapter10/10.6/10.6-14-b-1-s.js",
"description": "Strict Mode - [[Enumerable]] attribute value in 'caller' is false under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n var argObj = function () {\n return arguments;\n } ();\n\n var verifyEnumerable = false;\n for (var _10_6_14_b_1 in argObj) {\n if (argObj.hasOwnProperty(_10_6_14_b_1) && _10_6_14_b_1 === \"caller\") {\n verifyEnumerable = true;\n }\n }\n return !verifyEnumerable && argObj.hasOwnProperty(\"caller\");\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-14-b-4-s",
"path": "TestCases/chapter10/10.6/10.6-14-b-4-s.js",
"description": "Strict Mode - TypeError is thrown when accessing the [[Set]] attribute in 'caller' under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n var argObj = function () {\n return arguments;\n } ();\n\n try {\n argObj.caller = {};\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-14-c-1-s",
"path": "TestCases/chapter10/10.6/10.6-14-c-1-s.js",
"description": "Strict Mode - [[Enumerable]] attribute value in 'callee' is false under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n var argObj = function () {\n return arguments;\n } ();\n\n var verifyEnumerable = false;\n for (var _10_6_14_c_1 in argObj) {\n if (argObj.hasOwnProperty(_10_6_14_c_1) && _10_6_14_c_1 === \"callee\") {\n verifyEnumerable = true;\n }\n }\n return !verifyEnumerable && argObj.hasOwnProperty(\"callee\");\n }).call(this));\n",
"strict_only": ""
},
{
"id": "10.6-14-c-4-s",
"path": "TestCases/chapter10/10.6/10.6-14-c-4-s.js",
"description": "Strict Mode - TypeError is thrown when accessing the [[Set]] attribute in 'callee' under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n var argObj = function () {\n return arguments;\n } ();\n\n try {\n argObj.callee = {};\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "10.6-5-1",
"path": "TestCases/chapter10/10.6/10.6-5-1.js",
"description": "[[Prototype]] property of Arguments is set to Object prototype object",
"test": "assertTrue((function testcase() {\n if(Object.getPrototypeOf(arguments) === Object.getPrototypeOf({}))\n return true;\n }).call(this));\n",
"precondition": "(fnExists(Object.getPrototypeOf))"
},
{
"id": "10.6-6-1",
"path": "TestCases/chapter10/10.6/10.6-6-1.js",
"description": "'length property of arguments object exists",
"test": "assertTrue((function testcase() {\n \n var desc = Object.getOwnPropertyDescriptor(arguments,\"length\");\n return desc !== undefined\n }).call(this));\n",
"precondition": "(fnExists(Object.getOwnPropertyDescriptor))"
},
{
"id": "10.6-6-2",
"path": "TestCases/chapter10/10.6/10.6-6-2.js",
"description": "'length' property of arguments object has correct attributes",
"test": "assertTrue((function testcase() {\n \n var desc = Object.getOwnPropertyDescriptor(arguments,\"length\");\n if(desc.configurable === true &&\n desc.enumerable === false &&\n desc.writable === true )\n return true;\n }).call(this));\n",
"precondition": "(fnExists(Object.getOwnPropertyDescriptor))"
},
{
"id": "10.6-6-3",
"path": "TestCases/chapter10/10.6/10.6-6-3.js",
"description": "'length' property of arguments object for 0 argument function exists",
"test": "assertTrue((function testcase() {\n var arguments= undefined;\n\treturn (function () {return arguments.length !== undefined})();\n }).call(this));\n"
},
{
"id": "10.6-6-4",
"path": "TestCases/chapter10/10.6/10.6-6-4.js",
"description": "'length' property of arguments object for 0 argument function call is 0 even with formal parameters",
"test": "assertTrue((function testcase() {\n var arguments= undefined;\n\treturn (function (a,b,c) {return arguments.length === 0})();\n }).call(this));\n"
},
{
"id": "10.6-7-1",
"path": "TestCases/chapter10/10.6/10.6-7-1.js",
"description": "Arguments Object has length as its own property and does not invoke the setter defined on Object.prototype.length (Step 7)",
"test": "assertTrue((function testcase() {\n try {\n var data = \"data\";\n var getFunc = function () {\n return 12;\n };\n\n var setFunc = function (value) {\n data = value;\n };\n\n Object.defineProperty(Object.prototype, \"length\", {\n get: getFunc,\n set: setFunc,\n configurable: true\n });\n\n var verifyValue = false;\n var argObj = (function () { return arguments })();\n verifyValue = (argObj.length === 0);\n\n var verifyWritable = false;\n argObj.length = 1001;\n verifyWritable = (argObj.length === 1001);\n\n var verifyEnumerable = false;\n for (var p in argObj) {\n if (p === \"length\") {\n verifyEnumerable = true;\n }\n }\n\n var verifyConfigurable = false;\n delete argObj.length;\n verifyConfigurable = argObj.hasOwnProperty(\"length\");\n\n return verifyValue && verifyWritable && !verifyEnumerable && !verifyConfigurable && data === \"data\";\n } finally {\n delete Object.prototype.length;\n }\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
}
]
}
}

View File

@ -0,0 +1,45 @@
{
"testCollection": {
"name": "11.1.1_The_this_Keyword",
"numTests": 6,
"tests": [
{
"section": "11.1.1",
"description": "Checking if execution of \"this=1\" fails",
"negative": "",
"test": "this = 1;\n",
"id": "S11.1.1_A1"
},
{
"section": "11.1.1",
"description": "Checking if execution of \"this\" and eval(\"this\"), which are in global code, return the global object by using toString function",
"test": "//CHECK#1\nif (this.toString() !== toString()) {\n $ERROR('#1: this.toString() === toString(). Actual: ' + (this.toString())); \n}\n\n//CHECK#2\nif (eval(\"this\").toString() !== toString()) {\n $ERROR('#2: eval(\"this\").toString() === toString(). Actual: ' + (this.toString())); \n}\n",
"id": "S11.1.1_A2"
},
{
"section": "11.1.1",
"description": "Creating function which returns \"this\" or eval(\"this\")",
"test": "//CHECK#1\nfunction MyFunction() {return this}\nif (MyFunction() !== this) {\n $ERROR('#1: function MyFunction() {return this} MyFunction() === this. Actual: ' + (MyFunction())); \n}\n\n//CHECK#2\nfunction MyFunction() {return eval(\"this\")}\nif (MyFunction() !== this) {\n $ERROR('#2: function MyFunction() {return eval(\"this\")} MyFunction() === this. Actual: ' + (MyFunction())); \n}\n\n\n",
"id": "S11.1.1_A3.1"
},
{
"section": "11.1.1",
"description": "Create function. It have property, that returned \"this\"",
"test": "//CHECK#1\nfunction MyFunction() {this.THIS = this}\nif ((new MyFunction()).THIS.toString() !== \"[object Object]\") {\n $ERROR('#1: function MyFunction() {this.THIS = this} (new MyFunction()).THIS.toString() !== \"[object Object]\". Actual: ' + ((new MyFunction()).THIS.toString())); \n}\n\n//CHECK#2\nfunction MyFunction() {this.THIS = eval(\"this\")}\nif ((new MyFunction()).THIS.toString() !== \"[object Object]\") {\n $ERROR('#2: function MyFunction() {this.THIS = eval(\"this\")} (new MyFunction()).THIS.toString() !== \"[object Object]\". Actual: ' + ((new MyFunction()).THIS.toString())); \n}\n\n",
"id": "S11.1.1_A3.2"
},
{
"section": "11.1.1",
"description": "Creating function with new Function() constructor",
"test": "//CHECK#1\nvar MyFunction = new Function(\"return this\");\nif (MyFunction() !== this) {\n $ERROR('#1: var MyFunction = new Function(\"return this\"); MyFunction() === this. Actual: ' + (MyFunction())); \n}\n\n//CHECK#2\nvar MyFunction = new Function(\"return eval(\\'this\\')\");\nif (MyFunction() !== this) {\n $ERROR('#2: var MyFunction = new Function(\"return eval(\\'this\\')\"); MyFunction() === this. Actual: ' + (MyFunction())); \n}\n\n\n",
"id": "S11.1.1_A4.1"
},
{
"section": "11.1.1",
"description": "Creating function by using new Function() constructor. It has the property, which returns \"this\"",
"test": "//CHECK#1\nvar MyFunction = new Function(\"this.THIS = this\");\nvar MyObject = new MyFunction();\nif (MyObject.THIS.toString() !== \"[object Object]\") {\n $ERROR('#1: var MyFunction = new Function(\"this.THIS = this\"); var MyObject = new MyFunction(); MyObject.THIS.toString() === \"[object Object]\". Actual: ' + (MyObject.THIS.toString())); \n}\n\n//CHECK#2\nvar MyFunction = new Function(\"this.THIS = eval(\\'this\\')\");\nvar MyObject = new MyFunction();\nif (MyObject.THIS.toString() !== \"[object Object]\") {\n $ERROR('#2: var MyFunction = new Function(\"this.THIS = eval(\\'this\\')\"); var MyObject = new MyFunction(); MyObject.THIS.toString() === \"[object Object]\". Actual: ' + (MyObject.THIS.toString())); \n}\n\n",
"id": "S11.1.1_A4.2"
}
]
}
}

View File

@ -0,0 +1,20 @@
{
"testCollection": {
"name": "11.1.2_Identifier_Reference",
"numTests": 2,
"tests": [
{
"section": "11.1.2",
"description": "Creating variables without defining it",
"test": "//CHECK#1\nif (this.x !== undefined) {\n $ERROR('#1: this.x === undefined. Actual: ' + (this.x));\n}\n\n//CHECK#2\nvar object = new Object();\nif (object.prop !== undefined) {\n $ERROR('#2: var object = new Object(); object.prop === undefined. Actual: ' + (object.prop));\n}\n\n//CHECK#3\nthis.y++;\nif (isNaN(y) !== true) {\n $ERROR('#3: this.y++; y === Not-a-Number. Actual: ' + (y));\n}\n",
"id": "S11.1.2_A1_T1"
},
{
"section": "11.1.2",
"description": "Trying to generate ReferenceError",
"test": "//CHECK#1\ntry {\n this.z;\n z;\n $ERROR('#1.1: this.z; z === undefined throw ReferenceError. Actual: ' + (z));\n} catch(e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: this.z; z === undefined throw ReferenceError. Actual: ' + (e));\n }\n}\n",
"id": "S11.1.2_A1_T2"
}
]
}
}

View File

@ -0,0 +1,28 @@
{
"testCollection": {
"name": "11.1.4",
"numTests": 3,
"tests": [
{
"id": "11.1.4-0",
"path": "TestCases/chapter11/11.1/11.1.4/11.1.4-0.js",
"description": "elements elided at the end of an array do not contribute to its length",
"test": "assertTrue((function testcase() {\n var a = [,];\n if (a.length === 1) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.1.4_4-5-1",
"path": "TestCases/chapter11/11.1/11.1.4/11.1.4_4-5-1.js",
"description": "Initialize array using ElementList (Elisionopt AssignmentExpression) when index property (read-only) exists in Array.prototype (step 5)",
"test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n value: 100,\n writable: false,\n configurable: true\n });\n var arr = [101];\n\n return arr.hasOwnProperty(\"0\") && arr[0] === 101;\n } finally {\n delete Array.prototype[0];\n }\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
},
{
"id": "11.1.4_5-6-1",
"path": "TestCases/chapter11/11.1/11.1.4/11.1.4_5-6-1.js",
"description": "Initialize array using ElementList (ElementList , Elisionopt AssignmentExpression) when index property (read-only) exists in Array.prototype (step 6)",
"test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Array.prototype, \"1\", {\n value: 100,\n writable: false,\n configurable: true\n });\n var arr = [101, 12];\n\n return arr.hasOwnProperty(\"1\") && arr[1] === 12;\n } finally {\n delete Array.prototype[1];\n }\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
}
]
}
}

View File

@ -0,0 +1,56 @@
{
"testCollection": {
"name": "11.1.4_Array_Initialiser",
"numTests": 8,
"tests": [
{
"section": "11.1.4",
"description": "Checking various properties of the array defined with expression \"var array = []\"",
"test": "var array = [];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = []; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = []; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = []; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 0) {\n $ERROR('#4: var array = []; array.length === 0. Actual: ' + (array.length));\n}\n",
"id": "S11.1.4_A1.1"
},
{
"section": "11.1.4",
"description": "Checking various properties the array defined with \"var array = [,,,,,]\"",
"test": "var array = [,,,,,];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = [,,,,,]; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = [,,,,,]; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = [,,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 5) {\n $ERROR('#4: var array = [,,,,,]; array.length === 5. Actual: ' + (array.length));\n}\n",
"id": "S11.1.4_A1.2"
},
{
"section": "11.1.4",
"description": "Checking various properteis and contents of the array defined with \"var array = [1,2,3,4,5]\"",
"test": "var array = [1,2,3,4,5];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = [1,2,3,4,5]; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = [1,2,3,4,5]; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = [1,2,3,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 5) {\n $ERROR('#4: var array = [1,2,3,4,5]; array.length === 5. Actual: ' + (array.length));\n}\n\n//CHECK#5\nif (array[0] !== 1) {\n $ERROR('#5: var array = [1,2,3,4,5]; array[0] === 1. Actual: ' + (array[0]));\n}\n\n//CHECK#6\nif (array[1] !== 2) {\n $ERROR('#6: var array = [1,2,3,4,5]; array[1] === 2. Actual: ' + (array[1]));\n}\n\n//CHECK#7\nif (array[2] !== 3) {\n $ERROR('#7: var array = [1,2,3,4,5]; array[2] === 3. Actual: ' + (array[2]));\n}\n\n//CHECK#8\nif (array[3] !== 4) {\n $ERROR('#8: var array = [1,2,3,4,5]; array[3] === 4. Actual: ' + (array[3]));\n}\n\n//CHECK#9\nif (array[4] !== 5) {\n $ERROR('#9: var array = [1,2,3,4,5]; array[4] === 5. Actual: ' + (array[4]));\n}\n",
"id": "S11.1.4_A1.3"
},
{
"section": "11.1.4",
"description": "Checking various properteis and content of the array defined with \"var array = [,,,1,2]\"",
"test": "var array = [,,,1,2];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = [,,,1,2]; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = [,,,1,2]; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = [,,,1,2]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 5) {\n $ERROR('#4: var array = [,,,1,2]; array.length === 5. Actual: ' + (array.length));\n}\n\n//CHECK#5\nif (array[0] !== undefined) {\n $ERROR('#5: var array = [,,,1,2]; array[0] === undefined. Actual: ' + (array[0]));\n}\n\n//CHECK#6\nif (array[1] !== undefined) {\n $ERROR('#6: var array = [,,,1,2]; array[1] === undefined. Actual: ' + (array[1]));\n}\n\n//CHECK#7\nif (array[2] !== undefined) {\n $ERROR('#7: var array = [,,,1,2]; array[2] === undefined. Actual: ' + (array[2]));\n}\n\n//CHECK#8\nif (array[3] !== 1) {\n $ERROR('#8: var array = [,,,1,2]; array[3] === 1. Actual: ' + (array[3]));\n}\n\n//CHECK#9\nif (array[4] !== 2) {\n $ERROR('#9: var array = [,,,1,2]; array[4] === 2. Actual: ' + (array[4]));\n}\n",
"id": "S11.1.4_A1.4"
},
{
"section": "11.1.4",
"description": "Checking various properteis and contents of the array defined with \"var array = [4,5,,,,]\"",
"test": "var array = [4,5,,,,];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = [4,5,,,,]; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = [4,5,,,,]; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = [4,5,,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 5) {\n $ERROR('#4: var array = [4,5,,,,]; array.length === 5. Actual: ' + (array.length));\n}\n\n//CHECK#5\nif (array[0] !== 4) {\n $ERROR('#5: var array = [4,5,,,,]; array[0] === 4. Actual: ' + (array[0]));\n}\n\n//CHECK#6\nif (array[1] !== 5) {\n $ERROR('#6: var array = [4,5,,,,]; array[1] === 5. Actual: ' + (array[1]));\n}\n\n//CHECK#7\nif (array[2] !== undefined) {\n $ERROR('#7: var array = [4,5,,,,]; array[2] === undefined. Actual: ' + (array[2]));\n}\n\n//CHECK#8\nif (array[3] !== undefined) {\n $ERROR('#8: var array = [4,5,,,,]; array[3] === undefined. Actual: ' + (array[3]));\n}\n\n//CHECK#9\nif (array[4] !== undefined) {\n $ERROR('#9: var array = [4,5,,,,]; array[4] === undefined. Actual: ' + (array[4]));\n}\n",
"id": "S11.1.4_A1.5"
},
{
"section": "11.1.4",
"description": "Checking various properteis and contents of the array defined with \"var array = [,,3,,,]\"",
"test": "var array = [,,3,,,];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = [,,3,,,]; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = [,,3,,,]; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = [,,3,,,]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 5) {\n $ERROR('#4: var array = [,,3,,,]; array.length === 5. Actual: ' + (array.length));\n}\n\n//CHECK#5\nif (array[0] !== undefined) {\n $ERROR('#5: var array = [,,3,,,]; array[0] === undefined. Actual: ' + (array[0]));\n}\n\n//CHECK#6\nif (array[1] !== undefined) {\n $ERROR('#6: var array = [,,3,,,]; array[1] === undefined. Actual: ' + (array[1]));\n}\n\n//CHECK#7\nif (array[2] !== 3) {\n $ERROR('#7: var array = [,,3,,,]; array[2] === 3. Actual: ' + (array[2]));\n}\n\n//CHECK#8\nif (array[3] !== undefined) {\n $ERROR('#8: var array = [,,3,,,]; array[3] === undefined. Actual: ' + (array[3]));\n}\n\n//CHECK#9\nif (array[4] !== undefined) {\n $ERROR('#9: var array = [,,3,,,]; array[4] === undefined. Actual: ' + (array[4]));\n}\n",
"id": "S11.1.4_A1.6"
},
{
"section": "11.1.4",
"description": "Checking various properteis and contents of the array defined with \"var array = [1,2,,4,5]\"",
"test": "var array = [1,2,,4,5];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = [1,2,,4,5]; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = [1,2,,4,5]; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = [1,2,,4,5]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 5) {\n $ERROR('#4: var array = [1,2,,4,5]; array.length === 5. Actual: ' + (array.length));\n}\n\n//CHECK#5\nif (array[0] !== 1) {\n $ERROR('#5: var array = [1,2,,4,5]; array[0] === 1. Actual: ' + (array[0]));\n}\n\n//CHECK#6\nif (array[1] !== 2) {\n $ERROR('#6: var array = [1,2,,4,5]; array[1] === 2. Actual: ' + (array[1]));\n}\n\n//CHECK#7\nif (array[2] !== undefined) {\n $ERROR('#7: var array = [1,2,,4,5]; array[2] === undefined. Actual: ' + (array[2]));\n}\n\n//CHECK#8\nif (array[3] !== 4) {\n $ERROR('#8: var array = [1,2,,4,5]; array[3] === 4. Actual: ' + (array[3]));\n}\n\n//CHECK#9\nif (array[4] !== 5) {\n $ERROR('#9: var array = [1,2,,4,5]; array[4] === 5. Actual: ' + (array[4]));\n}\n",
"id": "S11.1.4_A1.7"
},
{
"section": "11.1.4",
"description": "Checking various properteis and contents of the arrya defined with \"var array = [[1,2], [3], []]\"",
"test": "var array = [[1,2], [3], []];\n\n//CHECK#1\nif (typeof array !== \"object\") {\n $ERROR('#1: var array = [[1,2], [3], []]; typeof array === \"object\". Actual: ' + (typeof array));\n}\n\n//CHECK#2\nif (array instanceof Array !== true) {\n $ERROR('#2: var array = [[1,2], [3], []]; array instanceof Array === true');\n}\n\n//CHECK#3\nif (array.toString !== Array.prototype.toString) {\n $ERROR('#3: var array = [[1,2], [3], []]; array.toString === Array.prototype.toString. Actual: ' + (array.toString));\n}\n\n//CHECK#4\nif (array.length !== 3) {\n $ERROR('#4: var array = [[1,2], [3], []]; array.length === 3. Actual: ' + (array.length));\n}\n\nvar subarray = array[0];\n\n//CHECK#5\nif (typeof subarray !== \"object\") {\n $ERROR('#5: var array = [[1,2], [3], []]; var subarray = array[0]; typeof subarray === \"object\". Actual: ' + (typeof subarray));\n}\n\n//CHECK#6\nif (subarray instanceof Array !== true) {\n $ERROR('#6: var array = [[1,2], [3], []]; var subarray = array[0]; subarray instanceof Array === true');\n}\n\n//CHECK#7\nif (subarray.toString !== Array.prototype.toString) {\n $ERROR('#7: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));\n}\n\n//CHECK#8\nif (subarray.length !== 2) {\n $ERROR('#8: var array = [[1,2], [3], []]; var subarray = array[0]; subarray.length === 2. Actual: ' + (subarray.length));\n}\n\n//CHECK#9\nif (subarray[0] !== 1) {\n $ERROR('#9: var array = [[1,2], [3], []]; var subarray = array[0]; subarray[0] === 1. Actual: ' + (subarray[0]));\n}\n\n//CHECK#10\nif (subarray[1] !== 2) {\n $ERROR('#10: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[1] === 2. Actual: ' + (subarray[1]));\n}\n\nvar subarray = array[1];\n\n//CHECK#11\nif (typeof subarray !== \"object\") {\n$ERROR('#11: var array = [[1,2], [3], []]; var subarray = array[1]; typeof subarray === \"object\". Actual: ' + (typeof subarray));\n}\n\n//CHECK#12\nif (subarray instanceof Array !== true) {\n$ERROR('#12: var array = [[1,2], [3], []]; var subarray = array[1]; subarray instanceof Array === true');\n}\n\n//CHECK#13\nif (subarray.toString !== Array.prototype.toString) {\n$ERROR('#13: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));\n}\n\n//CHECK#14\nif (subarray.length !== 1) {\n$ERROR('#14: var array = [[1,2], [3], []]; var subarray = array[1]; subarray.length === 1. Actual: ' + (subarray.length));\n}\n\n//CHECK#15\nif (subarray[0] !== 3) {\n$ERROR('#15: var array = [[1,2], [3], []]; var subarray = array[1]; subarray[0] === 3. Actual: ' + (subarray[0]));\n}\n\nvar subarray = array[2];\n\n//CHECK#16\nif (typeof subarray !== \"object\") {\n$ERROR('#16: var array = [[1,2], [3], []]; var subarray = array[2]; typeof subarray === \"object\". Actual: ' + (typeof subarray));\n}\n\n//CHECK#17\nif (subarray instanceof Array !== true) {\n$ERROR('#17: var array = [[1,2], [3], []]; var subarray = array[2]; subarray instanceof Array === true');\n}\n\n//CHECK#18\nif (subarray.toString !== Array.prototype.toString) {\n$ERROR('#18: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.toString === Array.prototype.toString. Actual: ' + (subarray.toString));\n}\n\n//CHECK#19\nif (subarray.length !== 0) {\n$ERROR('#19: var array = [[1,2], [3], []]; var subarray = array[2]; subarray.length === 0. Actual: ' + (subarray.length));\n}\n\n//CHECK#20\nif (array[0][0] !== 1) {\n $ERROR('#20: var array = [[1,2], [3], []]; array[0][0] === 1. Actual: ' + (array[0][0]));\n}\n\n//CHECK#21\nif (array[0][1] !== 2) {\n $ERROR('#21: var array = [[1,2], [3], []]; array[0][1] === 2. Actual: ' + (array[0][1]));\n}\n\n//CHECK#22\nif (array[1][0] !== 3) {\n $ERROR('#722: var array = [[1,2], [3], []]; array[1][0] === 3. Actual: ' + (array[1][0]));\n}\n",
"id": "S11.1.4_A2"
}
]
}
}

View File

@ -0,0 +1,209 @@
{
"testCollection": {
"name": "11.1.5",
"numTests": 28,
"tests": [
{
"id": "11.1.5-0-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5-0-1.js",
"description": "Object literal - get set property",
"test": "assertTrue((function testcase() {\n var s1 = \"In getter\";\n var s2 = \"In setter\";\n var s3 = \"Modified by setter\";\n eval(\"var o = {get foo(){ return s1;},set foo(arg){return s2 = s3}};\");\n if(o.foo !== s1) \n return false;\n o.foo=10;\n if(s2 !== s3) \n return false;\n return true;\n }).call(this));\n"
},
{
"id": "11.1.5-0-2",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5-0-2.js",
"description": "Object literal - multiple get set properties",
"test": "assertTrue((function testcase() {\n var s1 = \"First getter\";\n var s2 = \"First setter\";\n var s3 = \"Second getter\";\n eval(\"var o = {get foo(){ return s1;},set foo(arg){return s2 = s3}, get bar(){ return s3}, set bar(arg){ s3 = arg;}};\");\n if(o.foo !== s1) \n return false;\n o.foo = 10;\n if(s2 !== s3) \n return false;\n if(o.bar !== s3)\n return false;\n o.bar = \"Second setter\";\n if(o.bar !== \"Second setter\")\n return false;\n return true;\n }).call(this));\n"
},
{
"id": "11.1.5-1-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5-1-s.js",
"description": "Strict Mode - SyntaxError is thrown when 'eval' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var obj = {set _11_1_5_1_fun(eval) {}};\");\n return false;\n } catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5-2-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5-2-s.js",
"description": "Strict Mode - SyntaxError is thrown when 'arguments' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var obj = {set _11_1_5_2_fun(arguments) {} };\");\n return false;\n } catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5-3-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5-3-s.js",
"description": "Strict Mode - SyntaxError is thrown when 'evals' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment if its FunctionBody is strict code",
"test": "assertTrue((function testcase() {\n\n try {\n eval(\"var obj = {set _11_1_5_3_fun(eval) { \\\"use strict\\\"; }};\");\n return false;\n } catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5-4-4-a-1-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js",
"description": "Object literal - SyntaxError for duplicate date property name in strict mode",
"test": "assertTrue((function testcase() {\n \n try\n {\n eval(\"'use strict'; ({foo:0,foo:1});\");\n return false;\n }\n catch(e)\n {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5-4-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5-4-s.js",
"description": "Strict Mode - SyntaxError is thrown when 'arguments' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment if its FunctionBody is strict code",
"test": "assertTrue((function testcase() {\n\n try {\n eval(\"var obj = {set _11_1_5_4_fun(arguments) {\\\"use strict\\\";}};\");\n return false;\n } catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5_3-3-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_3-3-1.js",
"description": "Object initialization using PropertyNameAndValueList (PropertyAssignment) when property (read-only) exists in Object.prototype (step 3)",
"test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Object.prototype, \"prop\", {\n value: 100,\n writable: false,\n configurable: true\n });\n var obj = { prop: 12 };\n\n return obj.hasOwnProperty(\"prop\") && obj.prop === 12;\n } finally {\n delete Object.prototype.prop;\n }\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
},
{
"id": "11.1.5_4-4-a-2",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-a-2.js",
"description": "Object literal - Duplicate data property name allowed if not in strict mode",
"test": "assertTrue((function testcase() {\n \n eval(\"({foo:0,foo:1});\");\n return true;\n }).call(this));\n"
},
{
"id": "11.1.5_4-4-a-3",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-a-3.js",
"description": "Object literal - Duplicate data property name allowed gets last defined value",
"test": "assertTrue((function testcase() {\n \n var o = eval(\"({foo:0,foo:1});\");\n return o.foo===1;\n }).call(this));\n"
},
{
"id": "11.1.5_4-4-b-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-b-1.js",
"description": "Object literal - SyntaxError if a data property definition is followed by get accessor definition with the same name",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({foo : 1, get foo(){}});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-4-b-2",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-b-2.js",
"description": "Object literal - SyntaxError if a data property definition is followed by set accessor definition with the same name",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({foo : 1, set foo(x){}});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-4-c-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-c-1.js",
"description": "Object literal - SyntaxError if a get accessor property definition is followed by a data property definition with the same name",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({get foo(){}, foo : 1});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-4-c-2",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-c-2.js",
"description": "Object literal - SyntaxError if a set accessor property definition is followed by a data property definition with the same name",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({set foo(x){}, foo : 1});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false};\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-4-d-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-d-1.js",
"description": "Object literal - SyntaxError for duplicate property name (get,get)",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({get foo(){}, get foo(){}});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-4-d-2",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-d-2.js",
"description": "Object literal - SyntaxError for duplicate property name (set,set)",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({set foo(arg){}, set foo(arg1){}});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-4-d-3",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-d-3.js",
"description": "Object literal - SyntaxError for duplicate property name (get,set,get)",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({get foo(){}, set foo(arg){}, get foo(){}});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-4-d-4",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-4-d-4.js",
"description": "Object literal - SyntaxError for duplicate property name (set,get,set)",
"test": "assertTrue((function testcase() {\n try\n {\n eval(\"({set foo(arg){}, get foo(){}, set foo(arg1){}});\");\n return false;\n }\n catch(e)\n {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return true;\n}).call(this)"
},
{
"id": "11.1.5_4-5-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_4-5-1.js",
"description": "Object initialization using PropertyNameAndValueList (PropertyNameAndValueList , PropertyAssignment) when property (read-only) exists in Object.prototype (Step 5)",
"test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Object.prototype, \"prop2\", {\n value: 100,\n writable: false,\n configurable: true\n });\n\n var obj = { prop1: 101, prop2: 12 };\n\n return obj.hasOwnProperty(\"prop2\");\n } finally {\n delete Object.prototype.prop2;\n }\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
},
{
"id": "11.1.5_5-4-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_5-4-1.js",
"description": "Object literal - property descriptor for assignment expression",
"test": "assertTrue((function testcase() {\n\n var o = {foo : 1};\n var desc = Object.getOwnPropertyDescriptor(o,\"foo\");\n if(desc.value === 1 &&\n desc.writable === true &&\n desc.enumerable === true &&\n desc.configurable === true)\n return true;\n }).call(this));\n",
"precondition": "(fnExists(Object.getOwnPropertyDescriptor))"
},
{
"id": "11.1.5_6-2-1-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js",
"description": "Strict Mode - SyntaxError is thrown when an assignment to a reserved word or a future reserved word is contained in strict code",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var obj = {\\\n get _11_1_5_6_2_1() {\\\n public = 42;\\\n return public;\\\n }\\\n };\");\n\n var _11_1_5_6_2_1 = obj._11_1_5_6_2_1;\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5_6-2-2-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js",
"description": "Strict Mode - SyntaxError is thrown when an assignment to a reserved word or a future reserved word is made inside a strict mode FunctionBody of a PropertyAssignment",
"test": "assertTrue((function testcase() {\n\n try {\n eval(\"var obj = {\\\n get _11_1_5_6_2_2() {\\\n \\\"use strict\\\";\\\n public = 42;\\\n return public;\\\n }\\\n };\\\n var _11_1_5_6_2_2 = obj._11_1_5_6_2_2;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5_6-3-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_6-3-1.js",
"description": "Object literal - property descriptor for get property assignment",
"test": "assertTrue((function testcase() {\n\n eval(\"var o = {get foo(){return 1;}};\");\n var desc = Object.getOwnPropertyDescriptor(o,\"foo\");\n if(desc.enumerable === true &&\n desc.configurable === true)\n return true;\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return fnExists(Object.getOwnPropertyDescriptor);\n}).call(this)"
},
{
"id": "11.1.5_6-3-2",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_6-3-2.js",
"description": "Object literal - property descriptor for get property assignment should not create a set function",
"test": "assertTrue((function testcase() {\n\n eval(\"var o = {get foo(){return 1;}};\");\n var desc = Object.getOwnPropertyDescriptor(o,\"foo\");\n return desc.set === undefined\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return fnExists(Object.getOwnPropertyDescriptor);;\n}).call(this)"
},
{
"id": "11.1.5_7-2-1-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js",
"description": "Strict Mode - SyntaxError is thrown when an assignment to a reserved word is contained in strict code",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var data = \\\"data\\\";\\\n var obj = {\\\n set _11_1_5_7_2_1(value) {\\\n public = 42;\\\n data = value;\\\n }\\\n };\\\n obj._11_1_5_7_2_1 = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5_7-2-2-s",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js",
"description": "Strict Mode - SyntaxError is thrown when an assignment to a reserved word is made in a strict FunctionBody of a PropertyAssignment",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var data = \\\"data\\\";\\\n var obj = {\\\n set _11_1_5_7_2_2(value) {\\\n public = 42;\\\n data = value;\\\n }\\\n };\\\n obj._11_1_5_7_2_2 = 1;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.1.5_7-3-1",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_7-3-1.js",
"description": "Object literal - property descriptor for set property assignment",
"test": "assertTrue((function testcase() {\n\n eval(\"var o = {set foo(arg){return 1;}};\");\n var desc = Object.getOwnPropertyDescriptor(o,\"foo\");\n if(desc.enumerable === true &&\n desc.configurable === true)\n return true;\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return fnExists(Object.getOwnPropertyDescriptor);;\n}).call(this)"
},
{
"id": "11.1.5_7-3-2",
"path": "TestCases/chapter11/11.1/11.1.5/11.1.5_7-3-2.js",
"description": "Object literal - property descriptor for set property assignment should not create a get function",
"test": "assertTrue((function testcase() {\n\n eval(\"var o = {set foo(arg){}};\");\n var desc = Object.getOwnPropertyDescriptor(o,\"foo\");\n return desc.get === undefined\n }).call(this));\n",
"precondition": "(function () {\n //accessor properties in object literals must be allowed\n try {eval(\"({set foo(x) {}, get foo(){}});\");}\n catch(e) {return false}\n return fnExists(Object.getOwnPropertyDescriptor);;\n}).call(this)"
}
]
}
}

View File

@ -0,0 +1,64 @@
{
"testCollection": {
"name": "11.1.5_Object_Initializer",
"numTests": 9,
"tests": [
{
"section": "11.1.5",
"description": "Checking various properteis of the object defined with \"var object = {}\"",
"test": "var object = {};\n\n//CHECK#1\nif (typeof object !== \"object\") {\n $ERROR('#1: var object = {}; typeof object === \"object\". Actual: ' + (typeof object));\n}\n\n//CHECK#2\nif (object instanceof Object !== true) {\n $ERROR('#2: var object = {}; object instanceof Object === true');\n}\n\n//CHECK#3\nif (object.toString !== Object.prototype.toString) {\n $ERROR('#3: var object = {}; object.toString === Object.prototype.toString. Actual: ' + (object.toString));\n}\n\n//CHECK#4\nif (object.toString() !== \"[object Object]\") {\n $ERROR('#4: var object = {}; object.toString === \"[object Object]\". Actual: ' + (object.toString));\n}\n",
"id": "S11.1.5_A1.1"
},
{
"section": "11.1.5",
"description": "Checking various properteis and contents of the object defined with \"var object = {1 : true}\"",
"test": "var object = {1 : true};\n\n//CHECK#1\nif (typeof object !== \"object\") {\n $ERROR('#1: var object = {1 : true}; typeof object === \"object\". Actual: ' + (typeof object));\n}\n\n//CHECK#2\nif (object instanceof Object !== true) {\n $ERROR('#2: var object = {1 : true}; object instanceof Object === true');\n}\n\n//CHECK#3\nif (object.toString !== Object.prototype.toString) {\n $ERROR('#3: var object = {1 : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString));\n}\n\n//CHECK#4\nif (object[1] !== true) {\n $ERROR('#4: var object = {1 : true}; object[1] === true');\n}\n\n//CHECK#5\nif (object[\"1\"] !== true) {\n $ERROR('#5: var object = {1 : true}; object[\"1\"] === true');\n}\n\n",
"id": "S11.1.5_A1.2"
},
{
"section": "11.1.5",
"description": "Checking various properteis and contents of the object defined with \"var object = {\"x\" : true}\"",
"test": "var object = {\"x\" : true};\n\n//CHECK#1\nif (typeof object !== \"object\") {\n $ERROR('#1: var object = {\"x\" : true}; typeof object === \"object\". Actual: ' + (typeof object));\n}\n\n//CHECK#2\nif (object instanceof Object !== true) {\n $ERROR('#2: var object = {\"x\" : true}; object instanceof Object === true');\n}\n\n//CHECK#3\nif (object.toString !== Object.prototype.toString) {\n $ERROR('#3: var object = {\"x\" : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString));\n}\n\n//CHECK#4\nif (object[\"x\"] !== true) {\n $ERROR('#4: var object = {\"x\" : true}; object[\"x\"] === true');\n}\n\n//CHECK#5\nif (object.x !== true) {\n $ERROR('#5: var object = {\"x\" : true}; object.x === true');\n}\n",
"id": "S11.1.5_A1.3"
},
{
"section": "11.1.5",
"description": "Checking various properteis and contents of the object defined with \"var object = {prop : true}\"",
"test": "var object = {prop : true};\n\n//CHECK#1\nif (typeof object !== \"object\") {\n $ERROR('#1: var object = {prop : true}; typeof object === \"object\". Actual: ' + (typeof object));\n}\n\n//CHECK#2\nif (object instanceof Object !== true) {\n $ERROR('#2: var object = {prop : true}; object instanceof Object === true');\n}\n\n//CHECK#3\nif (object.toString !== Object.prototype.toString) {\n $ERROR('#3: var object = {prop : true}; object.toString === Object.prototype.toString. Actual: ' + (object.toString));\n}\n\n//CHECK#4\nif (object[\"prop\"] !== true) {\n $ERROR('#4: var object = {prop : true}; object[\"prop\"] === true');\n}\n\n//CHECK#5\nif (object.prop !== true) {\n $ERROR('#5: var object = {prop : true}; object.prop === true');\n}\n",
"id": "S11.1.5_A1.4"
},
{
"section": "11.1.5",
"description": "Creating property \"prop\" of various types(boolean, number and etc.)",
"test": "//CHECK#1\nvar x = true;\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#1: var x = true; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#2\nvar x = new Boolean(true);\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#2: var x = new Boolean(true); var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#3\nvar x = 1;\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#3: var x = 1; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#4\nvar x = new Number(1);\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#4: var x = new Number(1); var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#5\nvar x = \"1\";\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#5: var x = \"1\"; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#6\nvar x = new String(1);\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#6: var x = new String(1); var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#7\nvar x = undefined;\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#7: var x = undefined; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#8\nvar x = null;\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#8: var x = null; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#9\nvar x = {};\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#9: var x = {}; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#10\nvar x = [1,2];\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#10: var x = [1,2]; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#11\nvar x = function() {};\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#11: var x = function() {}; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n\n//CHECK#12\nvar x = this;\nvar object = {prop : x}; \nif (object.prop !== x) {\n $ERROR('#12: var x = this; var object = {prop : x}; object.prop === x. Actual: ' + (object.prop));\n}\n",
"id": "S11.1.5_A2"
},
{
"section": "11.1.5",
"description": "Creating the object defined with \"var object = {0 : 1, \"1\" : \"x\", o : {}}\"",
"test": "var object = {0 : 1, \"1\" : \"x\", o : {}};\n\n//CHECK#1\nif (object[0] !== 1) {\n $ERROR('#1: var object = {0 : 1; \"1\" : \"x\"; o : {}}; object[0] === 1. Actual: ' + (object[0]));\n}\n\n//CHECK#2\nif (object[\"1\"] !== \"x\") {\n $ERROR('#2: var object = {0 : 1; \"1\" : \"x\"; o : {}}; object[\"1\"] === \"x\". Actual: ' + (object[\"1\"]));\n}\n\n//CHECK#3\nif (typeof object.o !== \"object\") {\n $ERROR('#1: var object = {0 : 1; \"1\" : \"x\"; o : {}}; typeof object.o === \"object\". Actual: ' + (typeof object.o));\n}\n",
"id": "S11.1.5_A3"
},
{
"section": "11.1.5",
"description": "Checking if execution of \"var object = {true : 1}\" fails",
"negative": "",
"test": "//CHECK#1\nvar object = {true : 1};\n",
"id": "S11.1.5_A4.1"
},
{
"section": "11.1.5",
"description": "Checking if execution of \"var object = {null : true}\" fails",
"negative": "",
"test": "//CHECK#1\nvar object = {null : true};\n",
"id": "S11.1.5_A4.2"
},
{
"section": "11.1.5",
"description": "Creating properties with following names: undefined, 'true', 'null'",
"test": "//CHECK#1\nvar object = {undefined : true};\nif (object.undefined !== true) {\n $ERROR('#1: var object = {undefined : true}; object.undefined === true');\n}\n\n//CHECK#2\nvar object = {undefined : true};\nif (object[\"undefined\"] !== true) {\n $ERROR('#2: var object = {undefined : true}; object[\"undefined\"] === true');\n}\n\n//CHECK#3\nvar object = {\"true\" : true};\nif (object[\"true\"] !== true) {\n $ERROR('#3: var object = {\"true\" : true}; object[\"true\"] === true');\n}\n\n//CHECK#4\nvar object = {\"null\" : true};\nif (object[\"null\"] !== true) {\n $ERROR('#4: var object = {\"null\" : true}; object[\"null\"] === true');\n}\n",
"id": "S11.1.5_A4.3"
}
]
}
}

View File

@ -0,0 +1,56 @@
{
"testCollection": {
"name": "11.1.6_The_Grouping_Operator",
"numTests": 8,
"tests": [
{
"section": "11.1.6, 7.2, 7.3",
"description": "Inserting WhiteSpaces and LineTerminators into grouping operator. Eval is used",
"test": "//CHECK#1\nif (eval(\"(\\u00091\\u0009)\") !== 1) {\n $ERROR('#1: (\\\\u00091\\\\u0009) === 1');\n}\n\n//CHECK#2\nif (eval(\"(\\u000B1\\u000B)\") !== 1) {\n $ERROR('#2: (\\\\u000B1\\\\u000B) === 1'); \n}\n\n//CHECK#3\nif (eval(\"(\\u000C1\\u000C)\") !== 1) {\n $ERROR('#3: (\\\\u000C1\\\\u000C) === 1');\n}\n\n//CHECK#4\nif (eval(\"(\\u00201\\u0020)\") !== 1) {\n $ERROR('#4: (\\\\u00201\\\\u0020 === 1');\n}\n\n//CHECK#5\nif (eval(\"(\\u00A01\\u00A0)\") !== 1) {\n $ERROR('#5: (\\\\u00A01\\\\u00A0) === 1');\n}\n\n//CHECK#6\nif (eval(\"(\\u000A1\\u000A)\") !== 1) {\n $ERROR('#6: (\\\\u000A1\\\\u000A) === 1'); \n}\n\n//CHECK#7\nif (eval(\"(\\u000D1\\u000D)\") !== 1) {\n $ERROR('#7: (\\\\u000D1\\\\u000D) === 1');\n}\n\n//CHECK#8\nif (eval(\"(\\u20281\\u2028)\") !== 1) {\n $ERROR('#8: (\\\\u20281\\\\u2028) === 1');\n}\n\n//CHECK#9\nif (eval(\"(\\u20291\\u2029)\") !== 1) {\n $ERROR('#9: (\\\\u20291\\\\u2029) === 1');\n}\n\n//CHECK#10\nif (eval(\"(\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029)\") !== 1) {\n $ERROR('#10: (\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029) === 1');\n}\n",
"id": "S11.1.6_A1"
},
{
"section": "11.1.6",
"description": "Applying \"delete\" and \"typeof\" operators to an undefined variable and a property of an object",
"test": "//CHECK#1\nif (delete (x) !== true) {\n $ERROR('#1: delete (x) === true');\n}\n\n//CHECK#2\nif (typeof (x) !== \"undefined\") {\n $ERROR('#2: typeof (x) === \"undefined\". Actual: ' + (typeof (x)));\n}\n\nvar object = {};\n//CHECK#3\nif (delete (object.prop) !== true) {\n $ERROR('#3: var object = {}; delete (object.prop) === true');\n}\n\n//CHECK#4\nif (typeof (object.prop) !== \"undefined\") {\n $ERROR('#4: var object = {}; typeof (object.prop) === \"undefined\". Actual: ' + (typeof (object.prop)));\n}\n",
"id": "S11.1.6_A2"
},
{
"section": "11.1.6",
"description": "Applying grouping operator to Boolean",
"test": "// Check for Boolean\n\n//CHECK#1\nif ((true) !== true) {\n $ERROR('#1: (true) === true');\n}\n\n//CHECK#2\nvar x = new Boolean(true);\nif ((x) !== x) {\n $ERROR('#2: var x = new Boolean(true); (x) === x. Actual: ' + ((x)));\n}\n",
"id": "S11.1.6_A3_T1"
},
{
"section": "11.1.6",
"description": "Applying grouping operator to Number",
"test": "//Check for Number\n\n//CHECK#1\nif ((1) !== 1) {\n $ERROR('#1: (1) === 1. Actual: ' + ((1)));\n}\n\n//CHECK#2\nvar x = new Number(1);\nif ((x) !== x) {\n $ERROR('#2: var x = new Number(1); (x) === x. Actual: ' + ((x)));\n}\n",
"id": "S11.1.6_A3_T2"
},
{
"section": "11.1.6",
"description": "Applying grouping operator to String",
"test": "//Check for String\n\n//CHECK#1\nif ((\"1\") !== \"1\") {\n $ERROR('#1: (\"1\") === \"1\". Actual: ' + ((\"1\")));\n}\n\n//CHECK#2\nif ((\"x\") !== \"x\") {\n $ERROR('#2: (\"x\") === \"x\". Actual: ' + ((\"x\")));\n}\n\n//CHECK#3\nvar x = new Number(\"1\");\nif ((x) !== x) {\n $ERROR('#3: var x = new Number(\"1\"); (x) === x. Actual: ' + ((x)));\n}\n",
"id": "S11.1.6_A3_T3"
},
{
"section": "11.1.6",
"description": "Applying grouping operator to undefined",
"test": "//Check for undefined and null\n\n//CHECK#1\nif ((undefined) !== undefined) {\n $ERROR('#1: (undefined) === undefined. Actual: ' + ((undefined)));\n}\n\n//CHECK#2\nif ((void 0) !== void 0) {\n $ERROR('#2: (void 0) === void 0. Actual: ' + ((void 0)));\n}\n\n//CHECK#2\nif ((null) !== null) {\n $ERROR('#2: (null) === null. Actual: ' + ((null)));\n}\n",
"id": "S11.1.6_A3_T4"
},
{
"section": "11.1.6",
"description": "Using grouping operator in declaration of variables",
"test": "//CHECK#1\n(x) = 1;\nif (x !== 1) {\n $ERROR('#1: (x) = 1; x === 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar y = 1; (y)++; ++(y); (y)--; --(y);\nif (y !== 1) {\n $ERROR('#2: var y = 1; (y)++; ++(y); (y)--; --(y); y === 1. Actual: ' + (y));\n}\n",
"id": "S11.1.6_A3_T5"
},
{
"section": "11.1.6",
"description": "Applying grouping operator to delete and typeof operators",
"test": "//CHECK#1\nif (delete (x) !== true) {\n $ERROR('#1: delete (x) === true');\n}\n\n//CHECK#2\nif (typeof (x) !== \"undefined\") {\n $ERROR('#2: typeof (x) === \"undefined\". Actual: ' + (typeof (x)));\n}\n",
"id": "S11.1.6_A3_T6"
}
]
}
}

View File

@ -0,0 +1,146 @@
{
"testCollection": {
"name": "11.10.1_AND_Operator",
"numTests": 23,
"tests": [
{
"section": "11.10.1",
"description": "Checking uses eval",
"test": "//CHECK#1\nif ((eval(\"1\\u0009&\\u00091\")) !== 1) {\n $ERROR('#1: (1\\\\u0009&\\\\u00091) === 1');\n}\n\n//CHECK#2\nif ((eval(\"1\\u000B&\\u000B1\")) !== 1) {\n $ERROR('#2: (1\\\\u000B&\\\\u000B1) === 1'); \n}\n\n//CHECK#3\nif ((eval(\"1\\u000C&\\u000C1\")) !== 1) {\n $ERROR('#3: (1\\\\u000C&\\\\u000C1) === 1');\n}\n\n//CHECK#4\nif ((eval(\"1\\u0020&\\u00201\")) !== 1) {\n $ERROR('#4: (1\\\\u0020&\\\\u00201) === 1');\n}\n\n//CHECK#5\nif ((eval(\"1\\u00A0&\\u00A01\")) !== 1) {\n $ERROR('#5: (1\\\\u00A0&\\\\u00A01) === 1');\n}\n\n//CHECK#6\nif ((eval(\"1\\u000A&\\u000A1\")) !== 1) {\n $ERROR('#6: (1\\\\u000A&\\\\u000A1) === 1'); \n}\n\n//CHECK#7\nif ((eval(\"1\\u000D&\\u000D1\")) !== 1) {\n $ERROR('#7: (1\\\\u000D&\\\\u000D1) === 1');\n}\n\n//CHECK#8\nif ((eval(\"1\\u2028&\\u20281\")) !== 1) {\n $ERROR('#8: (1\\\\u2028&\\\\u20281) === 1');\n}\n\n//CHECK#9\nif ((eval(\"1\\u2029&\\u20291\")) !== 1) {\n $ERROR('#9: (1\\\\u2029&\\\\u20291) === 1');\n}\n\n\n//CHECK#10\nif ((eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029&\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\")) !== 1) {\n $ERROR('#10: (1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029&\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === 1');\n}\n",
"id": "S11.10.1_A1"
},
{
"section": "11.10.1",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((1 & 1) !== 1) {\n $ERROR('#1: (1 & 1) === 1. Actual: ' + ((1 & 1)));\n}\n\n//CHECK#2\nvar x = 1;\nif ((x & 1) !== 1) {\n $ERROR('#2: var x = 1; (x & 1) === 1. Actual: ' + ((x & 1)));\n}\n\n//CHECK#3\nvar y = 1;\nif ((1 & y) !== 1) {\n $ERROR('#3: var y = 1; (1 & y) === 1. Actual: ' + ((1 & y)));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif ((x & y) !== 1) {\n $ERROR('#4: var x = 1; var y = 1; (x & y) === 1. Actual: ' + ((x & y)));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif ((objectx.prop & objecty.prop) !== 1) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop & objecty.prop) === 1. Actual: ' + ((objectx.prop & objecty.prop)));\n}\n",
"id": "S11.10.1_A2.1_T1"
},
{
"section": "11.10.1",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x & 1;\n $ERROR('#1.1: x & 1 throw ReferenceError. Actual: ' + (x & 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x & 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.10.1_A2.1_T2"
},
{
"section": "11.10.1",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 & y;\n $ERROR('#1.1: 1 & y throw ReferenceError. Actual: ' + (1 & y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 & y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.10.1_A2.1_T3"
},
{
"section": "11.10.1, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif (({valueOf: function() {return 1}} & 1) !== 1) {\n $ERROR('#1: ({valueOf: function() {return 1}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}} & 1)));\n}\n\n//CHECK#2\nif (({valueOf: function() {return 1}, toString: function() {return 0}} & 1) !== 1) {\n $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return 0}} & 1)));\n}\n\n//CHECK#3\nif (({valueOf: function() {return 1}, toString: function() {return {}}} & 1) !== 1) {\n $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return {}}} & 1)));\n}\n\n//CHECK#4\ntry {\n if (({valueOf: function() {return 1}, toString: function() {throw \"error\"}} & 1) !== 1) {\n $ERROR('#4.1: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {throw \"error\"}} & 1)));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} & 1) not throw \"error\"');\n } else {\n $ERROR('#4.3: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} & 1) not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif ((1 & {toString: function() {return 1}}) !== 1) {\n $ERROR('#5.1: (1 & {toString: function() {return 1}}) === 1. Actual: ' + ((1 & {toString: function() {return 1}})));\n}\n\n//CHECK#6\nif ((1 & {valueOf: function() {return {}}, toString: function() {return 1}}) !== 1) {\n $ERROR('#6: (1 & {valueOf: function() {return {}}, toString: function() {return 1}}) === 1. Actual: ' + ((1 & {valueOf: function() {return {}}, toString: function() {return 1}})));\n}\n\n//CHECK#7\ntry {\n 1 & {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n $ERROR('#7.1: 1 & {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (1 & {valueOf: function() {throw \"error\"}, toString: function() {return 1}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 & {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 & {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 & {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.10.1_A2.2_T1"
},
{
"section": "11.10.1",
"description": "Checking by using \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x & y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x & y throw \"x\". Actual: ' + (x & y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToInt32(first expression) is called first, and then ToInt32(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x & y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.10.1_A2.3_T1"
},
{
"section": "11.10.1",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif (((x = 1) & x) !== 1) {\n $ERROR('#1: var x = 0; ((x = 1) & x) === 1. Actual: ' + (((x = 1) & x)));\n}\n\n//CHECK#2\nvar x = 0; \nif ((x & (x = 1)) !== 0) {\n $ERROR('#2: var x = 0; (x & (x = 1)) === 0. Actual: ' + ((x & (x = 1))));\n}\n\n",
"id": "S11.10.1_A2.4_T1"
},
{
"section": "11.10.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() & y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() & y() throw \"x\". Actual: ' + (x() & y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() & y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.10.1_A2.4_T2"
},
{
"section": "11.10.1",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x & (x = 1);\n $ERROR('#1.1: x & (x = 1) throw ReferenceError. Actual: ' + (x & (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x & (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (((y = 1) & y) !== 1) {\n $ERROR('#2: ((y = 1) & y) === 1. Actual: ' + (((y = 1) & y)));\n}\n\n",
"id": "S11.10.1_A2.4_T3"
},
{
"section": "11.10.1",
"description": "Type(x) and Type(y) are primitive boolean and Boolean object",
"test": "//CHECK#1\nif ((true & true) !== 1) {\n $ERROR('#1: (true & true) === 1. Actual: ' + ((true & true)));\n}\n\n//CHECK#2\nif ((new Boolean(true) & true) !== 1) {\n $ERROR('#2: (new Boolean(true) & true) === 1. Actual: ' + ((new Boolean(true) & true)));\n}\n\n//CHECK#3\nif ((true & new Boolean(true)) !== 1) {\n $ERROR('#3: (true & new Boolean(true)) === 1. Actual: ' + ((true & new Boolean(true))));\n}\n\n//CHECK#4\nif ((new Boolean(true) & new Boolean(true)) !== 1) {\n $ERROR('#4: (new Boolean(true) & new Boolean(true)) === 1. Actual: ' + ((new Boolean(true) & new Boolean(true))));\n}\n",
"id": "S11.10.1_A3_T1.1"
},
{
"section": "11.10.1",
"description": "Type(x) and Type(y) are primitive number and Number object",
"test": "//CHECK#1\nif ((1 & 1) !== 1) {\n $ERROR('#1: (1 & 1) === 1. Actual: ' + ((1 & 1)));\n}\n\n//CHECK#2\nif ((new Number(1) & 1) !== 1) {\n $ERROR('#2: (new Number(1) & 1) === 1. Actual: ' + ((new Number(1) & 1)));\n}\n\n//CHECK#3\nif ((1 & new Number(1)) !== 1) {\n $ERROR('#3: (1 & new Number(1)) === 1. Actual: ' + ((1 & new Number(1))));\n}\n\n//CHECK#4\nif ((new Number(1) & new Number(1)) !== 1) {\n $ERROR('#4: (new Number(1) & new Number(1)) === 1. Actual: ' + ((new Number(1) & new Number(1))));\n}\n\n",
"id": "S11.10.1_A3_T1.2"
},
{
"section": "11.10.1",
"description": "Type(x) and Type(y) are primitive string and String object",
"test": "//CHECK#1\nif ((\"1\" & \"1\") !== 1) {\n $ERROR('#1: (\"1\" & \"1\") === 1. Actual: ' + ((\"1\" & \"1\")));\n}\n\n//CHECK#2\nif ((new String(\"1\") & \"1\") !== 1) {\n $ERROR('#2: (new String(\"1\") & \"1\") === 1. Actual: ' + ((new String(\"1\") & \"1\")));\n}\n\n//CHECK#3\nif ((\"1\" & new String(\"1\")) !== 1) {\n $ERROR('#3: (\"1\" & new String(\"1\")) === 1. Actual: ' + ((\"1\" & new String(\"1\"))));\n}\n\n//CHECK#4\nif ((new String(\"1\") & new String(\"1\")) !== 1) {\n $ERROR('#4: (new String(\"1\") & new String(\"1\")) === 1. Actual: ' + ((new String(\"1\") & new String(\"1\"))));\n}\n\n//CHECK#5\nif ((\"x\" & \"1\") !== 0) {\n $ERROR('#5: (\"x\" & \"1\") === 0. Actual: ' + ((\"x\" & \"1\")));\n}\n\n//CHECK#6\nif ((\"1\" & \"x\") !== 0) {\n $ERROR('#6: (\"1\" & \"x\") === 0. Actual: ' + ((\"1\" & \"x\")));\n}\n",
"id": "S11.10.1_A3_T1.3"
},
{
"section": "11.10.1",
"description": "Type(x) and Type(y) are null and undefined",
"test": "//CHECK#1\nif ((null & undefined) !== 0) {\n $ERROR('#1: (null & undefined) === 0. Actual: ' + ((null & undefined)));\n}\n\n//CHECK#2\nif ((undefined & null) !== 0) {\n $ERROR('#2: (undefined & null) === 0. Actual: ' + ((undefined & null)));\n}\n\n//CHECK#3\nif ((undefined & undefined) !== 0) {\n $ERROR('#3: (undefined & undefined) === 0. Actual: ' + ((undefined & undefined)));\n}\n\n//CHECK#4\nif ((null & null) !== 0) {\n $ERROR('#4: (null & null) === 0. Actual: ' + ((null & null)));\n}\n",
"id": "S11.10.1_A3_T1.4"
},
{
"section": "11.10.1",
"description": "Type(x) and Type(y) are Object object and Function object",
"test": "//CHECK#1\nif (({} & function(){return 1}) !== 0) {\n $ERROR('#1: ({} & function(){return 1}) === 0. Actual: ' + (({} & function(){return 1})));\n}\n\n//CHECK#2\nif ((function(){return 1} & {}) !== 0) {\n $ERROR('#2: (function(){return 1} & {}) === 0. Actual: ' + ((function(){return 1} & {})));\n}\n\n//CHECK#3\nif ((function(){return 1} & function(){return 1}) !== 0) {\n $ERROR('#3: (function(){return 1} & function(){return 1}) === 0. Actual: ' + ((function(){return 1} & function(){return 1})));\n}\n\n//CHECK#4\nif (({} & {}) !== 0) {\n $ERROR('#4: ({} & {}) === 0. Actual: ' + (({} & {})));\n}\n\n",
"id": "S11.10.1_A3_T1.5"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif ((true & 1) !== 1) {\n $ERROR('#1: (true & 1) === 1. Actual: ' + ((true & 1)));\n}\n\n//CHECK#2\nif ((1 & true) !== 1) {\n $ERROR('#2: (1 & true) === 1. Actual: ' + ((1 & true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) & 1) !== 1) {\n $ERROR('#3: (new Boolean(true) & 1) === 1. Actual: ' + ((new Boolean(true) & 1)));\n}\n\n//CHECK#4\nif ((1 & new Boolean(true)) !== 1) {\n $ERROR('#4: (1 & new Boolean(true)) === 1. Actual: ' + ((1 & new Boolean(true))));\n}\n\n//CHECK#5\nif ((true & new Number(1)) !== 1) {\n $ERROR('#5: (true & new Number(1)) === 1. Actual: ' + ((true & new Number(1))));\n}\n\n//CHECK#6\nif ((new Number(1) & true) !== 1) {\n $ERROR('#6: (new Number(1) & true) === 1. Actual: ' + ((new Number(1) & true)));\n}\n\n//CHECK#7\nif ((new Boolean(true) & new Number(1)) !== 1) {\n $ERROR('#7: (new Boolean(true) & new Number(1)) === 1. Actual: ' + ((new Boolean(true) & new Number(1))));\n}\n\n//CHECK#8\nif ((new Number(1) & new Boolean(true)) !== 1) {\n $ERROR('#8: (new Number(1) & new Boolean(true)) === 1. Actual: ' + ((new Number(1) & new Boolean(true))));\n}\n",
"id": "S11.10.1_A3_T2.1"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif ((\"1\" & 1) !== 1) {\n $ERROR('#1: (\"1\" & 1) === 1. Actual: ' + ((\"1\" & 1)));\n}\n\n//CHECK#2\nif ((1 & \"1\") !== 1) {\n $ERROR('#2: (1 & \"1\") === 1. Actual: ' + ((1 & \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") & 1) !== 1) {\n $ERROR('#3: (new String(\"1\") & 1) === 1. Actual: ' + ((new String(\"1\") & 1)));\n}\n\n//CHECK#4\nif ((1 & new String(\"1\")) !== 1) {\n $ERROR('#4: (1 & new String(\"1\")) === 1. Actual: ' + ((1 & new String(\"1\"))));\n}\n\n//CHECK#5\nif ((\"1\" & new Number(1)) !== 1) {\n $ERROR('#5: (\"1\" & new Number(1)) === 1. Actual: ' + ((\"1\" & new Number(1))));\n}\n\n//CHECK#6\nif ((new Number(1) & \"1\") !== 1) {\n $ERROR('#6: (new Number(1) & \"1\") === 1. Actual: ' + ((new Number(1) & \"1\")));\n}\n\n//CHECK#7\nif ((new String(\"1\") & new Number(1)) !== 1) {\n $ERROR('#7: (new String(\"1\") & new Number(1)) === 1. Actual: ' + ((new String(\"1\") & new Number(1))));\n}\n\n//CHECK#8\nif ((new Number(1) & new String(\"1\")) !== 1) {\n $ERROR('#8: (new Number(1) & new String(\"1\")) === 1. Actual: ' + ((new Number(1) & new String(\"1\"))));\n}\n\n//CHECK#9\nif ((\"x\" & 1) !== 0) {\n $ERROR('#9: (\"x\" & 1) === 0. Actual: ' + ((\"x\" & 1)));\n}\n\n//CHECK#10\nif ((1 & \"x\") !== 0) {\n $ERROR('#10: (1 & \"x\") === 0. Actual: ' + ((1 & \"x\")));\n}\n",
"id": "S11.10.1_A3_T2.2"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif ((1 & null) !== 0) {\n $ERROR('#1: (1 & null) === 0. Actual: ' + ((1 & null)));\n}\n\n//CHECK#2\nif ((null & 1) !== 0) {\n $ERROR('#2: (null & 1) === 0. Actual: ' + ((null & 1)));\n}\n\n//CHECK#3\nif ((new Number(1) & null) !== 0) {\n $ERROR('#3: (new Number(1) & null) === 0. Actual: ' + ((new Number(1) & null)));\n}\n\n//CHECK#4\nif ((null & new Number(1)) !== 0) {\n $ERROR('#4: (null & new Number(1)) === 0. Actual: ' + ((null & new Number(1))));\n}\n",
"id": "S11.10.1_A3_T2.3"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((1 & undefined) !== 0) {\n $ERROR('#1: (1 & undefined) === 0. Actual: ' + ((1 & undefined)));\n}\n\n//CHECK#2\nif ((undefined & 1) !== 0) {\n $ERROR('#2: (undefined & 1) === 0. Actual: ' + ((undefined & 1)));\n}\n\n//CHECK#3\nif ((new Number(1) & undefined) !== 0) {\n $ERROR('#3: (new Number(1) & undefined) === 0. Actual: ' + ((new Number(1) & undefined)));\n}\n\n//CHECK#4\nif ((undefined & new Number(1)) !== 0) {\n $ERROR('#4: (undefined & new Number(1)) === 0. Actual: ' + ((undefined & new Number(1))));\n}\n",
"id": "S11.10.1_A3_T2.4"
},
{
"section": "11.10.1",
"description": "Type(x) us different from Type(y) and both types are String (primitive or object) or Boolean (primitive and object)",
"test": "//CHECK#1\nif ((true & \"1\") !== 1) {\n $ERROR('#1: (true & \"1\") === 1. Actual: ' + ((true & \"1\")));\n}\n\n//CHECK#2\nif ((\"1\" & true) !== 1) {\n $ERROR('#2: (\"1\" & true) === 1. Actual: ' + ((\"1\" & true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) & \"1\") !== 1) {\n $ERROR('#3: (new Boolean(true) & \"1\") === 1. Actual: ' + ((new Boolean(true) & \"1\")));\n}\n\n//CHECK#4\nif ((\"1\" & new Boolean(true)) !== 1) {\n $ERROR('#4: (\"1\" & new Boolean(true)) === 1. Actual: ' + ((\"1\" & new Boolean(true))));\n}\n\n//CHECK#5\nif ((true & new String(\"1\")) !== 1) {\n $ERROR('#5: (true & new String(\"1\")) === 1. Actual: ' + ((true & new String(\"1\"))));\n}\n\n//CHECK#6\nif ((new String(\"1\") & true) !== 1) {\n $ERROR('#6: (new String(\"1\") & true) === 1. Actual: ' + ((new String(\"1\") & true)));\n}\n\n//CHECK#7\nif ((new Boolean(true) & new String(\"1\")) !== 1) {\n $ERROR('#7: (new Boolean(true) & new String(\"1\")) === 1. Actual: ' + ((new Boolean(true) & new String(\"1\"))));\n}\n\n//CHECK#8\nif ((new String(\"1\") & new Boolean(true)) !== 1) {\n $ERROR('#8: (new String(\"1\") & new Boolean(true)) === 1. Actual: ' + ((new String(\"1\") & new Boolean(true))));\n}\n",
"id": "S11.10.1_A3_T2.5"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((\"1\" & undefined) !== 0) {\n $ERROR('#1: (\"1\" & undefined) === 0. Actual: ' + ((\"1\" & undefined)));\n}\n\n//CHECK#2\nif ((undefined & \"1\") !== 0) {\n $ERROR('#2: (undefined & \"1\") === 0. Actual: ' + ((undefined & \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") & undefined) !== 0) {\n $ERROR('#3: (new String(\"1\") & undefined) === 0. Actual: ' + ((new String(\"1\") & undefined)));\n}\n\n//CHECK#4\nif ((undefined & new String(\"1\")) !== 0) {\n $ERROR('#4: (undefined & new String(\"1\")) === 0. Actual: ' + ((undefined & new String(\"1\"))));\n}\n",
"id": "S11.10.1_A3_T2.6"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif ((\"1\" & null) !== 0) {\n $ERROR('#1: (\"1\" & null) === 0. Actual: ' + ((\"1\" & null)));\n}\n\n//CHECK#2\nif ((null & \"1\") !== 0) {\n $ERROR('#2: (null & \"1\") === 0. Actual: ' + ((null & \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") & null) !== 0) {\n $ERROR('#3: (new String(\"1\") & null) === 0. Actual: ' + ((new String(\"1\") & null)));\n}\n\n//CHECK#4\nif ((null & new String(\"1\")) !== 0) {\n $ERROR('#4: (null & new String(\"1\")) === 0. Actual: ' + ((null & new String(\"1\"))));\n}\n",
"id": "S11.10.1_A3_T2.7"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((true & undefined) !== 0) {\n $ERROR('#1: (true & undefined) === 0. Actual: ' + ((true & undefined)));\n}\n\n//CHECK#2\nif ((undefined & true) !== 0) {\n $ERROR('#2: (undefined & true) === 0. Actual: ' + ((undefined & true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) & undefined) !== 0) {\n $ERROR('#3: (new Boolean(true) & undefined) === 0. Actual: ' + ((new Boolean(true) & undefined)));\n}\n\n//CHECK#4\nif ((undefined & new Boolean(true)) !== 0) {\n $ERROR('#4: (undefined & new Boolean(true)) === 0. Actual: ' + ((undefined & new Boolean(true))));\n}\n",
"id": "S11.10.1_A3_T2.8"
},
{
"section": "11.10.1",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif ((true & null) !== 0) {\n $ERROR('#1: (true & null) === 0. Actual: ' + ((true & null)));\n}\n\n//CHECK#2\nif ((null & true) !== 0) {\n $ERROR('#2: (null & true) === 0. Actual: ' + ((null & true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) & null) !== 0) {\n $ERROR('#3: (new Boolean(true) & null) === 0. Actual: ' + ((new Boolean(true) & null)));\n}\n\n//CHECK#4\nif ((null & new Boolean(true)) !== 0) {\n $ERROR('#4: (null & new Boolean(true)) === 0. Actual: ' + ((null & new Boolean(true))));\n}\n",
"id": "S11.10.1_A3_T2.9"
}
]
}
}

View File

@ -0,0 +1,146 @@
{
"testCollection": {
"name": "11.10.2_XOR_Operator",
"numTests": 23,
"tests": [
{
"section": "11.10.2",
"description": "The check uses eval",
"test": "//CHECK#1\nif ((eval(\"1\\u0009^\\u00091\")) !== 0) {\n $ERROR('#1: (1\\\\u0009^\\\\u00091) === 0');\n}\n\n//CHECK#2\nif ((eval(\"1\\u000B^\\u000B1\")) !== 0) {\n $ERROR('#2: (1\\\\u000B^\\\\u000B1) === 0'); \n}\n\n//CHECK#3\nif ((eval(\"1\\u000C^\\u000C1\")) !== 0) {\n $ERROR('#3: (1\\\\u000C^\\\\u000C1) === 0');\n}\n\n//CHECK#4\nif ((eval(\"1\\u0020^\\u00201\")) !== 0) {\n $ERROR('#4: (1\\\\u0020^\\\\u00201) === 0');\n}\n\n//CHECK#5\nif ((eval(\"1\\u00A0^\\u00A01\")) !== 0) {\n $ERROR('#5: (1\\\\u00A0^\\\\u00A01) === 0');\n}\n\n//CHECK#6\nif ((eval(\"1\\u000A^\\u000A1\")) !== 0) {\n $ERROR('#6: (1\\\\u000A^\\\\u000A1) === 0'); \n}\n\n//CHECK#7\nif ((eval(\"1\\u000D^\\u000D1\")) !== 0) {\n $ERROR('#7: (1\\\\u000D^\\\\u000D1) === 0');\n}\n\n//CHECK#8\nif ((eval(\"1\\u2028^\\u20281\")) !== 0) {\n $ERROR('#8: (1\\\\u2028^\\\\u20281) === 0');\n}\n\n//CHECK#9\nif ((eval(\"1\\u2029^\\u20291\")) !== 0) {\n $ERROR('#9: (1\\\\u2029^\\\\u20291) === 0');\n}\n\n\n//CHECK#10\nif ((eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029^\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\")) !== 0) {\n $ERROR('#10: (1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029^\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === 0');\n}\n",
"id": "S11.10.2_A1"
},
{
"section": "11.10.2",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((1 ^ 1) !== 0) {\n $ERROR('#1: (1 ^ 1) === 0. Actual: ' + ((1 ^ 1)));\n}\n\n//CHECK#2\nvar x = 1;\nif ((x ^ 1) !== 0) {\n $ERROR('#2: var x = 1; (x ^ 1) === 0. Actual: ' + ((x ^ 1)));\n}\n\n//CHECK#3\nvar y = 1;\nif ((1 ^ y) !== 0) {\n $ERROR('#3: var y = 1; (1 ^ y) === 0. Actual: ' + ((1 ^ y)));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif ((x ^ y) !== 0) {\n $ERROR('#4: var x = 1; var y = 1; (x ^ y) === 0. Actual: ' + ((x ^ y)));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif ((objectx.prop ^ objecty.prop) !== 0) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop ^ objecty.prop) === 0. Actual: ' + ((objectx.prop ^ objecty.prop)));\n}\n \n",
"id": "S11.10.2_A2.1_T1"
},
{
"section": "11.10.2",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x ^ 1;\n $ERROR('#1.1: x ^ 1 throw ReferenceError. Actual: ' + (x ^ 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x ^ 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.10.2_A2.1_T2"
},
{
"section": "11.10.2",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 ^ y;\n $ERROR('#1.1: 1 ^ y throw ReferenceError. Actual: ' + (1 ^ y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 ^ y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.10.2_A2.1_T3"
},
{
"section": "11.10.2, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif (({valueOf: function() {return 1}} ^ 1) !== 0) {\n $ERROR('#1: ({valueOf: function() {return 1}} ^ 1) === 0. Actual: ' + (({valueOf: function() {return 1}} ^ 1)));\n}\n\n//CHECK#2\nif (({valueOf: function() {return 1}, toString: function() {return 0}} ^ 1) !== 0) {\n $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} ^ 1) === 0. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return 0}} ^ 1)));\n}\n\n//CHECK#3\nif (({valueOf: function() {return 1}, toString: function() {return {}}} ^ 1) !== 0) {\n $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} ^ 1) === 0. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return {}}} ^ 1)));\n}\n\n//CHECK#4\ntry {\n if (({valueOf: function() {return 1}, toString: function() {throw \"error\"}} ^ 1) !== 0) {\n $ERROR('#4.1: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} ^ 1) === 0. Actual: ' + (({valueOf: function() {return 1}, toString: function() {throw \"error\"}} ^ 1)));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} ^ 1) not throw \"error\"');\n } else {\n $ERROR('#4.3: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} ^ 1) not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif ((1 ^ {toString: function() {return 1}}) !== 0) {\n $ERROR('#5: (1 ^ {toString: function() {return 1}}) === 0. Actual: ' + ((1 ^ {toString: function() {return 1}})));\n}\n\n//CHECK#6\nif ((1 ^ {valueOf: function() {return {}}, toString: function() {return 1}}) !== 0) {\n $ERROR('#6: (1 ^ {valueOf: function() {return {}}, toString: function() {return 1}}) === 0. Actual: ' + ((1 ^ {valueOf: function() {return {}}, toString: function() {return 1}})));\n}\n\n//CHECK#7\ntry {\n 1 ^ {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n $ERROR('#7.1: 1 ^ {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (1 ^ {valueOf: function() {throw \"error\"}, toString: function() {return 1}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 ^ {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 ^ {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 ^ {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 ^ {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 ^ {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.10.2_A2.2_T1"
},
{
"section": "11.10.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x ^ y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x ^ y throw \"x\". Actual: ' + (x ^ y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToInt32(first expression) is called first, and then ToInt32(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x ^ y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.10.2_A2.3_T1"
},
{
"section": "11.10.2",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 1; \nif (((x = 0) ^ x) !== 0) {\n $ERROR('#1: var x = 0; ((x = 1) ^ x) === 0. Actual: ' + (((x = 1) ^ x)));\n}\n\n//CHECK#2\nvar x = 0; \nif ((x ^ (x = 1)) !== 1) {\n $ERROR('#2: var x = 0; (x ^ (x = 1)) === 1. Actual: ' + ((x ^ (x = 1))));\n}\n\n\n",
"id": "S11.10.2_A2.4_T1"
},
{
"section": "11.10.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() ^ y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() ^ y() throw \"x\". Actual: ' + (x() ^ y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() ^ y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.10.2_A2.4_T2"
},
{
"section": "11.10.2",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x ^ (x = 1);\n $ERROR('#1.1: x ^ (x = 1) throw ReferenceError. Actual: ' + (x ^ (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x ^ (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (((y = 1) ^ y) !== 0) {\n $ERROR('#2: ((y = 1) ^ y) === 0. Actual: ' + (((y = 1) ^ y)));\n}\n\n\n",
"id": "S11.10.2_A2.4_T3"
},
{
"section": "11.10.2",
"description": "Type(x) and Type(y) are primitive boolean and Boolean object",
"test": "//CHECK#1\nif ((true ^ true) !== 0) {\n $ERROR('#1: (true ^ true) === 0. Actual: ' + ((true ^ true)));\n}\n\n//CHECK#2\nif ((new Boolean(true) ^ true) !== 0) {\n $ERROR('#2: (new Boolean(true) ^ true) === 0. Actual: ' + ((new Boolean(true) ^ true)));\n}\n\n//CHECK#3\nif ((true ^ new Boolean(true)) !== 0) {\n $ERROR('#3: (true ^ new Boolean(true)) === 0. Actual: ' + ((true ^ new Boolean(true))));\n}\n\n//CHECK#4\nif ((new Boolean(true) ^ new Boolean(true)) !== 0) {\n $ERROR('#4: (new Boolean(true) ^ new Boolean(true)) === 0. Actual: ' + ((new Boolean(true) ^ new Boolean(true))));\n}\n",
"id": "S11.10.2_A3_T1.1"
},
{
"section": "11.10.2",
"description": "Type(x) and Type(y) are primitive number and Number object",
"test": "//CHECK#1\nif ((1 ^ 1) !== 0) {\n $ERROR('#1: (1 ^ 1) === 0. Actual: ' + ((1 ^ 1)));\n}\n\n//CHECK#2\nif ((new Number(1) ^ 1) !== 0) {\n $ERROR('#2: (new Number(1) ^ 1) === 0. Actual: ' + ((new Number(1) ^ 1)));\n}\n\n//CHECK#3\nif ((1 ^ new Number(1)) !== 0) {\n $ERROR('#3: (1 ^ new Number(1)) === 0. Actual: ' + ((1 ^ new Number(1))));\n}\n\n//CHECK#4\nif ((new Number(1) ^ new Number(1)) !== 0) {\n $ERROR('#4: (new Number(1) ^ new Number(1)) === 0. Actual: ' + ((new Number(1) ^ new Number(1))));\n}\n\n",
"id": "S11.10.2_A3_T1.2"
},
{
"section": "11.10.2",
"description": "Type(x) and Type(y) are primitive string and String object",
"test": "//CHECK#1\nif ((\"1\" ^ \"1\") !== 0) {\n $ERROR('#1: (\"1\" ^ \"1\") === 0. Actual: ' + ((\"1\" ^ \"1\")));\n}\n\n//CHECK#2\nif ((new String(\"1\") ^ \"1\") !== 0) {\n $ERROR('#2: (new String(\"1\") ^ \"1\") === 0. Actual: ' + ((new String(\"1\") ^ \"1\")));\n}\n\n//CHECK#3\nif ((\"1\" ^ new String(\"1\")) !== 0) {\n $ERROR('#3: (\"1\" ^ new String(\"1\")) === 0. Actual: ' + ((\"1\" ^ new String(\"1\"))));\n}\n\n//CHECK#4\nif ((new String(\"1\") ^ new String(\"1\")) !== 0) {\n $ERROR('#4: (new String(\"1\") ^ new String(\"1\")) === 0. Actual: ' + ((new String(\"1\") ^ new String(\"1\"))));\n}\n\n//CHECK#5\nif ((\"x\" ^ \"1\") !== 1) {\n $ERROR('#5: (\"x\" ^ \"1\") === 1. Actual: ' + ((\"x\" ^ \"1\")));\n}\n\n//CHECK#6\nif ((\"1\" ^ \"x\") !== 1) {\n $ERROR('#6: (\"1\" ^ \"x\") === 1. Actual: ' + ((\"1\" ^ \"x\")));\n}\n",
"id": "S11.10.2_A3_T1.3"
},
{
"section": "11.10.2",
"description": "Type(x) and Type(y) are null and undefined",
"test": "//CHECK#1\nif ((null ^ undefined) !== 0) {\n $ERROR('#1: (null ^ undefined) === 0. Actual: ' + ((null ^ undefined)));\n}\n\n//CHECK#2\nif ((undefined ^ null) !== 0) {\n $ERROR('#2: (undefined ^ null) === 0. Actual: ' + ((undefined ^ null)));\n}\n\n//CHECK#3\nif ((undefined ^ undefined) !== 0) {\n $ERROR('#3: (undefined ^ undefined) === 0. Actual: ' + ((undefined ^ undefined)));\n}\n\n//CHECK#4\nif ((null ^ null) !== 0) {\n $ERROR('#4: (null ^ null) === 0. Actual: ' + ((null ^ null)));\n}\n",
"id": "S11.10.2_A3_T1.4"
},
{
"section": "11.10.2",
"description": "Type(x) and Type(y) are Object object and Function object",
"test": "//CHECK#1\nif (({} ^ function(){return 1}) !== 0) {\n $ERROR('#1: ({} ^ function(){return 1}) === 0. Actual: ' + (({} ^ function(){return 1})));\n}\n\n//CHECK#2\nif ((function(){return 1} ^ {}) !== 0) {\n $ERROR('#2: (function(){return 1} ^ {}) === 0. Actual: ' + ((function(){return 1} ^ {})));\n}\n\n//CHECK#3\nif ((function(){return 1} ^ function(){return 1}) !== 0) {\n $ERROR('#3: (function(){return 1} ^ function(){return 1}) === 0. Actual: ' + ((function(){return 1} ^ function(){return 1})));\n}\n\n//CHECK#4\nif (({} ^ {}) !== 0) {\n $ERROR('#4: ({} ^ {}) === 0. Actual: ' + (({} ^ {})));\n}\n\n",
"id": "S11.10.2_A3_T1.5"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif ((true ^ 1) !== 0) {\n $ERROR('#1: (true ^ 1) === 0. Actual: ' + ((true ^ 1)));\n}\n\n//CHECK#2\nif ((1 ^ true) !== 0) {\n $ERROR('#2: (1 ^ true) === 0. Actual: ' + ((1 ^ true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) ^ 1) !== 0) {\n $ERROR('#3: (new Boolean(true) ^ 1) === 0. Actual: ' + ((new Boolean(true) ^ 1)));\n}\n\n//CHECK#4\nif ((1 ^ new Boolean(true)) !== 0) {\n $ERROR('#4: (1 ^ new Boolean(true)) === 0. Actual: ' + ((1 ^ new Boolean(true))));\n}\n\n//CHECK#5\nif ((true ^ new Number(1)) !== 0) {\n $ERROR('#5: (true ^ new Number(1)) === 0. Actual: ' + ((true ^ new Number(1))));\n}\n\n//CHECK#6\nif ((new Number(1) ^ true) !== 0) {\n $ERROR('#6: (new Number(1) ^ true) === 0. Actual: ' + ((new Number(1) ^ true)));\n}\n\n//CHECK#7\nif ((new Boolean(true) ^ new Number(1)) !== 0) {\n $ERROR('#7: (new Boolean(true) ^ new Number(1)) === 0. Actual: ' + ((new Boolean(true) ^ new Number(1))));\n}\n\n//CHECK#8\nif ((new Number(1) ^ new Boolean(true)) !== 0) {\n $ERROR('#8: (new Number(1) ^ new Boolean(true)) === 0. Actual: ' + ((new Number(1) ^ new Boolean(true))));\n}\n",
"id": "S11.10.2_A3_T2.1"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif ((\"1\" ^ 1) !== 0) {\n $ERROR('#1: (\"1\" ^ 1) === 0. Actual: ' + ((\"1\" ^ 1)));\n}\n\n//CHECK#2\nif ((1 ^ \"1\") !== 0) {\n $ERROR('#2: (1 ^ \"1\") === 0. Actual: ' + ((1 ^ \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") ^ 1) !== 0) {\n $ERROR('#3: (new String(\"1\") ^ 1) === 0. Actual: ' + ((new String(\"1\") ^ 1)));\n}\n\n//CHECK#4\nif ((1 ^ new String(\"1\")) !== 0) {\n $ERROR('#4: (1 ^ new String(\"1\")) === 0. Actual: ' + ((1 ^ new String(\"1\"))));\n}\n\n//CHECK#5\nif ((\"1\" ^ new Number(1)) !== 0) {\n $ERROR('#5: (\"1\" ^ new Number(1)) === 0. Actual: ' + ((\"1\" ^ new Number(1))));\n}\n\n//CHECK#6\nif ((new Number(1) ^ \"1\") !== 0) {\n $ERROR('#6: (new Number(1) ^ \"1\") === 0. Actual: ' + ((new Number(1) ^ \"1\")));\n}\n\n//CHECK#7\nif ((new String(\"1\") ^ new Number(1)) !== 0) {\n $ERROR('#7: (new String(\"1\") ^ new Number(1)) === 0. Actual: ' + ((new String(\"1\") ^ new Number(1))));\n}\n\n//CHECK#8\nif ((new Number(1) ^ new String(\"1\")) !== 0) {\n $ERROR('#8: (new Number(1) ^ new String(\"1\")) === 0. Actual: ' + ((new Number(1) ^ new String(\"1\"))));\n}\n\n//CHECK#9\nif ((\"x\" ^ 1) !== 1) {\n $ERROR('#9: (\"x\" ^ 1) === 1. Actual: ' + ((\"x\" ^ 1)));\n}\n\n//CHECK#10\nif ((1 ^ \"x\") !== 1) {\n $ERROR('#10: (1 ^ \"x\") === 1. Actual: ' + ((1 ^ \"x\")));\n}\n",
"id": "S11.10.2_A3_T2.2"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif ((1 ^ null) !== 1) {\n $ERROR('#1: (1 ^ null) === 1. Actual: ' + ((1 ^ null)));\n}\n\n//CHECK#2\nif ((null ^ 1) !== 1) {\n $ERROR('#2: (null ^ 1) === 1. Actual: ' + ((null ^ 1)));\n}\n\n//CHECK#3\nif ((new Number(1) ^ null) !== 1) {\n $ERROR('#3: (new Number(1) ^ null) === 1. Actual: ' + ((new Number(1) ^ null)));\n}\n\n//CHECK#4\nif ((null ^ new Number(1)) !== 1) {\n $ERROR('#4: (null ^ new Number(1)) === 1. Actual: ' + ((null ^ new Number(1))));\n}\n",
"id": "S11.10.2_A3_T2.3"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((1 ^ undefined) !== 1) {\n $ERROR('#1: (1 ^ undefined) === 1. Actual: ' + ((1 ^ undefined)));\n}\n\n//CHECK#2\nif ((undefined ^ 1) !== 1) {\n $ERROR('#2: (undefined ^ 1) === 1. Actual: ' + ((undefined ^ 1)));\n}\n\n//CHECK#3\nif ((new Number(1) ^ undefined) !== 1) {\n $ERROR('#3: (new Number(1) ^ undefined) === 1. Actual: ' + ((new Number(1) ^ undefined)));\n}\n\n//CHECK#4\nif ((undefined ^ new Number(1)) !== 1) {\n $ERROR('#4: (undefined ^ new Number(1)) === 1. Actual: ' + ((undefined ^ new Number(1))));\n}\n",
"id": "S11.10.2_A3_T2.4"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif ((true ^ \"1\") !== 0) {\n $ERROR('#1: (true ^ \"1\") === 0. Actual: ' + ((true ^ \"1\")));\n}\n\n//CHECK#2\nif ((\"1\" ^ true) !== 0) {\n $ERROR('#2: (\"1\" ^ true) === 0. Actual: ' + ((\"1\" ^ true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) ^ \"1\") !== 0) {\n $ERROR('#3: (new Boolean(true) ^ \"1\") === 0. Actual: ' + ((new Boolean(true) ^ \"1\")));\n}\n\n//CHECK#4\nif ((\"1\" ^ new Boolean(true)) !== 0) {\n $ERROR('#4: (\"1\" ^ new Boolean(true)) === 0. Actual: ' + ((\"1\" ^ new Boolean(true))));\n}\n\n//CHECK#5\nif ((true ^ new String(\"1\")) !== 0) {\n $ERROR('#5: (true ^ new String(\"1\")) === 0. Actual: ' + ((true ^ new String(\"1\"))));\n}\n\n//CHECK#6\nif ((new String(\"1\") ^ true) !== 0) {\n $ERROR('#6: (new String(\"1\") ^ true) === 0. Actual: ' + ((new String(\"1\") ^ true)));\n}\n\n//CHECK#7\nif ((new Boolean(true) ^ new String(\"1\")) !== 0) {\n $ERROR('#7: (new Boolean(true) ^ new String(\"1\")) === 0. Actual: ' + ((new Boolean(true) ^ new String(\"1\"))));\n}\n\n//CHECK#8\nif ((new String(\"1\") ^ new Boolean(true)) !== 0) {\n $ERROR('#8: (new String(\"1\") ^ new Boolean(true)) === 0. Actual: ' + ((new String(\"1\") ^ new Boolean(true))));\n}\n",
"id": "S11.10.2_A3_T2.5"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((\"1\" ^ undefined) !== 1) {\n $ERROR('#1: (\"1\" ^ undefined) === 1. Actual: ' + ((\"1\" ^ undefined)));\n}\n\n//CHECK#2\nif ((undefined ^ \"1\") !== 1) {\n $ERROR('#2: (undefined ^ \"1\") === 1. Actual: ' + ((undefined ^ \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") ^ undefined) !== 1) {\n $ERROR('#3: (new String(\"1\") ^ undefined) === 1. Actual: ' + ((new String(\"1\") ^ undefined)));\n}\n\n//CHECK#4\nif ((undefined ^ new String(\"1\")) !== 1) {\n $ERROR('#4: (undefined ^ new String(\"1\")) === 1. Actual: ' + ((undefined ^ new String(\"1\"))));\n}\n",
"id": "S11.10.2_A3_T2.6"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif ((\"1\" ^ null) !== 1) {\n $ERROR('#1: (\"1\" ^ null) === 1. Actual: ' + ((\"1\" ^ null)));\n}\n\n//CHECK#2\nif ((null ^ \"1\") !== 1) {\n $ERROR('#2: (null ^ \"1\") === 1. Actual: ' + ((null ^ \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") ^ null) !== 1) {\n $ERROR('#3: (new String(\"1\") ^ null) === 1. Actual: ' + ((new String(\"1\") ^ null)));\n}\n\n//CHECK#4\nif ((null ^ new String(\"1\")) !== 1) {\n $ERROR('#4: (null ^ new String(\"1\")) === 1. Actual: ' + ((null ^ new String(\"1\"))));\n}\n",
"id": "S11.10.2_A3_T2.7"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((true ^ undefined) !== 1) {\n $ERROR('#1: (true ^ undefined) === 1. Actual: ' + ((true ^ undefined)));\n}\n\n//CHECK#2\nif ((undefined ^ true) !== 1) {\n $ERROR('#2: (undefined ^ true) === 1. Actual: ' + ((undefined ^ true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) ^ undefined) !== 1) {\n $ERROR('#3: (new Boolean(true) ^ undefined) === 1. Actual: ' + ((new Boolean(true) ^ undefined)));\n}\n\n//CHECK#4\nif ((undefined ^ new Boolean(true)) !== 1) {\n $ERROR('#4: (undefined ^ new Boolean(true)) === 1. Actual: ' + ((undefined ^ new Boolean(true))));\n}\n",
"id": "S11.10.2_A3_T2.8"
},
{
"section": "11.10.2",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif ((true ^ null) !== 1) {\n $ERROR('#1: (true ^ null) === 1. Actual: ' + ((true ^ null)));\n}\n\n//CHECK#2\nif ((null ^ true) !== 1) {\n $ERROR('#2: (null ^ true) === 1. Actual: ' + ((null ^ true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) ^ null) !== 1) {\n $ERROR('#3: (new Boolean(true) ^ null) === 1. Actual: ' + ((new Boolean(true) ^ null)));\n}\n\n//CHECK#4\nif ((null ^ new Boolean(true)) !== 1) {\n $ERROR('#4: (null ^ new Boolean(true)) === 1. Actual: ' + ((null ^ new Boolean(true))));\n}\n",
"id": "S11.10.2_A3_T2.9"
}
]
}
}

View File

@ -0,0 +1,146 @@
{
"testCollection": {
"name": "11.10.3_OR_Operator",
"numTests": 23,
"tests": [
{
"section": "11.10.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif ((eval(\"0\\u0009|\\u00091\")) !== 1) {\n $ERROR('#1: (0\\\\u0009|\\\\u00091) === 1');\n}\n\n//CHECK#2\nif ((eval(\"0\\u000B|\\u000B1\")) !== 1) {\n $ERROR('#2: (0\\\\u000B|\\\\u000B1) === 1'); \n}\n\n//CHECK#3\nif ((eval(\"0\\u000C|\\u000C1\")) !== 1) {\n $ERROR('#3: (0\\\\u000C|\\\\u000C1) === 1');\n}\n\n//CHECK#4\nif ((eval(\"0\\u0020|\\u00201\")) !== 1) {\n $ERROR('#4: (0\\\\u0020|\\\\u00201) === 1');\n}\n\n//CHECK#5\nif ((eval(\"0\\u00A0|\\u00A01\")) !== 1) {\n $ERROR('#5: (0\\\\u00A0|\\\\u00A01) === 1');\n}\n\n//CHECK#6\nif ((eval(\"0\\u000A|\\u000A1\")) !== 1) {\n $ERROR('#6: (0\\\\u000A|\\\\u000A1) === 1'); \n}\n\n//CHECK#7\nif ((eval(\"0\\u000D|\\u000D1\")) !== 1) {\n $ERROR('#7: (0\\\\u000D|\\\\u000D1) === 1');\n}\n\n//CHECK#8\nif ((eval(\"0\\u2028|\\u20281\")) !== 1) {\n $ERROR('#8: (0\\\\u2028|\\\\u20281) === 1');\n}\n\n//CHECK#9\nif ((eval(\"0\\u2029|\\u20291\")) !== 1) {\n $ERROR('#9: (0\\\\u2029|\\\\u20291) === 1');\n}\n\n\n//CHECK#10\nif ((eval(\"0\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029|\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\")) !== 1) {\n $ERROR('#10: (0\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029|\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === 1');\n}\n",
"id": "S11.10.3_A1"
},
{
"section": "11.10.3",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((1 | 0) !== 1) {\n $ERROR('#1: (1 | 0) === 1. Actual: ' + ((1 | 0)));\n}\n\n//CHECK#2\nvar x = 1;\nif ((x | 0) !== 1) {\n $ERROR('#2: var x = 1; (x | 0) === 1. Actual: ' + ((x | 0)));\n}\n\n//CHECK#3\nvar y = 0;\nif ((1 | y) !== 1) {\n $ERROR('#3: var y = 0; (1 | y) === 1. Actual: ' + ((1 | y)));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 0;\nif ((x | y) !== 1) {\n $ERROR('#4: var x = 1; var y = 0; (x | y) === 1. Actual: ' + ((x | y)));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 0;\nif ((objectx.prop | objecty.prop) !== 1) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 0; (objectx.prop | objecty.prop) === 1. Actual: ' + ((objectx.prop | objecty.prop)));\n}\n",
"id": "S11.10.3_A2.1_T1"
},
{
"section": "11.10.3",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x | 1;\n $ERROR('#1.1: x | 1 throw ReferenceError. Actual: ' + (x | 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x | 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.10.3_A2.1_T2"
},
{
"section": "11.10.3",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 | y;\n $ERROR('#1.1: 1 | y throw ReferenceError. Actual: ' + (1 | y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 | y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.10.3_A2.1_T3"
},
{
"section": "11.10.3, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif (({valueOf: function() {return 1}} | 0) !== 1) {\n $ERROR('#1: ({valueOf: function() {return 1}} | 0) === 1. Actual: ' + (({valueOf: function() {return 1}} | 0)));\n}\n\n//CHECK#2\nif (({valueOf: function() {return 1}, toString: function() {return 0}} | 0) !== 1) {\n $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} | 0) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return 0}} | 0)));\n}\n\n//CHECK#3\nif (({valueOf: function() {return 1}, toString: function() {return {}}} | 0) !== 1) {\n $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} | 0) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return {}}} | 0)));\n}\n\n//CHECK#4\ntry {\n if (({valueOf: function() {return 1}, toString: function() {throw \"error\"}} | 0) !== 1) {\n $ERROR('#4.1: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} | 0) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {throw \"error\"}} | 0)));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} | 0) not throw \"error\"');\n } else {\n $ERROR('#4.3: ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} | 0) not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif ((0 | {toString: function() {return 1}}) !== 1) {\n $ERROR('#5: (0 | {toString: function() {return 1}}) === 1. Actual: ' + ((0 | {toString: function() {return 1}})));\n}\n\n//CHECK#6\nif ((0 | {valueOf: function() {return {}}, toString: function() {return 1}}) !== 1) {\n $ERROR('#6: (0 | {valueOf: function() {return {}}, toString: function() {return 1}}) === 1. Actual: ' + ((0 | {valueOf: function() {return {}}, toString: function() {return 1}})));\n}\n\n//CHECK#7\ntry {\n 0 | {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n $ERROR('#7.1: 0 | {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (0 | {valueOf: function() {throw \"error\"}, toString: function() {return 1}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 0 | {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 0 | {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 0 | {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (0 | {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 0 | {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.10.3_A2.2_T1"
},
{
"section": "11.10.3",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x | y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x | y throw \"x\". Actual: ' + (x | y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToInt32(first expression) is called first, and then ToInt32(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x | y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.10.3_A2.3_T1"
},
{
"section": "11.10.3",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 1; \nif (((x = 0) | x) !== 0) {\n $ERROR('#1: var x = 1; ((x = 0) | x) === 0. Actual: ' + (((x = 0) | x)));\n}\n\n//CHECK#2\nvar x = 1; \nif ((x | (x = 0)) !== 1) {\n $ERROR('#2: var x = 1; (x | (x = 0)) === 1. Actual: ' + ((x | (x = 0))));\n}\n",
"id": "S11.10.3_A2.4_T1"
},
{
"section": "11.10.3",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() | y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() | y() throw \"x\". Actual: ' + (x() | y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() | y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.10.3_A2.4_T2"
},
{
"section": "11.10.3",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x | (x = 1);\n $ERROR('#1.1: x | (x = 1) throw ReferenceError. Actual: ' + (x | (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x | (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (((y = 1) | y) !== 1) {\n $ERROR('#2: ((y = 1) | y) === 1. Actual: ' + (((y = 1) | y)));\n}\n",
"id": "S11.10.3_A2.4_T3"
},
{
"section": "11.10.3",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif ((true | true) !== 1) {\n $ERROR('#1: (true | true) === 1. Actual: ' + ((true | true)));\n}\n\n//CHECK#2\nif ((new Boolean(true) | true) !== 1) {\n $ERROR('#2: (new Boolean(true) | true) === 1. Actual: ' + ((new Boolean(true) | true)));\n}\n\n//CHECK#3\nif ((true | new Boolean(true)) !== 1) {\n $ERROR('#3: (true | new Boolean(true)) === 1. Actual: ' + ((true | new Boolean(true))));\n}\n\n//CHECK#4\nif ((new Boolean(true) | new Boolean(true)) !== 1) {\n $ERROR('#4: (new Boolean(true) | new Boolean(true)) === 1. Actual: ' + ((new Boolean(true) | new Boolean(true))));\n}\n",
"id": "S11.10.3_A3_T1.1"
},
{
"section": "11.10.3",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif ((1 | 1) !== 1) {\n $ERROR('#1: (1 | 1) === 1. Actual: ' + ((1 | 1)));\n}\n\n//CHECK#2\nif ((new Number(1) | 1) !== 1) {\n $ERROR('#2: (new Number(1) | 1) === 1. Actual: ' + ((new Number(1) | 1)));\n}\n\n//CHECK#3\nif ((1 | new Number(1)) !== 1) {\n $ERROR('#3: (1 | new Number(1)) === 1. Actual: ' + ((1 | new Number(1))));\n}\n\n//CHECK#4\nif ((new Number(1) | new Number(1)) !== 1) {\n $ERROR('#4: (new Number(1) | new Number(1)) === 1. Actual: ' + ((new Number(1) | new Number(1))));\n}\n\n",
"id": "S11.10.3_A3_T1.2"
},
{
"section": "11.10.3",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif ((\"1\" | \"1\") !== 1) {\n $ERROR('#1: (\"1\" | \"1\") === 1. Actual: ' + ((\"1\" | \"1\")));\n}\n\n//CHECK#2\nif ((new String(\"1\") | \"1\") !== 1) {\n $ERROR('#2: (new String(\"1\") | \"1\") === 1. Actual: ' + ((new String(\"1\") | \"1\")));\n}\n\n//CHECK#3\nif ((\"1\" | new String(\"1\")) !== 1) {\n $ERROR('#3: (\"1\" | new String(\"1\")) === 1. Actual: ' + ((\"1\" | new String(\"1\"))));\n}\n\n//CHECK#4\nif ((new String(\"1\") | new String(\"1\")) !== 1) {\n $ERROR('#4: (new String(\"1\") | new String(\"1\")) === 1. Actual: ' + ((new String(\"1\") | new String(\"1\"))));\n}\n\n//CHECK#5\nif ((\"x\" | \"1\") !== 1) {\n $ERROR('#5: (\"x\" | \"1\") === 1. Actual: ' + ((\"x\" | \"1\")));\n}\n\n//CHECK#6\nif ((\"1\" | \"x\") !== 1) {\n $ERROR('#6: (\"1\" | \"x\") === 1. Actual: ' + ((\"1\" | \"x\")));\n}\n",
"id": "S11.10.3_A3_T1.3"
},
{
"section": "11.10.3",
"description": "Type(x) and Type(y) vary between Null and Undefined",
"test": "//CHECK#1\nif ((null | undefined) !== 0) {\n $ERROR('#1: (null | undefined) === 0. Actual: ' + ((null | undefined)));\n}\n\n//CHECK#2\nif ((undefined | null) !== 0) {\n $ERROR('#2: (undefined | null) === 0. Actual: ' + ((undefined | null)));\n}\n\n//CHECK#3\nif ((undefined | undefined) !== 0) {\n $ERROR('#3: (undefined | undefined) === 0. Actual: ' + ((undefined | undefined)));\n}\n\n//CHECK#4\nif ((null | null) !== 0) {\n $ERROR('#4: (null | null) === 0. Actual: ' + ((null | null)));\n}\n",
"id": "S11.10.3_A3_T1.4"
},
{
"section": "11.10.3",
"description": "Type(x) and Type(y) vary between Object object and Function object",
"test": "//CHECK#1\nif (({} | function(){return 1}) !== 0) {\n $ERROR('#1: ({} | function(){return 1}) === 0. Actual: ' + (({} | function(){return 1})));\n}\n\n//CHECK#2\nif ((function(){return 1} | {}) !== 0) {\n $ERROR('#2: (function(){return 1} | {}) === 0. Actual: ' + ((function(){return 1} | {})));\n}\n\n//CHECK#3\nif ((function(){return 1} | function(){return 1}) !== 0) {\n $ERROR('#3: (function(){return 1} | function(){return 1}) === 0. Actual: ' + ((function(){return 1} | function(){return 1})));\n}\n\n//CHECK#4\nif (({} | {}) !== 0) {\n $ERROR('#4: ({} | {}) === 0. Actual: ' + (({} | {})));\n}\n\n",
"id": "S11.10.3_A3_T1.5"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif ((true | 1) !== 1) {\n $ERROR('#1: (true | 1) === 1. Actual: ' + ((true | 1)));\n}\n\n//CHECK#2\nif ((1 | true) !== 1) {\n $ERROR('#2: (1 | true) === 1. Actual: ' + ((1 | true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) | 1) !== 1) {\n $ERROR('#3: (new Boolean(true) | 1) === 1. Actual: ' + ((new Boolean(true) | 1)));\n}\n\n//CHECK#4\nif ((1 | new Boolean(true)) !== 1) {\n $ERROR('#4: (1 | new Boolean(true)) === 1. Actual: ' + ((1 | new Boolean(true))));\n}\n\n//CHECK#5\nif ((true | new Number(1)) !== 1) {\n $ERROR('#5: (true | new Number(1)) === 1. Actual: ' + ((true | new Number(1))));\n}\n\n//CHECK#6\nif ((new Number(1) | true) !== 1) {\n $ERROR('#6: (new Number(1) | true) === 1. Actual: ' + ((new Number(1) | true)));\n}\n\n//CHECK#7\nif ((new Boolean(true) | new Number(1)) !== 1) {\n $ERROR('#7: (new Boolean(true) | new Number(1)) === 1. Actual: ' + ((new Boolean(true) | new Number(1))));\n}\n\n//CHECK#8\nif ((new Number(1) | new Boolean(true)) !== 1) {\n $ERROR('#8: (new Number(1) | new Boolean(true)) === 1. Actual: ' + ((new Number(1) | new Boolean(true))));\n}\n",
"id": "S11.10.3_A3_T2.1"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif ((\"1\" | 1) !== 1) {\n $ERROR('#1: (\"1\" | 1) === 1. Actual: ' + ((\"1\" | 1)));\n}\n\n//CHECK#2\nif ((1 | \"1\") !== 1) {\n $ERROR('#2: (1 | \"1\") === 1. Actual: ' + ((1 | \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") | 1) !== 1) {\n $ERROR('#3: (new String(\"1\") | 1) === 1. Actual: ' + ((new String(\"1\") | 1)));\n}\n\n//CHECK#4\nif ((1 | new String(\"1\")) !== 1) {\n $ERROR('#4: (1 | new String(\"1\")) === 1. Actual: ' + ((1 | new String(\"1\"))));\n}\n\n//CHECK#5\nif ((\"1\" | new Number(1)) !== 1) {\n $ERROR('#5: (\"1\" | new Number(1)) === 1. Actual: ' + ((\"1\" | new Number(1))));\n}\n\n//CHECK#6\nif ((new Number(1) | \"1\") !== 1) {\n $ERROR('#6: (new Number(1) | \"1\") === 1. Actual: ' + ((new Number(1) | \"1\")));\n}\n\n//CHECK#7\nif ((new String(\"1\") | new Number(1)) !== 1) {\n $ERROR('#7: (new String(\"1\") | new Number(1)) === 1. Actual: ' + ((new String(\"1\") | new Number(1))));\n}\n\n//CHECK#8\nif ((new Number(1) | new String(\"1\")) !== 1) {\n $ERROR('#8: (new Number(1) | new String(\"1\")) === 1. Actual: ' + ((new Number(1) | new String(\"1\"))));\n}\n\n//CHECK#9\nif ((\"x\" | 1) !== 1) {\n $ERROR('#9: (\"x\" | 1) === 1. Actual: ' + ((\"x\" | 1)));\n}\n\n//CHECK#10\nif ((1 | \"x\") !== 1) {\n $ERROR('#10: (1 | \"x\") === 1. Actual: ' + ((1 | \"x\")));\n}\n",
"id": "S11.10.3_A3_T2.2"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif ((1 | null) !== 1) {\n $ERROR('#1: (1 | null) === 1. Actual: ' + ((1 | null)));\n}\n\n//CHECK#2\nif ((null | 1) !== 1) {\n $ERROR('#2: (null | 1) === 1. Actual: ' + ((null | 1)));\n}\n\n//CHECK#3\nif ((new Number(1) | null) !== 1) {\n $ERROR('#3: (new Number(1) | null) === 1. Actual: ' + ((new Number(1) | null)));\n}\n\n//CHECK#4\nif ((null | new Number(1)) !== 1) {\n $ERROR('#4: (null | new Number(1)) === 1. Actual: ' + ((null | new Number(1))));\n}\n",
"id": "S11.10.3_A3_T2.3"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((1 | undefined) !== 1) {\n $ERROR('#1: (1 | undefined) === 1. Actual: ' + ((1 | undefined)));\n}\n\n//CHECK#2\nif ((undefined | 1) !== 1) {\n $ERROR('#2: (undefined | 1) === 1. Actual: ' + ((undefined | 1)));\n}\n\n//CHECK#3\nif ((new Number(1) | undefined) !== 1) {\n $ERROR('#3: (new Number(1) | undefined) === 1. Actual: ' + ((new Number(1) | undefined)));\n}\n\n//CHECK#4\nif ((undefined | new Number(1)) !== 1) {\n $ERROR('#4: (undefined | new Number(1)) === 1. Actual: ' + ((undefined | new Number(1))));\n}\n",
"id": "S11.10.3_A3_T2.4"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif ((true | \"1\") !== 1) {\n $ERROR('#1: (true | \"1\") === 1. Actual: ' + ((true | \"1\")));\n}\n\n//CHECK#2\nif ((\"1\" | true) !== 1) {\n $ERROR('#2: (\"1\" | true) === 1. Actual: ' + ((\"1\" | true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) | \"1\") !== 1) {\n $ERROR('#3: (new Boolean(true) | \"1\") === 1. Actual: ' + ((new Boolean(true) | \"1\")));\n}\n\n//CHECK#4\nif ((\"1\" | new Boolean(true)) !== 1) {\n $ERROR('#4: (\"1\" | new Boolean(true)) === 1. Actual: ' + ((\"1\" | new Boolean(true))));\n}\n\n//CHECK#5\nif ((true | new String(\"1\")) !== 1) {\n $ERROR('#5: (true | new String(\"1\")) === 1. Actual: ' + ((true | new String(\"1\"))));\n}\n\n//CHECK#6\nif ((new String(\"1\") | true) !== 1) {\n $ERROR('#6: (new String(\"1\") | true) === 1. Actual: ' + ((new String(\"1\") | true)));\n}\n\n//CHECK#7\nif ((new Boolean(true) | new String(\"1\")) !== 1) {\n $ERROR('#7: (new Boolean(true) | new String(\"1\")) === 1. Actual: ' + ((new Boolean(true) | new String(\"1\"))));\n}\n\n//CHECK#8\nif ((new String(\"1\") | new Boolean(true)) !== 1) {\n $ERROR('#8: (new String(\"1\") | new Boolean(true)) === 1. Actual: ' + ((new String(\"1\") | new Boolean(true))));\n}\n",
"id": "S11.10.3_A3_T2.5"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((\"1\" | undefined) !== 1) {\n $ERROR('#1: (\"1\" | undefined) === 1. Actual: ' + ((\"1\" | undefined)));\n}\n\n//CHECK#2\nif ((undefined | \"1\") !== 1) {\n $ERROR('#2: (undefined | \"1\") === 1. Actual: ' + ((undefined | \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") | undefined) !== 1) {\n $ERROR('#3: (new String(\"1\") | undefined) === 1. Actual: ' + ((new String(\"1\") | undefined)));\n}\n\n//CHECK#4\nif ((undefined | new String(\"1\")) !== 1) {\n $ERROR('#4: (undefined | new String(\"1\")) === 1. Actual: ' + ((undefined | new String(\"1\"))));\n}\n",
"id": "S11.10.3_A3_T2.6"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif ((\"1\" | null) !== 1) {\n $ERROR('#1: (\"1\" | null) === 1. Actual: ' + ((\"1\" | null)));\n}\n\n//CHECK#2\nif ((null | \"1\") !== 1) {\n $ERROR('#2: (null | \"1\") === 1. Actual: ' + ((null | \"1\")));\n}\n\n//CHECK#3\nif ((new String(\"1\") | null) !== 1) {\n $ERROR('#3: (new String(\"1\") | null) === 1. Actual: ' + ((new String(\"1\") | null)));\n}\n\n//CHECK#4\nif ((null | new String(\"1\")) !== 1) {\n $ERROR('#4: (null | new String(\"1\")) === 1. Actual: ' + ((null | new String(\"1\"))));\n}\n",
"id": "S11.10.3_A3_T2.7"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif ((true | undefined) !== 1) {\n $ERROR('#1: (true | undefined) === 1. Actual: ' + ((true | undefined)));\n}\n\n//CHECK#2\nif ((undefined | true) !== 1) {\n $ERROR('#2: (undefined | true) === 1. Actual: ' + ((undefined | true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) | undefined) !== 1) {\n $ERROR('#3: (new Boolean(true) | undefined) === 1. Actual: ' + ((new Boolean(true) | undefined)));\n}\n\n//CHECK#4\nif ((undefined | new Boolean(true)) !== 1) {\n $ERROR('#4: (undefined | new Boolean(true)) === 1. Actual: ' + ((undefined | new Boolean(true))));\n}\n",
"id": "S11.10.3_A3_T2.8"
},
{
"section": "11.10.3",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif ((true | null) !== 1) {\n $ERROR('#1: (true | null) === 1. Actual: ' + ((true | null)));\n}\n\n//CHECK#2\nif ((null | true) !== 1) {\n $ERROR('#2: (null | true) === 1. Actual: ' + ((null | true)));\n}\n\n//CHECK#3\nif ((new Boolean(true) | null) !== 1) {\n $ERROR('#3: (new Boolean(true) | null) === 1. Actual: ' + ((new Boolean(true) | null)));\n}\n\n//CHECK#4\nif ((null | new Boolean(true)) !== 1) {\n $ERROR('#4: (null | new Boolean(true)) === 1. Actual: ' + ((null | new Boolean(true))));\n}\n",
"id": "S11.10.3_A3_T2.9"
}
]
}
}

View File

@ -0,0 +1,104 @@
{
"testCollection": {
"name": "11.11.1_Logical_AND_Operator",
"numTests": 16,
"tests": [
{
"section": "11.11.1",
"description": "Checking by using eval",
"test": "//CHECK#1\nif ((eval(\"true\\u0009&&\\u0009true\")) !== true) {\n $ERROR('#1: (true\\\\u0009&&\\\\u0009true) === true');\n}\n\n//CHECK#2\nif ((eval(\"true\\u000B&&\\u000Btrue\")) !== true) {\n $ERROR('#2: (true\\\\u000B&&\\\\u000Btrue) === true'); \n}\n\n//CHECK#3\nif ((eval(\"true\\u000C&&\\u000Ctrue\")) !== true) {\n $ERROR('#3: (true\\\\u000C&&\\\\u000Ctrue) === true');\n}\n\n//CHECK#4\nif ((eval(\"true\\u0020&&\\u0020true\")) !== true) {\n $ERROR('#4: (true\\\\u0020&&\\\\u0020true) === true');\n}\n\n//CHECK#5\nif ((eval(\"true\\u00A0&&\\u00A0true\")) !== true) {\n $ERROR('#5: (true\\\\u00A0&&\\\\u00A0true) === true');\n}\n\n//CHECK#6\nif ((eval(\"true\\u000A&&\\u000Atrue\")) !== true) {\n $ERROR('#6: (true\\\\u000A&&\\\\u000Atrue) === true'); \n}\n\n//CHECK#7\nif ((eval(\"true\\u000D&&\\u000Dtrue\")) !== true) {\n $ERROR('#7: (true\\\\u000D&&\\\\u000Dtrue) === true');\n}\n\n//CHECK#8\nif ((eval(\"true\\u2028&&\\u2028true\")) !== true) {\n $ERROR('#8: (true\\\\u2028&&\\\\u2028true) === true');\n}\n\n//CHECK#9\nif ((eval(\"true\\u2029&&\\u2029true\")) !== true) {\n $ERROR('#9: (true\\\\u2029&&\\\\u2029true) === true');\n}\n\n\n//CHECK#10\nif ((eval(\"true\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029&&\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\")) !== true) {\n $ERROR('#10: (true\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029&&\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true) === true');\n}\n",
"id": "S11.11.1_A1"
},
{
"section": "11.11.1, 8.7.1",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((false && true) !== false) {\n $ERROR('#1: (false && true) === false');\n}\n\n//CHECK#2\nif ((true && false) !== false) {\n $ERROR('#2: (true && false) === false');\n}\n\n//CHECK#3\nvar x = false;\nif ((x && true) !== false) {\n $ERROR('#3: var x = false; (x && true) === false');\n}\n\n//CHECK#4\nvar y = new Boolean(false);\nif ((true && y) !== y) {\n $ERROR('#4: var y = new Boolean(false); (true && y) === y');\n}\n\n//CHECK#5\nvar x = false;\nvar y = true;\nif ((x && y) !== false) {\n $ERROR('#5: var x = false; var y = true; (x && y) === false');\n}\n\n//CHECK#6\nvar x = true;\nvar y = new Boolean(false);\nif ((x && y) !== y) {\n $ERROR('#6: var x = true; var y = new Boolean(false); (x && y) === y');\n}\n\n//CHECK#7\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = true;\nobjecty.prop = 1.1;\nif ((objectx.prop && objecty.prop) !== objecty.prop) {\n $ERROR('#7: var objectx = new Object(); var objecty = new Object(); objectx.prop = true; objecty.prop = 1; (objectx.prop && objecty.prop) === objecty.prop');\n}\n\n//CHECK#8\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 0;\nobjecty.prop = true;\nif ((objectx.prop && objecty.prop) !== objectx.prop) {\n $ERROR('#8: var objectx = new Object(); var objecty = new Object(); objectx.prop = 0; objecty.prop = true; (objectx.prop && objecty.prop) === objectx.prop');\n}\n",
"id": "S11.11.1_A2.1_T1"
},
{
"section": "11.11.1, 8.7.1",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x && true;\n $ERROR('#1.1: x && true throw ReferenceError. Actual: ' + (x && true)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x && true throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.11.1_A2.1_T2"
},
{
"section": "11.11.1, 8.7.1",
"description": "If ToBoolean(x) is true and GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n true && y;\n $ERROR('#1.1: true && y throw ReferenceError. Actual: ' + (true && y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: true && y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.11.1_A2.1_T3"
},
{
"section": "11.11.1, 8.7.1, 16",
"description": "If ToBoolean(x) is false and GetBase(y) is null, return false",
"test": "//CHECK#1\nif ((false && x) !== false) {\n $ERROR('#1: (false && x) === false');\n}\n",
"id": "S11.11.1_A2.1_T4"
},
{
"section": "11.11.1",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = false; \nif (((x = true) && x) !== true) {\n $ERROR('#1: var x = false; ((x = true) && x) === true');\n}\n\n//CHECK#2\nvar x = false; \nif ((x && (x = true)) !== false) {\n $ERROR('#2: var x = false; (x && (x = true)) === false');\n}\n\n",
"id": "S11.11.1_A2.4_T1"
},
{
"section": "11.11.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() && y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() && y() throw \"x\". Actual: ' + (x() && y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() && y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.11.1_A2.4_T2"
},
{
"section": "11.11.1",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x && (x = true);\n $ERROR('#1.1: x && (x = true) throw ReferenceError. Actual: ' + (x && (x = true))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x && (x = true) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (((y = true) && y) !== true) {\n $ERROR('#2: ((y = true) && y) === true');\n}\n\n",
"id": "S11.11.1_A2.4_T3"
},
{
"section": "11.11.1",
"description": "Type(x) is primitive boolean and Type(y) is changed between primitive boolean and Boolean object",
"test": "//CHECK#1\nif ((false && true) !== false) {\n $ERROR('#1: (false && true) === false');\n}\n\n//CHECK#2\nif ((false && false) !== false) {\n $ERROR('#2: (false && false) === false');\n}\n\n//CHECK#3\nif ((false && new Boolean(true)) !== false) {\n $ERROR('#3: (false && new Boolean(true)) === false');\n}\n\n//CHECK#4\nif ((false && new Boolean(false)) !== false) {\n $ERROR('#4: (false && new Boolean(false)) === false');\n}\n",
"id": "S11.11.1_A3_T1"
},
{
"section": "11.11.1",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif ((-0 && -1) !== 0) {\n $ERROR('#1.1: (-0 && -1) === 0');\n} else {\n if ((1 / (-0 && -1)) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1.2: (-0 && -1) === -0');\n }\n}\n\n//CHECK#2\nif ((0 && new Number(-1)) !== 0) {\n $ERROR('#2.1: (0 && new Number(-1)) === 0');\n} else {\n if ((1 / (0 && new Number(-1))) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: (0 && new Number(-1)) === +0');\n }\n}\n\n//CHECK#3\nif ((isNaN(NaN && 1)) !== true) {\n $ERROR('#3: (NaN && 1) === Not-a-Number');\n}\n",
"id": "S11.11.1_A3_T2"
},
{
"section": "11.11.1",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif ((\"\" && \"1\") !== \"\") {\n $ERROR('#1: (\"\" && \"1\") === \"\"');\n}\n\n//CHECK#2\nif ((\"\" && new String(\"1\")) !== \"\") {\n $ERROR('#2: (\"\" && new String(\"1\")) === \"\"');\n}\n",
"id": "S11.11.1_A3_T3"
},
{
"section": "11.11.1",
"description": "Type(x) or Type(y) is changed between null and undefined",
"test": "//CHECK#1\nif ((undefined && true) !== undefined) {\n $ERROR('#1: (undefined && true) === undefined');\n}\n\n//CHECK#2\nif ((null && false) !== null) {\n $ERROR('#2: (null && false) === null');\n}\n",
"id": "S11.11.1_A3_T4"
},
{
"section": "11.11.1",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif ((true && true) !== true) {\n $ERROR('#1: (true && true) === true');\n}\n\n//CHECK#2\nif ((true && false) !== false) {\n $ERROR('#2: (true && false) === false');\n}\n\n//CHECK#3\nvar y = new Boolean(true);\nif ((new Boolean(true) && y) !== y) {\n $ERROR('#3: (var y = new Boolean(true); (new Boolean(true) && y) === y');\n}\n\n//CHECK#4\nvar y = new Boolean(false);\nif ((new Boolean(true) && y) !== y) {\n $ERROR('#4: (var y = new Boolean(false); (new Boolean(true) && y) === y');\n}\n\n//CHECK#5\nvar y = new Boolean(true);\nif ((new Boolean(false) && y) !== y) {\n $ERROR('#5: (var y = new Boolean(true); (new Boolean(false) && y) === y');\n}\n\n//CHECK#6\nvar y = new Boolean(false);\nif ((new Boolean(false) && y) !== y) {\n $ERROR('#6: (var y = new Boolean(false); (new Boolean(false) && y) === y');\n}\n",
"id": "S11.11.1_A4_T1"
},
{
"section": "11.11.1",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif ((-1 && -0) !== 0) {\n $ERROR('#1.1: (-1 && -0) === 0');\n} else {\n if ((1 / (-1 && -0)) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1.2: (-1 && -0) === -0');\n }\n}\n\n//CHECK#2\nif ((-1 && 0) !== 0) {\n $ERROR('#2.1: (-1 && 0) === 0');\n} else {\n if ((1 / (-1 && 0)) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: (-1 && 0) === +0');\n }\n}\n\n//CHECK#3\nif ((isNaN(0.1 && NaN)) !== true) {\n $ERROR('#3: (0.1 && NaN) === Not-a-Number');\n}\n\n//CHECK#4\nvar y = new Number(0);\nif ((new Number(-1) && y) !== y) {\n $ERROR('#4: (var y = new Number(0); (new Number(-1) && y) === y');\n}\n\n//CHECK#5\nvar y = new Number(NaN);\nif ((new Number(0) && y) !== y) {\n $ERROR('#5: (var y = new Number(NaN); (new Number(0) && y) === y');\n}\n\n//CHECK#6\nvar y = new Number(-1);\nif ((new Number(NaN) && y) !== y) {\n $ERROR('#6: (var y = new Number(-1); (new Number(NaN) && y) === y');\n}\n",
"id": "S11.11.1_A4_T2"
},
{
"section": "11.11.1",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif ((\"0\" && \"-1\") !== \"-1\") {\n $ERROR('#-1: (\"0\" && \"-1\") === \"-1\"');\n}\n\n//CHECK#2\nif ((\"-1\" && \"x\") !== \"x\") {\n $ERROR('#2: (\"-1\" && \"x\") === \"x\"');\n}\n\n//CHECK#3\nvar y = new String(-1);\nif ((new String(\"-1\") && y) !== y) {\n $ERROR('#3: (var y = new String(-1); (new String(\"-1\") && y) === y');\n}\n\n//CHECK#4\nvar y = new String(NaN);\nif ((new String(\"0\") && y) !== y) {\n $ERROR('#4: (var y = new String(NaN); (new String(\"0\") && y) === y');\n}\n\n//CHECK#5\nvar y = new String(\"-x\");\nif ((new String(\"x\") && y) !== y) {\n $ERROR('#5: (var y = new String(\"-x\"); (new String(\"x\") && y) === y');\n}\n\n//CHECK#6\nvar y = new String(-1);\nif ((new String(NaN) && y) !== y) {\n $ERROR('#6: (var y = new String(-1); (new String(NaN) && y) === y');\n}\n",
"id": "S11.11.1_A4_T3"
},
{
"section": "11.11.1",
"description": "Type(x) or Type(y) is changed between null and undefined",
"test": "//CHECK#1\nif ((true && undefined) !== undefined) {\n $ERROR('#1: (true && undefined) === undefined');\n}\n\n//CHECK#2\nif ((true && null) !== null) {\n $ERROR('#2: (true && null) === null');\n}\n",
"id": "S11.11.1_A4_T4"
}
]
}
}

View File

@ -0,0 +1,104 @@
{
"testCollection": {
"name": "11.11.2_Logical_OR_Operator",
"numTests": 16,
"tests": [
{
"section": "11.11.2",
"description": "Checking by using eval",
"test": "//CHECK#1\nif ((eval(\"false\\u0009||\\u0009true\")) !== true) {\n $ERROR('#1: (false\\\\u0009||\\\\u0009true) === true');\n}\n\n//CHECK#2\nif ((eval(\"false\\u000B||\\u000Btrue\")) !== true) {\n $ERROR('#2: (false\\\\u000B||\\\\u000Btrue) === true'); \n}\n\n//CHECK#3\nif ((eval(\"false\\u000C||\\u000Ctrue\")) !== true) {\n $ERROR('#3: (false\\\\u000C||\\\\u000Ctrue) === true');\n}\n\n//CHECK#4\nif ((eval(\"false\\u0020||\\u0020true\")) !== true) {\n $ERROR('#4: (false\\\\u0020||\\\\u0020true) === true');\n}\n\n//CHECK#5\nif ((eval(\"false\\u00A0||\\u00A0true\")) !== true) {\n $ERROR('#5: (false\\\\u00A0||\\\\u00A0true) === true');\n}\n\n//CHECK#6\nif ((eval(\"false\\u000A||\\u000Atrue\")) !== true) {\n $ERROR('#6: (false\\\\u000A||\\\\u000Atrue) === true'); \n}\n\n//CHECK#7\nif ((eval(\"false\\u000D||\\u000Dtrue\")) !== true) {\n $ERROR('#7: (false\\\\u000D||\\\\u000Dtrue) === true');\n}\n\n//CHECK#8\nif ((eval(\"false\\u2028||\\u2028true\")) !== true) {\n $ERROR('#8: (false\\\\u2028||\\\\u2028true) === true');\n}\n\n//CHECK#9\nif ((eval(\"false\\u2029||\\u2029true\")) !== true) {\n $ERROR('#9: (false\\\\u2029||\\\\u2029true) === true');\n}\n\n\n//CHECK#10\nif ((eval(\"false\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029||\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\")) !== true) {\n $ERROR('#10: (false\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029||\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true) === true');\n}\n",
"id": "S11.11.2_A1"
},
{
"section": "11.11.2, 8.7.1",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((true || false) !== true) {\n $ERROR('#1: (true || false) === true');\n}\n\n//CHECK#2\nif ((false || true) !== true) {\n $ERROR('#2: (false || true) === true');\n}\n\n//CHECK#3\nvar x = new Boolean(false);\nif ((x || true) !== x) {\n $ERROR('#3: var x = Boolean(false); (x || true) === x');\n}\n\n//CHECK#4\nvar y = new Boolean(true);\nif ((false || y) !== y) {\n $ERROR('#4: var y = Boolean(true); (false || y) === y');\n}\n\n//CHECK#5\nvar x = new Boolean(false);\nvar y = new Boolean(true);\nif ((x || y) !== x) {\n $ERROR('#5: var x = new Boolean(false); var y = new Boolean(true); (x || y) === x');\n}\n\n//CHECK#6\nvar x = false;\nvar y = new Boolean(true);\nif ((x || y) !== y) {\n $ERROR('#6: var x = false; var y = new Boolean(true); (x || y) === y');\n}\n\n//CHECK#7\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = false;\nobjecty.prop = 1.1;\nif ((objectx.prop || objecty.prop) !== objecty.prop) {\n $ERROR('#7: var objectx = new Object(); var objecty = new Object(); objectx.prop = false; objecty.prop = 1; (objectx.prop || objecty.prop) === objecty.prop');\n}\n\n//CHECK#8\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1.1;\nobjecty.prop = false;\nif ((objectx.prop || objecty.prop) !== objectx.prop) {\n $ERROR('#8: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1.1; objecty.prop = false; (objectx.prop || objecty.prop) === objectx.prop');\n}\n",
"id": "S11.11.2_A2.1_T1"
},
{
"section": "11.11.2, 8.7.1",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x || true;\n $ERROR('#1.1: x || true throw ReferenceError. Actual: ' + (x || true)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x || true throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.11.2_A2.1_T2"
},
{
"section": "11.11.2, 8.7.1",
"description": "If ToBoolean(x) is false and GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n false || y;\n $ERROR('#1.1: false || y throw ReferenceError. Actual: ' + (false || y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: false || y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.11.2_A2.1_T3"
},
{
"section": "11.11.2, 8.7.1, 16",
"description": "If ToBoolean(x) is true and GetBase(y) is null, return true",
"test": "//CHECK#1\nif ((true || x) !== true) {\n $ERROR('#1: (true || x) === true');\n}\n",
"id": "S11.11.2_A2.1_T4"
},
{
"section": "11.11.2",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = true; \nif (((x = false) || x) !== false) {\n $ERROR('#1: var x = true; ((x = false) || x) === false');\n}\n\n//CHECK#2\nvar x = true; \nif ((x || (x = false)) !== true) {\n $ERROR('#2: var x = true; (x || (x = false)) === true');\n}\n",
"id": "S11.11.2_A2.4_T1"
},
{
"section": "11.11.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() || y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() || y() throw \"x\". Actual: ' + (x() || y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() || y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.11.2_A2.4_T2"
},
{
"section": "11.11.2",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x || (x = true);\n $ERROR('#1.1: x || (x = true) throw ReferenceError. Actual: ' + (x || (x = true))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x || (x = true) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (((y = true) || y) !== true) {\n $ERROR('#2: ((y = true) || y) === true');\n}\n\n",
"id": "S11.11.2_A2.4_T3"
},
{
"section": "11.11.2",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif ((false || true) !== true) {\n $ERROR('#1: (false || true) === true');\n}\n\n//CHECK#2\nif ((false || false) !== false) {\n $ERROR('#2: (false || false) === false');\n}\n\n//CHECK#3\nvar y = new Boolean(true);\nif ((false || y) !== y) {\n $ERROR('#3: (var y = new Boolean(true); false || y) === y');\n}\n\n//CHECK#4\nvar y = new Boolean(false);\nif ((false || y) !== y) {\n $ERROR('#4: (var y = new Boolean(false); false || y) === y');\n}\n",
"id": "S11.11.2_A3_T1"
},
{
"section": "11.11.2",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif ((0 || -0) !== 0) {\n $ERROR('#1.1: (0 || -0) === 0');\n} else {\n if ((1 / (0 || -0)) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1.2: (0 || -0) === -0');\n }\n}\n\n//CHECK#2\nif ((-0 || 0) !== 0) {\n $ERROR('#2.1: (-0 || 0) === 0');\n} else {\n if ((1 / (-0 || 0)) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: (-0 || 0) === +0');\n }\n}\n\n//CHECK#3\nvar y = new Number(-1);\nif ((0 || y) !== y) {\n $ERROR('#3: (var y = new Number(-1); 0 || y) === y');\n} \n\n//CHECK#4\nvar y = new Number(0);\nif ((NaN || y) !== y) {\n $ERROR('#4: (var y = new Number(0); NaN || y) === y');\n}\n",
"id": "S11.11.2_A3_T2"
},
{
"section": "11.11.2",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif ((\"\" || \"1\") !== \"1\") {\n $ERROR('#1: (\"\" || \"1\") === \"1\"');\n}\n\n//CHECK#2\nvar y = new String(\"1\");\nif ((\"\" || y) !== y) {\n $ERROR('#2: (var y = new String(\"1\"); \"\" || y) === y');\n}\n",
"id": "S11.11.2_A3_T3"
},
{
"section": "11.11.2",
"description": "Type(x) or Type(y) is changed between null and undefined",
"test": "//CHECK#1\nif ((false || undefined) !== undefined) {\n $ERROR('#1: (false || undefined) === undefined');\n}\n\n//CHECK#2\nif ((false || null) !== null) {\n $ERROR('#2: (false || null) === null');\n}\n",
"id": "S11.11.2_A3_T4"
},
{
"section": "11.11.2",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (((true || true)) !== true) {\n $ERROR('#1: (true || true) === true');\n}\n\n//CHECK#2\nif ((true || false) !== true) {\n $ERROR('#2: (true || false) === true');\n}\n\n//CHECK#3\nvar x = new Boolean(true);\nif ((x || new Boolean(true)) !== x) {\n $ERROR('#3: (var x = new Boolean(true); (x || new Boolean(true)) === x');\n}\n\n//CHECK#4\nvar x = new Boolean(true);\nif ((x || new Boolean(false)) !== x) {\n $ERROR('#4: (var x = new Boolean(true); (x || new Boolean(false)) === x');\n}\n\n//CHECK#5\nvar x = new Boolean(false);\nif ((x || new Boolean(true)) !== x) {\n $ERROR('#5: (var x = new Boolean(false); (x || new Boolean(true)) === x');\n}\n\n//CHECK#6\nvar x = new Boolean(false);\nif ((x || new Boolean(false)) !== x) {\n $ERROR('#6: (var x = new Boolean(false); (x || new Boolean(false)) === x');\n}\n",
"id": "S11.11.2_A4_T1"
},
{
"section": "11.11.2",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif ((-1 || 1) !== -1) {\n $ERROR('#1: (-1 || 1) === -1');\n}\n\n//CHECK#2\nif ((1 || new Number(0)) !== 1) {\n $ERROR('#2: (1 || new Number(0)) === 1');\n} \n\n//CHECK#3\nif ((-1 || NaN) !== -1) {\n $ERROR('#3: (-1 || NaN) === -1');\n}\n\n//CHECK#4\nvar x = new Number(-1);\nif ((x || new Number(0)) !== x) {\n $ERROR('#4: (var x = new Number(-1); (x || new Number(-1)) === x');\n}\n\n//CHECK#5\nvar x = new Number(NaN);\nif ((x || new Number(1)) !== x) {\n $ERROR('#5: (var x = new Number(NaN); (x || new Number(1)) === x');\n}\n\n//CHECK#6\nvar x = new Number(0);\nif ((x || new Number(NaN)) !== x) {\n $ERROR('#6: (var x = new Number(0); (x || new Number(NaN)) === x');\n}\n",
"id": "S11.11.2_A4_T2"
},
{
"section": "11.11.2",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif ((\"-1\" || \"1\") !== \"-1\") {\n $ERROR('#-1: (\"-1\" || \"1\") === \"-1\"');\n}\n\n//CHECK#2\nif ((\"-1\" || \"x\") !== \"-1\") {\n $ERROR('#2: (\"-1\" || \"x\") === \"-1\"');\n}\n\n//CHECK#3\nvar x = new String(\"-1\");\nif ((x || new String(-1)) !== x) {\n $ERROR('#3: (var x = new String(\"-1\"); (x || new String(-1)) === x');\n}\n\n//CHECK#4\nvar x = new String(NaN);\nif ((x || new String(\"1\")) !== x) {\n $ERROR('#4: (var x = new String(NaN); (x || new String(\"1\")) === x');\n}\n\n//CHECK#5\nvar x = new String(\"-x\");\nif ((x || new String(\"x\")) !== x) {\n $ERROR('#5: (var x = new String(\"-x\"); (x || new String(\"x\")) === x');\n}\n\n//CHECK#6\nvar x = new String(0);\nif ((x || new String(NaN)) !== x) {\n $ERROR('#6: (var x = new String(0); (x || new String(NaN)) === x');\n}\n",
"id": "S11.11.2_A4_T3"
},
{
"section": "11.11.2",
"description": "Type(x) or Type(y) vary between Null and Undefined",
"test": "//CHECK#1\nif ((true || undefined) !== true) {\n $ERROR('#1: (true || undefined) === true');\n}\n\n//CHECK#2\nif ((true || null) !== true) {\n $ERROR('#2: (true || null) === true');\n}\n",
"id": "S11.11.2_A4_T4"
}
]
}
}

View File

@ -0,0 +1,98 @@
{
"testCollection": {
"name": "11.12_Conditional_Operator",
"numTests": 15,
"tests": [
{
"section": "11.12",
"description": "Checking by using eval",
"test": "//CHECK#1\nif ((eval(\"false\\u0009?\\u0009true\\u0009:\\u0009true\")) !== true) {\n $ERROR('#1: (false\\\\u0009?\\\\u0009true\\\\u0009:\\\\u0009true) === true');\n}\n\n//CHECK#2\nif ((eval(\"false\\u000B?\\u000Btrue\\u000B:\\u000Btrue\")) !== true) {\n $ERROR('#2: (false\\\\u000B?\\\\u000Btrue\\\\u000B:\\\\u000Btrue) === true');\n}\n\n//CHECK#3\nif ((eval(\"false\\u000C?\\u000Ctrue\\u000C:\\u000Ctrue\")) !== true) {\n $ERROR('#3: (false\\\\u000C?\\\\u000Ctrue\\\\u000C:\\\\u000Ctrue) === true');\n}\n\n//CHECK#4\nif ((eval(\"false\\u0020?\\u0020true\\u0020:\\u0020true\")) !== true) {\n $ERROR('#4: (false\\\\u0020?\\\\u0020true\\\\u0020:\\\\u0020true) === true');\n}\n\n//CHECK#5\nif ((eval(\"false\\u00A0?\\u00A0true\\u00A0:\\u00A0true\")) !== true) {\n $ERROR('#5: (false\\\\u00A0?\\\\u00A0true\\\\u00A0:\\\\u00A0true) === true');\n}\n\n//CHECK#6\nif ((eval(\"false\\u000A?\\u000Atrue\\u000A:\\u000Atrue\")) !== true) {\n $ERROR('#6: (false\\\\u000A?\\\\u000Atrue\\\\u000A:\\\\u000Atrue) === true');\n}\n\n//CHECK#7\nif ((eval(\"false\\u000D?\\u000Dtrue\\u000D:\\u000Dtrue\")) !== true) {\n $ERROR('#7: (false\\\\u000D?\\\\u000Dtrue\\\\u000D:\\\\u000Dtrue) === true');\n}\n\n//CHECK#8\nif ((eval(\"false\\u2028?\\u2028true\\u2028:\\u2028true\")) !== true) {\n $ERROR('#8: (false\\\\u2028?\\\\u2028true\\\\u2028:\\\\u2028true) === true');\n}\n\n//CHECK#9\nif ((eval(\"false\\u2029?\\u2029true\\u2029:\\u2029true\")) !== true) {\n $ERROR('#9: (false\\\\u2029?\\\\u2029true\\\\u2029:\\\\u2029true) === true');\n}\n\n//CHECK#10\nif ((eval(\"false\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029?\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029:\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\")) !== true) {\n $ERROR('#10: (false\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029?\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029:\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true) === true');\n}\n",
"id": "S11.12_A1"
},
{
"section": "11.12, 8.7.1",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((true ? false : true) !== false) {\n $ERROR('#1: (true ? false : true) === false');\n}\n\n//CHECK#2\nif ((false ? false : true) !== true) {\n $ERROR('#2: (false ? false : true) === true');\n}\n\n//CHECK#3\nvar x = new Boolean(true);\nvar y = new Boolean(false);\nif ((x ? y : true) !== y) {\n $ERROR('#3: var x = new Boolean(true); var y = new Boolean(false); (x ? y : true) === y');\n}\n\n//CHECK#4\nvar z = new Boolean(true);\nif ((false ? false : z) !== z) {\n $ERROR('#4: var z = new Boolean(true); (false ? false : z) === z');\n}\n\n//CHECK#5\nvar x = new Boolean(true);\nvar y = new Boolean(false);\nvar z = new Boolean(true);\nif ((x ? y : z) !== y) {\n $ERROR('#5: var x = new Boolean(true); var y = new Boolean(false); var z = new Boolean(true); (x ? y : z) === y');\n}\n\n//CHECK#6\nvar x = false;\nvar y = new Boolean(false);\nvar z = new Boolean(true);\nif ((x ? y : z) !== z) {\n $ERROR('#6: var x = false; var y = new Boolean(false); var z = new Boolean(true); (x ? y : z) === z');\n}\n",
"id": "S11.12_A2.1_T1"
},
{
"section": "11.12, 8.7.1",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x ? true : false;\n $ERROR('#1.1: x ? true : false throw ReferenceError. Actual: ' + (x ? true : false)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x ? true : false throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.12_A2.1_T2"
},
{
"section": "11.12, 8.7.1",
"description": "If ToBoolean(x) is true and GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n true ? y : false;\n $ERROR('#1.1: true ? y : false throw ReferenceError. Actual: ' + (true ? y : false)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: true ? y : false throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.12_A2.1_T3"
},
{
"section": "11.12, 8.7.1",
"description": "If ToBoolean(x) is false and GetBase(z) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n false ? true : z;\n $ERROR('#1.1: false ? true : z throw ReferenceError. Actual: ' + (false ? true : z)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: false ? true : z throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.12_A2.1_T4"
},
{
"section": "11.12, 8.7.1, 16",
"description": "If ToBoolean(x) is true and GetBase(z) is null, return y",
"test": "//CHECK#1\nvar y = new Object();\nif ((true ? y : z) !== y) {\n $ERROR('#1: var y = new Object(); (true ? y : z) === y');\n}\n",
"id": "S11.12_A2.1_T5"
},
{
"section": "11.12, 8.7.1, 16",
"description": "If ToBoolean(x) is false and GetBase(y) is null, return z",
"test": "//CHECK#1\nvar z = new Object();\nif ((false ? y : z) !== z) {\n $ERROR('#1: var z = new Object(); (false ? y : z) === z');\n}\n",
"id": "S11.12_A2.1_T6"
},
{
"section": "11.12",
"description": "Type(y) and Type(z) are boolean primitives",
"test": "//CHECK#1\nif ((false ? false : true) !== true) {\n $ERROR('#1: (false ? false : true) === true');\n}\n\n//CHECK#2\nvar z = new Boolean(true);\nif ((false ? true : z) !== z) {\n $ERROR('#2: (var y = new Boolean(true); (false ? true : z) === z');\n}\n",
"id": "S11.12_A3_T1"
},
{
"section": "11.12",
"description": "Type(y) and Type(z) are number primitives",
"test": "//CHECK#1\nif ((0 ? 0 : 1) !== 1) {\n $ERROR('#1: (0 ? 0 : 1) === 1');\n}\n\n//CHECK#2\nvar z = new Number(1);\nif ((0 ? 1 : z) !== z) {\n $ERROR('#2: (var y = new Number(1); (0 ? 1 : z) === z');\n}\n",
"id": "S11.12_A3_T2"
},
{
"section": "11.12",
"description": "Type(y) and Type(z) are string primitives",
"test": "//CHECK#1\nif ((\"\" ? \"\" : \"1\") !== \"1\") {\n $ERROR('#1: (\"\" ? \"\" : \"1\") === \"1\"');\n}\n\n//CHECK#2\nvar z = new String(\"1\");\nif ((\"\" ? \"1\" : z) !== z) {\n $ERROR('#2: (var y = new String(\"1\"); (\"\" ? \"1\" : z) === z');\n}\n",
"id": "S11.12_A3_T3"
},
{
"section": "11.12",
"description": "Type(x) or Type(y) is changed between null and undefined",
"test": "//CHECK#1\nif ((false ? true : undefined) !== undefined) {\n $ERROR('#1: (false ? true : undefined) === undefined');\n}\n\n//CHECK#2\nif ((false ? true : null) !== null) {\n $ERROR('#2: (false ? true : null) === null');\n}\n",
"id": "S11.12_A3_T4"
},
{
"section": "11.12",
"description": "Type(y) and Type(z) are boolean primitives",
"test": "//CHECK#1\nif ((true ? false : true) !== false) {\n $ERROR('#1: (true ? false : true) === false');\n}\n\n//CHECK#2\nvar y = new Boolean(true);\nif ((true ? y : false) !== y) {\n $ERROR('#2: (var y = new Boolean(true); (true ? y : false) === y');\n}\n\n//CHECK#3\nvar y = new Boolean(false);\nif ((y ? y : true) !== y) {\n $ERROR('#3: (var y = new Boolean(false); (y ? y : true) === y');\n}\n",
"id": "S11.12_A4_T1"
},
{
"section": "11.12",
"description": "Type(y) and Type(z) are number primitives",
"test": "//CHECK#1\nif ((1 ? 0 : 1) !== 0) {\n $ERROR('#1: (1 ? 0 : 1) === 0');\n}\n\n//CHECK#2\nvar y = new Number(1);\nif ((1 ? y : 0) !== y) {\n $ERROR('#2: (var y = new Number(1); (1 ? y : 0) === y');\n}\n\n//CHECK#3\nvar y = new Number(NaN);\nif ((y ? y : 1) !== y) {\n $ERROR('#3: (var y = new Number(NaN); (y ? y : 1) === y');\n}\n",
"id": "S11.12_A4_T2"
},
{
"section": "11.12",
"description": "Type(y) and Type(z) are string primitives",
"test": "//CHECK#1\nif ((\"1\" ? \"\" : \"1\") !== \"\") {\n $ERROR('#1: (\"1\" ? \"\" : \"1\") === \"\"');\n}\n\n//CHECK#2\nvar y = new String(\"1\");\nif ((\"1\" ? y : \"\") !== y) {\n $ERROR('#2: (var y = new String(\"1\"); (\"1\" ? y : \"\") === y');\n}\n\n//CHECK#3\nvar y = new String(\"y\");\nif ((y ? y : \"1\") !== y) {\n $ERROR('#3: (var y = new String(\"y\"); (y ? y : \"1\") === y');\n}\n",
"id": "S11.12_A4_T3"
},
{
"section": "11.12",
"description": "Type(x) or Type(y) is changed between null and undefined",
"test": "//CHECK#1\nif ((true ? undefined : true) !== undefined) {\n $ERROR('#1: (true ? undefined : true) === undefined');\n}\n\n//CHECK#2\nif ((true ? null : true) !== null) {\n $ERROR('#2: (true ? null : true) === null');\n}\n",
"id": "S11.12_A4_T4"
}
]
}
}

View File

@ -0,0 +1,118 @@
{
"testCollection": {
"name": "11.13.1",
"numTests": 15,
"tests": [
{
"id": "11.13.1-1-1",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-1-1.js",
"description": "simple assignment throws ReferenceError if LeftHandSide is not a reference (number)",
"test": "assertTrue((function testcase() {\n try {\n eval(\"42 = 42\");\n }\n catch (e) {\n if (e instanceof ReferenceError) {\n return true;\n }\n }\n }).call(this));\n"
},
{
"id": "11.13.1-1-2",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-1-2.js",
"description": "simple assignment throws ReferenceError if LeftHandSide is not a reference (string)",
"test": "assertTrue((function testcase() {\n try {\n eval(\"'x' = 42\");\n }\n catch (e) {\n if (e instanceof ReferenceError) {\n return true;\n }\n }\n }).call(this));\n"
},
{
"id": "11.13.1-1-3",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-1-3.js",
"description": "simple assignment throws ReferenceError if LeftHandSide is not a reference (boolean)",
"test": "assertTrue((function testcase() {\n try {\n eval(\"true = 42\");\n }\n catch (e) {\n if (e instanceof ReferenceError) {\n return true;\n }\n }\n }).call(this));\n"
},
{
"id": "11.13.1-1-4",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-1-4.js",
"description": "simple assignment throws ReferenceError if LeftHandSide is not a reference (null)",
"test": "assertTrue((function testcase() {\n try {\n eval(\"null = 42\");\n }\n catch (e) {\n if (e instanceof ReferenceError) {\n return true;\n }\n }\n }).call(this));\n"
},
{
"id": "11.13.1-1-6-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-1-6-s.js",
"description": "simple assignment throws ReferenceError if LeftHandSide is an unresolvable reference in strict mode (base obj undefined)",
"test": "assertTrue((function testcase() {\n 'use strict';\n \n try {\n __ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42;\n return false;\n }\n catch (e) {\n return (e instanceof ReferenceError);\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.1-1-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-1-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a data property with the attribute value {[[Writable]]:false} under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop = 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-2-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-2-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to an accessor property with the attribute value {[[Set]]:undefined} under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop = 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-3-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-3-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a non-existent property of an object whose [[Extensible]] internal property has the value false under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len = 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-4-1",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-4-1.js",
"description": "simple assignment creates property on the global object if LeftHandSide is an unresolvable reference",
"test": "assertTrue((function testcase() {\n function foo() {\n __ES3_1_test_suite_test_11_13_1_unique_id_3__ = 42;\n }\n foo();\n\n var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), '__ES3_1_test_suite_test_11_13_1_unique_id_3__');\n if (desc.value === 42 &&\n desc.writable === true &&\n desc.enumerable === true &&\n desc.configurable === true) {\n delete __ES3_1_test_suite_test_11_13_1_unique_id_3__;\n return true;\n } \n }).call(this));\n",
"precondition": "(fnExists(Object.getOwnPropertyDescriptor))"
},
{
"id": "11.13.1-4-14-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-4-14-s.js",
"description": "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Number.MAX_VALUE)",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n Number.MAX_VALUE = 42;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-4-27-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-4-27-s.js",
"description": "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.undefined)",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n fnGlobalObject().undefined = 42;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-4-28-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-4-28-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears as the LeftHandSideExpression of simple assignment(=) under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"var eval = 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-4-29-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-4-29-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears as the LeftHandSideExpression of simple assignment(=) under strict mode",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"var arguments = 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-4-3-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-4-3-s.js",
"description": "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.Infinity)",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n fnGlobalObject().Infinity = 42;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.1-4-6-s",
"path": "TestCases/chapter11/11.13/11.13.1/11.13.1-4-6-s.js",
"description": "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Function.length)",
"test": "assertTrue((function testcase() {\n 'use strict';\n \n try {\n Function.length = 42;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,57 @@
{
"testCollection": {
"name": "11.13.1_Simple_Assignment",
"numTests": 8,
"tests": [
{
"section": "11.13.1",
"description": "Checking by using eval",
"test": "//CHECK#1\nif ((eval(\"x\\u0009=\\u0009true\")) !== true) {\n $ERROR('#1: (x\\\\u0009=\\\\u0009true) === true');\n}\n\n//CHECK#2\nif ((eval(\"x\\u000B=\\u000Btrue\")) !== true) {\n $ERROR('#2: (x\\\\u000B=\\\\u000Btrue) === true'); \n}\n\n//CHECK#3\nif ((eval(\"x\\u000C=\\u000Ctrue\")) !== true) {\n $ERROR('#3: (x\\\\u000C=\\\\u000Ctrue) === true');\n}\n\n//CHECK#4\nif ((eval(\"x\\u0020=\\u0020true\")) !== true) {\n $ERROR('#4: (x\\\\u0020=\\\\u0020true) === true');\n}\n\n//CHECK#5\nif ((eval(\"x\\u00A0=\\u00A0true\")) !== true) {\n $ERROR('#5: (x\\\\u00A0=\\\\u00A0true) === true');\n}\n\n//CHECK#6\nif ((eval(\"x\\u000A=\\u000Atrue\")) !== true) {\n $ERROR('#6: (x\\\\u000A=\\\\u000Atrue) === true'); \n}\n\n//CHECK#7\nif ((eval(\"x\\u000D=\\u000Dtrue\")) !== true) {\n $ERROR('#7: (x\\\\u000D=\\\\u000Dtrue) === true');\n}\n\n//CHECK#8\nif ((eval(\"x\\u2028=\\u2028true\")) !== true) {\n $ERROR('#8: (x\\\\u2028=\\\\u2028true) === true');\n}\n\n//CHECK#9\nif ((eval(\"x\\u2029=\\u2029true\")) !== true) {\n $ERROR('#9: (x\\\\u2029=\\\\u2029true) === true');\n}\n\n\n//CHECK#10\nif ((eval(\"x\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029=\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\")) !== true) {\n $ERROR('#10: (x\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029=\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true) === true');\n}\n",
"id": "S11.13.1_A1"
},
{
"section": "11.13.1",
"description": "Either AssigmentExpression is not Reference or GetBase is not null",
"test": "//CHECK#1\nx = 1;\nif (x !== 1) {\n $ERROR('#1: x = 1; x === 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = 1;\nif (x !== 1) {\n $ERROR('#2: var x = 1; x === 1. Actual: ' + (x));\n}\n\n//CHECK#3\ny = 1;\nx = y;\nif (x !== 1) {\n $ERROR('#3: y = 1; x = y; x === 1. Actual: ' + (x));\n}\n\n//CHECK#4\nvar y = 1;\nvar x = y;\nif (x !== 1) {\n $ERROR('#4: var y = 1; var x = y; x === 1. Actual: ' + (x));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjecty.prop = 1.1;\nobjectx.prop = objecty.prop;\nif (objectx.prop !== objecty.prop) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx.prop === objecty.prop. Actual: ' + (objectx.prop));\n} else {\n if (objectx === objecty) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx !== objecty');\n } \n}\n\n",
"id": "S11.13.1_A2.1_T1"
},
{
"section": "11.13.1",
"description": "If GetBase(AssigmentExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x = y;\n $ERROR('#1.1: x = y throw ReferenceError. Actual: ' + (x = y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x = y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.13.1_A2.1_T2"
},
{
"section": "11.13.1, 16",
"description": "If Type(LeftHandSideExpression) is not Reference, throw ReferenceError (or SyntaxError)",
"negative": "",
"test": "//CHECK#1\ntry {\n 1 = 1;\n $ERROR('#1.1: 1 = 1 throw ReferenceError (or SyntaxError). Actual: ' + (1 = 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 = 1 throw ReferenceError (or SyntaxError). Actual: ' + (e)); \n } else {\n 1 = 1;\n }\n}\n",
"id": "S11.13.1_A2.1_T3"
},
{
"section": "11.13.1",
"description": "Checking Expression and Variable statements",
"test": "//CHECK#1\nvar x = 1;\nif (x !== 1) {\n $ERROR('#1: var x = 1; x === 1. Actual: ' + (x));\n}\n\n//CHECK#2\ny = 1;\nif (y !== 1) {\n $ERROR('#2: y = 1; y === 1. Actual: ' + (y));\n}\n",
"id": "S11.13.1_A3.1"
},
{
"section": "11.13.1",
"description": "Checking Expression and Variable statements",
"test": "//CHECK#1\nvar x = 0;\nif ((x = 1) !== 1) {\n $ERROR('#1: var x = 0; (x = 1) === 1. Actual: ' + ((x = 1)));\n}\n\n//CHECK#2\nx = 0;\nif ((x = 1) !== 1) {\n $ERROR('#2: x = 0; (x = 1) === 1. Actual: ' + ((x = 1)));\n}\n",
"id": "S11.13.1_A3.2"
},
{
"section": "11.13.1",
"description": "Syntax check",
"test": "//CHECK#1\nx = x = 1;\nif (x !== 1) {\n $ERROR('#1: The expression x = x = 1 is the same x = (x = 1), not (x = x) = 1. Actual: ' + (x));\n}\n\n\n",
"id": "S11.13.1_A4_T1"
},
{
"section": "11.13.1",
"description": "Syntax check if \"x = x\" throws ReferenceError",
"test": "//CHECK#1\ntry {\n x = x;\n $ERROR('#1.1: x = x throw ReferenceError. Actual: ' + (x = x));\n} catch(e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x = x throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n\n",
"id": "S11.13.1_A4_T2"
}
]
}
}

View File

@ -0,0 +1,604 @@
{
"testCollection": {
"name": "11.13.2",
"numTests": 77,
"tests": [
{
"id": "11.13.2-1-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-1-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(*=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_1 *= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-10-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-10-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(^=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_10 ^= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-11-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-11-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(|=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_11 |= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-12-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-12-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(*=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_12 = 5\n _11_13_2_12 *= 2;\n return _11_13_2_12 === 10;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-13-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-13-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(/=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_13 = 6\n _11_13_2_13 /= 2;\n return _11_13_2_13 === 3;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-14-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-14-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(%=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_14 = 5\n _11_13_2_14 %= 2;\n return _11_13_2_14 === 1;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-15-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-15-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(>>>=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_15 = 8\n _11_13_2_15 >>>= 2;\n return _11_13_2_15 === 2;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-16-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-16-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(-=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_16 = 5\n _11_13_2_16 -= 2;\n return _11_13_2_16 === 3;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-17-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-17-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(<<=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_17 = 1;\n _11_13_2_17 <<= 2;\n return _11_13_2_17 === 4;\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-18-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-18-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(>>=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_18 = 4\n _11_13_2_18 >>= 2;\n return _11_13_2_18 === 1;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-19-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-19-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(+=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_19 = -1\n _11_13_2_19 += 10;\n return _11_13_2_19 === 9;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-2-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-2-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(/=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_2 /= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-20-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-20-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(&=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_20 = 5\n _11_13_2_20 &= 3;\n return _11_13_2_20 === 1;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-21-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-21-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(^=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_21 = 5\n _11_13_2_21 ^= 3;\n return _11_13_2_21 === 6;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-22-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-22-s.js",
"description": "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(|=) evaluates to a resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_13_2_22 = 5\n _11_13_2_22 |= 2;\n return _11_13_2_22 === 7;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-23-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-23-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop *= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-24-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-24-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop /= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-25-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-25-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop %= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-26-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-26-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop += 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-27-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-27-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop -= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-28-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-28-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop <<= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-29-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-29-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop >>= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-3-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-3-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(%=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_3 %= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-30-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-30-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop >>>= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-31-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-31-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop &= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-32-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-32-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop ^= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-33-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-33-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference to a data property with the attribute value {[[Writable]]:false}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: 10,\n writable: false,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop |= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 10;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-34-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-34-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop *= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-35-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-35-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop /= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-36-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-36-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop %= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-37-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-37-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop += 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-38-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-38-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop -= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-39-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-39-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop <<= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-4-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-4-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(+=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_4 += 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-40-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-40-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop >>= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-41-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-41-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop >>>= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-42-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-42-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop &= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-43-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-43-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop ^= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-44-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-44-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference of to an accessor property with the attribute value {[[Set]]:undefined}",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return 11;\n },\n set: undefined,\n enumerable: true,\n configurable: true\n });\n\n try {\n obj.prop |= 20;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === 11;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.13.2-45-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-45-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len *= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-46-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-46-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len /= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-47-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-47-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len %= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-48-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-48-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len += 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-49-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-49-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len -= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-5-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-5-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(-=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_5 -= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-50-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-50-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len <<= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-51-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-51-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len >>= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-52-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-52-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len >>>= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-53-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-53-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len &= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-54-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-54-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len ^= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-55-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-55-s.js",
"description": "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.preventExtensions(obj);\n\n try {\n obj.len |= 10;\n return false;\n } catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.preventExtensions))",
"strict_only": ""
},
{
"id": "11.13.2-6-1-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-1-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(*=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval *= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-10-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-10-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(^=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval ^= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-11-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-11-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(|=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval |= 20;\"); \n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-12-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-12-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(*=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments *= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-13-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-13-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(/=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments /= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-14-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-14-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(%=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments %= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-15-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-15-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(+=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments += 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-16-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-16-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(-=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments -= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-17-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-17-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(<<=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments <<= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-18-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-18-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(>>=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments >>= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-19-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-19-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(>>>=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments >>>= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-2-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-2-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(/=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval /= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-20-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-20-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(&=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments &= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-21-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-21-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(^=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments ^= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-22-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-22-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(|=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments |= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-3-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-3-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(%=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval %= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-4-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-4-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(+=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval += 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-5-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-5-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(-=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval -= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-6-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-6-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(<<=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval <<= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-7-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-7-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(>>=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval >>= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-8-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-8-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(>>>=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval >>>= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-9-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-9-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(&=)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval &= 20;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.13.2-6-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-6-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(<<=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_6 <<= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-7-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-7-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(>>=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_7 >>= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-8-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-8-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(>>>=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_8 >>>= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.13.2-9-s",
"path": "TestCases/chapter11/11.13/11.13.2/11.13.2-9-s.js",
"description": "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(&=) evaluates to an unresolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"_11_13_2_9 &= 1;\");\n return false;\n } catch (e) {\n return e instanceof ReferenceError;\n }\n }).call(this));\n",
"strict_only": ""
}
]
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
{
"testCollection": {
"name": "11.14_Comma_Operator",
"numTests": 5,
"tests": [
{
"section": "11.14",
"description": "Checking by using eval",
"test": "//CHECK#1\nif ((eval(\"false\\u0009,\\u0009true\")) !== true) {\n $ERROR('#1: (false\\\\u0009,\\\\u0009true) === true');\n}\n\n//CHECK#2\nif ((eval(\"false\\u000B,\\u000Btrue\")) !== true) {\n $ERROR('#2: (false\\\\u000B,\\\\u000Btrue) === true'); \n}\n\n//CHECK#3\nif ((eval(\"false\\u000C,\\u000Ctrue\")) !== true) {\n $ERROR('#3: (false\\\\u000C,\\\\u000Ctrue) === true');\n}\n\n//CHECK#4\nif ((eval(\"false\\u0020,\\u0020true\")) !== true) {\n $ERROR('#4: (false\\\\u0020,\\\\u0020true) === true');\n}\n\n//CHECK#5\nif ((eval(\"false\\u00A0,\\u00A0true\")) !== true) {\n $ERROR('#5: (false\\\\u00A0,\\\\u00A0true) === true');\n}\n\n//CHECK#6\nif ((eval(\"false\\u000A,\\u000Atrue\")) !== true) {\n $ERROR('#6: (false\\\\u000A,\\\\u000Atrue) === true'); \n}\n\n//CHECK#7\nif ((eval(\"false\\u000D,\\u000Dtrue\")) !== true) {\n $ERROR('#7: (false\\\\u000D,\\\\u000Dtrue) === true');\n}\n\n//CHECK#8\nif ((eval(\"false\\u2028,\\u2028true\")) !== true) {\n $ERROR('#8: (false\\\\u2028,\\\\u2028true) === true');\n}\n\n//CHECK#9\nif ((eval(\"false\\u2029,\\u2029true\")) !== true) {\n $ERROR('#9: (false\\\\u2029,\\\\u2029true) === true');\n}\n\n\n//CHECK#10\nif ((eval(\"false\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029,\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\")) !== true) {\n $ERROR('#10: (false\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029,\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true) === true');\n}\n",
"id": "S11.14_A1"
},
{
"section": "11.14",
"description": "Either Expression is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((1,2) !== 2) {\n $ERROR('#1: (1,2) === 2. Actual: ' + ((1,2)));\n}\n\n//CHECK#2\nvar x = 1;\nif ((x, 2) !== 2) {\n $ERROR('#2: var x = 1; (x, 2) === 2. Actual: ' + ((x, 2)));\n}\n\n//CHECK#3\nvar y = 2;\nif ((1, y) !== 2) {\n $ERROR('#3: var y = 2; (1, y) === 2. Actual: ' + ((1, y)));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 2;\nif ((x, y) !== 2) {\n $ERROR('#4: var x = 1; var y = 2; (x, y) === 2. Actual: ' + ((x, y)));\n}\n\n//CHECK#5\nvar x = 1;\nif ((x, x) !== 1) {\n $ERROR('#5: var x = 1; (x, x) === 1. Actual: ' + ((x, x)));\n}\n\n//CHECK#6\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = true;\nobjecty.prop = 1.1;\nif ((objectx.prop = false, objecty.prop) !== objecty.prop) {\n $ERROR('#6: var objectx = new Object(); var objecty = new Object(); objectx.prop = true; objecty.prop = 1; (objectx.prop = false, objecty.prop) === objecty.prop. Actual: ' + ((objectx.prop = false, objecty.prop)));\n} else {\n if (objectx.prop !== false) {\n $ERROR('#6: var objectx = new Object(); var objecty = new Object(); objectx.prop = true; objecty.prop = 1; objectx.prop = false, objecty.prop; objectx.prop === false');\n } \n}\n\n",
"id": "S11.14_A2.1_T1"
},
{
"section": "11.14",
"description": "If GetBase(Expression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x, 1;\n $ERROR('#1.1: x, 1 throw ReferenceError. Actual: ' + (x, 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x, 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.14_A2.1_T2"
},
{
"section": "11.14",
"description": "If GetBase(AssigmentExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1, y;\n $ERROR('#1.1: 1, y throw ReferenceError. Actual: ' + (1, y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1, y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.14_A2.1_T3"
},
{
"section": "11.14",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0;\nvar y = 0;\nvar z = 0;\nif ((x = 1, y = 2, z = 3) !== 3) {\n $ERROR('#1: var x = 0; var y = 0; var z = 0; (x = 1, y = 2, z = 3) === 3. Actual: ' + ((x = 1, y = 2, z = 3)));\n}\n\nvar x = 0;\nvar y = 0;\nvar z = 0;\nx = 1, y = 2, z = 3;\n\n//CHECK#2\nif (x !== 1) {\n $ERROR('#2: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; x === 1. Actual: ' + (x));\n}\n\n//CHECK#3\nif (y !== 2) {\n $ERROR('#3: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; y === 2. Actual: ' + (y));\n}\n\n//CHECK#4\nif (z !== 3) {\n $ERROR('#4: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; z === 3. Actual: ' + (z));\n}\n",
"id": "S11.14_A3"
}
]
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,86 @@
{
"testCollection": {
"name": "11.2.2_The_new_Operator",
"numTests": 13,
"tests": [
{
"section": "11.2.2, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"new\\u0009Number\") != 0) {\n $ERROR('#1: new\\\\u0009Number == 0');\n}\n\n//CHECK#2\nif (eval(\"new\\u000BNumber\") != 0) {\n $ERROR('#2: new\\\\u000BNumber == 0'); \n}\n\n//CHECK#3\nif (eval(\"new\\u000CNumber\") != 0) {\n $ERROR('#3: new\\\\u000CNumber == 0');\n}\n\n//CHECK#4\nif (eval(\"new\\u0020Number\") != 0) {\n $ERROR('#4: new\\\\u0020Number == 0');\n}\n\n//CHECK#5\nif (eval(\"new\\u00A0Number\") != 0) {\n $ERROR('#5: new\\\\u00A0Number == 0');\n}\n\n//CHECK#6\nif (eval(\"new\\u000ANumber\") != 0) {\n $ERROR('#6: new\\\\u000ANumber == 0'); \n}\n\n//CHECK#7\nif (eval(\"new\\u000DNumber\") != 0) {\n $ERROR('#7: new\\\\u000DNumber == 0');\n}\n\n//CHECK#8\nif (eval(\"new\\u2028Number\") != 0) {\n $ERROR('#8: new\\\\u2028Number == 0');\n}\n\n//CHECK#9\nif (eval(\"new\\u2029Number\") != 0) {\n $ERROR('#9: new\\\\u2029Number == 0');\n}\n\n//CHECK#10\nif (eval(\"new\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029Number\") != 0) {\n $ERROR('#10: new\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029Number == 0');\n}\n",
"id": "S11.2.2_A1.1"
},
{
"section": "11.2.2, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"new\\u0009Number()\") != 0) {\n $ERROR('#1: new\\\\u0009Number == 0');\n}\n\n//CHECK#2\nif (eval(\"new\\u000BNumber()\") != 0) {\n $ERROR('#2: new\\\\u000BNumber == 0'); \n}\n\n//CHECK#3\nif (eval(\"new\\u000CNumber()\") != 0) {\n $ERROR('#3: new\\\\u000CNumber == 0');\n}\n\n//CHECK#4\nif (eval(\"new\\u0020Number()\") != 0) {\n $ERROR('#4: new\\\\u0020Number == 0');\n}\n\n//CHECK#5\nif (eval(\"new\\u00A0Number()\") != 0) {\n $ERROR('#5: new\\\\u00A0Number == 0');\n}\n\n//CHECK#6\nif (eval(\"new\\u000ANumber()\") != 0) {\n $ERROR('#6: new\\\\u000ANumber == 0'); \n}\n\n//CHECK#7\nif (eval(\"new\\u000DNumber()\") != 0) {\n $ERROR('#7: new\\\\u000DNumber == 0');\n}\n\n//CHECK#8\nif (eval(\"new\\u2028Number()\") != 0) {\n $ERROR('#8: new\\\\u2028Number == 0');\n}\n\n//CHECK#9\nif (eval(\"new\\u2029Number()\") != 0) {\n $ERROR('#9: new\\\\u2029Number == 0');\n}\n\n//CHECK#10\nif (eval(\"new\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029Number()\") != 0) {\n $ERROR('#10: new\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029Number == 0');\n}\n",
"id": "S11.2.2_A1.2"
},
{
"section": "11.2.2",
"description": "If GetBase(NewExpression) or GetBase(MemberExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n new x;\n $ERROR('#1.1: new x throw ReferenceError. Actual: ' + (new x)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: new x throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\ntry {\n new x();\n $ERROR('#2: new x() throw ReferenceError'); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#2: new x() throw ReferenceError'); \n }\n}\n",
"id": "S11.2.2_A2"
},
{
"section": "11.2.2",
"description": "Checking boolean primitive case",
"test": "//CHECK#1\ntry {\n new true;\n $ERROR('#1: new true throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new true throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n var x = true;\n new x;\n $ERROR('#2: var x = true; new x throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = true; new x throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = true;\n new x();\n $ERROR('#3: var x = true; new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = true; new x() throw TypeError'); \n }\n}\n\n",
"id": "S11.2.2_A3_T1"
},
{
"section": "11.2.2",
"description": "Checking \"number primitive\" case",
"test": "//CHECK#1\ntry {\n new 1;\n $ERROR('#1: new 1 throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new 1 throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n var x = 1;\n new x;\n $ERROR('#2: var x = 1; new x throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = 1; new x throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = 1;\n new x();\n $ERROR('#3: var x = 1; new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = 1; new x() throw TypeError'); \n }\n}\n",
"id": "S11.2.2_A3_T2"
},
{
"section": "11.2.2",
"description": "Checking \"string primitive\" case",
"test": "//CHECK#1\ntry {\n new 1;\n $ERROR('#1: new \"1\" throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new \"1\" throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n var x = \"1\";\n new x;\n $ERROR('#2: var x = \"1\"; new x throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = \"1\"; new x throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = \"1\";\n new x();\n $ERROR('#3: var x = \"1\"; new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = \"1\"; new x() throw TypeError'); \n }\n}\n",
"id": "S11.2.2_A3_T3"
},
{
"section": "11.2.2",
"description": "Checking \"undefined\" case",
"test": "//CHECK#1\ntry {\n new undefined;\n $ERROR('#1: new undefined throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new undefined throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n var x = undefined;\n new x;\n $ERROR('#2: var x = undefined; new x throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = undefined; new x throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = undefined;\n new x();\n $ERROR('#3: var x = undefined; new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = undefined; new x() throw TypeError'); \n }\n}\n",
"id": "S11.2.2_A3_T4"
},
{
"section": "11.2.2",
"description": "Checking \"null primitive\" case",
"test": "//CHECK#1\ntry {\n new null;\n $ERROR('#1: new null throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new null throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n var x = null;\n new x;\n $ERROR('#2: var x = null; new x throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = null; new x throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = null;\n new x();\n $ERROR('#3: var x = null; new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = null; new x() throw TypeError'); \n }\n}\n",
"id": "S11.2.2_A3_T5"
},
{
"section": "11.2.2",
"description": "Checking Boolean object case",
"test": "//CHECK#1\ntry {\n new new Boolean(true);\n $ERROR('#1: new new Boolean(true) throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new new Boolean(true) throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n var x = new Boolean(true);\n new x;\n $ERROR('#2: var x = new Boolean(true); new x throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = new Boolean(true); new x throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = new Boolean(true);\n new x();\n $ERROR('#3: var x = new Boolean(true); new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = new Boolean(true); new x() throw TypeError'); \n }\n}\n\n",
"id": "S11.2.2_A4_T1"
},
{
"section": "11.2.2",
"description": "Checking Number object case",
"test": "//CHECK#1\ntry {\n new new Number(1);\n $ERROR('#1: new new Number(1) throw TypeError');\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new new Number(1) throw TypeError');\n }\n}\n\n//CHECK#2\ntry {\n var x = new Number(1);\n new x;\n $ERROR('#2: var x = new Number(1); new x throw TypeError');\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = new Number(1); new x throw TypeError');\n }\n}\n\n//CHECK#3\ntry {\n var x = new Number(1);\n new x();\n $ERROR('#3: var x = new Number(1); new x() throw TypeError');\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = new Number(1); new x() throw TypeError');\n }\n}\n\n",
"id": "S11.2.2_A4_T2"
},
{
"section": "11.2.2",
"description": "Checking String object case",
"test": "//CHECK#1\ntry {\n new new String(\"1\");\n $ERROR('#1: new new String(\"1\") throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new new String(\"1\") throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n var x = new String(\"1\");\n new x;\n $ERROR('#2: var x = new String(\"1\"); new x throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: var x = new String(\"1\"); new x throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = new String(\"1\");\n new x();\n $ERROR('#3: var x = new String(\"1\"); new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = new String(\"1\"); new x() throw TypeError'); \n }\n}\n\n",
"id": "S11.2.2_A4_T3"
},
{
"section": "11.2.2",
"description": "Checking Global object case",
"test": "//CHECK#1\ntry {\n new this;\n $ERROR('#1: new this throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new this throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n new this();\n $ERROR('#2: new this() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: new this() throw TypeError'); \n }\n}\n",
"id": "S11.2.2_A4_T4"
},
{
"section": "11.2.2",
"description": "Checking Math object case",
"test": "//CHECK#1\ntry {\n new Math;\n $ERROR('#1: new Math throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: new Math throw TypeError');\t\n }\n}\n\n//CHECK#2\ntry {\n new new Math();\n $ERROR('#2: new new Math() throw TypeError');\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: new new Math() throw TypeError');\t\n }\n}\n\n//CHECK#3\ntry {\n var x = new Math();\n new x();\n $ERROR('#3: var x = new Math(); new x() throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: var x = new Math(); new x() throw TypeError'); \n }\n}\n\n",
"id": "S11.2.2_A4_T5"
}
]
}
}

View File

@ -0,0 +1,80 @@
{
"testCollection": {
"name": "11.2.3_Function_Calls",
"numTests": 12,
"tests": [
{
"section": "11.2.3, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"Number\\u0009()\") !== 0) {\n $ERROR('#1: Number\\\\u0009() === 0');\n}\n\n//CHECK#2\nif (eval(\"Number\\u000B()\") !== 0) {\n $ERROR('#2: Number\\\\u000B() === 0'); \n}\n\n//CHECK#3\nif (eval(\"Number\\u000C()\") !== 0) {\n $ERROR('#3: Number\\\\u000C() === 0');\n}\n\n//CHECK#4\nif (eval(\"Number\\u0020()\") !== 0) {\n $ERROR('#4: Number\\\\u0020 === 0');\n}\n\n//CHECK#5\nif (eval(\"Number\\u00A0()\") !== 0) {\n $ERROR('#5: Number\\\\u00A0() === 0');\n}\n\n//CHECK#6\nif (eval(\"Number\\u000A()\") !== 0) {\n $ERROR('#6: Number\\\\u000A() === 0'); \n}\n\n//CHECK#7\nif (eval(\"Number\\u000D()\") !== 0) {\n $ERROR('#7: Number\\\\u000D() === 0');\n}\n\n//CHECK#8\nif (eval(\"Number\\u2028()\") !== 0) {\n $ERROR('#8: Number\\\\u2028() === 0');\n}\n\n//CHECK#9\nif (eval(\"Number\\u2029()\") !== 0) {\n $ERROR('#9: Number\\\\u2029() === 0');\n}\n\n//CHECK#10\nif (eval(\"Number\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029()\") !== 0) {\n $ERROR('#10: Number\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029() === 0');\n}\n",
"id": "S11.2.3_A1"
},
{
"section": "11.2.3",
"description": "If GetBase(MemberExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x();\n $ERROR('#1.1: x() throw ReferenceError. Actual: ' + (x())); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x() throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\ntry {\n x(1,2,3);\n $ERROR('#2.1: x(1,2,3) throw ReferenceError. Actual: ' + (x(1,2,3))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#2.2: x(1,2,3) throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.2.3_A2"
},
{
"section": "11.2.3",
"description": "Checking \"boolean primitive\" case",
"test": "//CHECK#1\ntry {\n true();\n $ERROR('#1.1: true() throw TypeError. Actual: ' + (true()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: true() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n//CHECK#2\ntry {\n var x = true;\n x();\n $ERROR('#2.1: var x = true; x() throw TypeError. Actual: ' + (x()))\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = true; x() throw TypeError. Actual: ' + (e)) \n }\n}\n",
"id": "S11.2.3_A3_T1"
},
{
"section": "11.2.3",
"description": "Checking \"number primitive\" case",
"test": "//CHECK#1\ntry {\n 1();\n $ERROR('#1.1: 1() throw TypeError. Actual: ' + (1()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: 1() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n//CHECK#2\ntry {\n var x = 1;\n x();\n $ERROR('#2.1: var x = 1; x() throw TypeError. Actual: ' + (x()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = 1; x() throw TypeError. Actual: ' + (e));\t\n }\n}\n",
"id": "S11.2.3_A3_T2"
},
{
"section": "11.2.3",
"description": "Checking \"string primitive\" case",
"test": "//CHECK#1\ntry {\n \"1\"();\n $ERROR('#1.1: \"1\"() throw TypeError. Actual: ' + (\"1\"()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: \"1\"() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n//CHECK#2\ntry {\n var x = \"1\";\n x();\n $ERROR('#2.1: var x = \"1\"; x() throw TypeError. Actual: ' + (x()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = \"1\"; x() throw TypeError. Actual: ' + (e));\t\n }\n}\n",
"id": "S11.2.3_A3_T3"
},
{
"section": "11.2.3",
"description": "Checking \"undefined\" case",
"test": "//CHECK#1\ntry {\n undefined();\n $ERROR('#1.1: undefined() throw TypeError. Actual: ' + (e));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: undefined() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n//CHECK#2\ntry {\n var x = undefined;\n x();\n $ERROR('#2.1: var x = undefined; x() throw TypeError. Actual: ' + (e));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = undefined; x() throw TypeError. Actual: ' + (e));\t\n }\n}\n",
"id": "S11.2.3_A3_T4"
},
{
"section": "11.2.3",
"description": "Checking \"null\" case",
"test": "//CHECK#1\ntry {\n null();\n $ERROR('#1.1: null() throw TypeError. Actual: ' + (null()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: null() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n//CHECK#2\ntry {\n var x = null;\n x();\n $ERROR('#2.1: var x = null; x() throw TypeError. Actual: ' + (x()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = null; x() throw TypeError. Actual: ' + (e));\t\n }\n}\n",
"id": "S11.2.3_A3_T5"
},
{
"section": "11.2.3",
"description": "Checking Boolean object case",
"test": "//CHECK#1\ntry {\n new Boolean(true)();\n $ERROR('#1.1: new Boolean(true)() throw TypeError. Actual: ' + (new Boolean(true)())); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: new Boolean(true)() throw TypeError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\ntry {\n var x = new Boolean(true);\n x();\n $ERROR('#2.1: var x = new Boolean(true); x() throw TypeError. Actual: ' + (x()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = new Boolean(true); x() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n",
"id": "S11.2.3_A4_T1"
},
{
"section": "11.2.3",
"description": "Checking Number object case",
"test": "//CHECK#1\ntry {\n new Number(1)();\n $ERROR('#1.1: new Number(1)() throw TypeError. Actual: ' + (new Number(1)()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: new Number(1)() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n//CHECK#2\ntry {\n var x = new Number(1);\n x();\n $ERROR('#2.1: var x = new Number(1); x() throw TypeError. Actual: ' + (x()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = new Number(1); x() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n",
"id": "S11.2.3_A4_T2"
},
{
"section": "11.2.3",
"description": "Checking String object case",
"test": "//CHECK#1\ntry {\n new String(\"1\")();\n $ERROR('#1.1: new String(\"1\")() throw TypeError. Actual: ' + (new String(\"1\")()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: new String(\"1\")() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n//CHECK#2\ntry {\n var x = new String(\"1\");\n x();\n $ERROR('#2.1: var x = new String(\"1\"); x() throw TypeError. Actual: ' + (x()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2.2: var x = new String(\"1\"); x() throw TypeError. Actual: ' + (e));\t\n }\n}\n",
"id": "S11.2.3_A4_T3"
},
{
"section": "11.2.3",
"description": "Checking Global object case",
"test": "//CHECK#1\ntry {\n this();\n $ERROR('#1.1: this() throw TypeError. Actual: ' + (this()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: this() throw TypeError. Actual: ' + (e));\t\n }\n}\n",
"id": "S11.2.3_A4_T4"
},
{
"section": "11.2.3",
"description": "Checking Math object case",
"test": "//CHECK#1\ntry {\n Math();\n $ERROR('#1.1: Math() throw TypeError. Actual: ' + (Math()));\t\n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1.2: Math() throw TypeError. Actual: ' + (e));\t\n }\n}\n\n",
"id": "S11.2.3_A4_T5"
}
]
}
}

View File

@ -0,0 +1,63 @@
{
"testCollection": {
"name": "11.2.4_Argument_Lists",
"numTests": 9,
"tests": [
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Function is declared with no FormalParameterList",
"test": "function f_arg() {\n return arguments;\n}\n\n//CHECK#1\nif (f_arg().length !== 0) {\n $ERROR('#1: function f_arg() {return arguments;} f_arg().length === 0. Actual: ' + (f_arg().length));\n}\n\n//CHECK#2\nif (f_arg()[0] !== undefined) {\n $ERROR('#2: function f_arg() {return arguments;} f_arg()[0] === undefined. Actual: ' + (f_arg()[0]));\n}\n",
"id": "S11.2.4_A1.1_T1"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Function is declared with FormalParameterList",
"test": "function f_arg(x,y) {\n return arguments;\n}\n\n//CHECK#1\nif (f_arg().length !== 0) {\n $ERROR('#1: function f_arg(x,y) {return arguments;} f_arg().length === 0. Actual: ' + (f_arg().length));\n}\n\n//CHECK#2\nif (f_arg()[0] !== undefined) {\n $ERROR('#2: function f_arg(x,y) {return arguments;} f_arg()[0] === undefined. Actual: ' + (f_arg()[0]));\n}\n\n//CHECK#3\nif (f_arg.length !== 2) {\n $ERROR('#3: function f_arg(x,y) {return arguments;} f_arg.length === 2. Actual: ' + (f_arg.length));\n}\n",
"id": "S11.2.4_A1.1_T2"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Function is declared with no FormalParameterList",
"test": "f_arg = function() {\n return arguments;\n}\n\n//CHECK#1\nif (f_arg(1,2,3).length !== 3) {\n $ERROR('#1: f_arg = function()() {return arguments;} f_arg(1,2,3).length === 3. Actual: ' + (f_arg(1,2,3).length));\n}\n\n//CHECK#2\nif (f_arg(1,2,3)[0] !== 1) {\n $ERROR('#1: f_arg = function()() {return arguments;} f_arg(1,2,3)[0] === 1. Actual: ' + (f_arg(1,2,3)[0]));\n}\n\n//CHECK#3\nif (f_arg(1,2,3)[1] !== 2) {\n $ERROR('#3: f_arg = function()() {return arguments;} f_arg(1,2,3)[1] === 2. Actual: ' + (f_arg(1,2,3)[1]));\n}\n\n//CHECK#4\nif (f_arg(1,2,3)[2] !== 3) {\n $ERROR('#4: f_arg = function()() {return arguments;} f_arg(1,2,3)[2] === 3. Actual: ' + (f_arg(1,2,3)[2]));\n}\n\n//CHECK#5\nif (f_arg(1,2,3)[3] !== undefined) {\n $ERROR('#5: f_arg = function()() {return arguments;} f_arg(1,2,3)[3] === undefined. Actual: ' + (f_arg(1,2,3)[3]));\n}\n",
"id": "S11.2.4_A1.2_T1"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Function is declared with FormalParameterList",
"test": "f_arg = function(x,y) {\n return arguments;\n}\n\n//CHECK#1\nif (f_arg(1,2,3).length !== 3) {\n $ERROR('#1: f_arg = function(x,y) {return arguments;} f_arg(1,2,3).length === 3. Actual: ' + (f_arg(1,2,3).length));\n}\n\n//CHECK#2\nif (f_arg(1)[0] !== 1) {\n $ERROR('#1: f_arg = function(x,y) {return arguments;} f_arg(1)[0] === 1. Actual: ' + (f_arg(1)[0]));\n}\n\n//CHECK#3\nif (f_arg(1,2)[1] !== 2) {\n $ERROR('#3: f_arg = function(x,y) {return arguments;} f_arg(1,2)[1] === 2. Actual: ' + (f_arg(1,2)[1]));\n}\n\n//CHECK#4\nif (f_arg(1,2,3)[2] !== 3) {\n $ERROR('#4: f_arg = function(x,y) {return arguments;} f_arg(1,2,3)[2] === 3. Actual: ' + (f_arg(1,2,3)[2]));\n}\n\n//CHECK#5\nif (f_arg(1,2,3)[3] !== undefined) {\n $ERROR('#5: f_arg = function(x,y) {return arguments;} f_arg(1,2,3)[3] === undefined. Actual: ' + (f_arg(1,2,3)[3]));\n}\n\n//CHECK#6\nif (f_arg.length !== 2) {\n $ERROR('#6: f_arg = function(x,y) {return arguments;} f_arg.length === 2. Actual: ' + (f_arg.length));\n}\n",
"id": "S11.2.4_A1.2_T2"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "incorrect syntax",
"negative": "",
"test": "function f_arg() {\n}\n\nf_arg(1,,2);\n",
"id": "S11.2.4_A1.3_T1"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Return an internal list whose length is one greater than the\nlength of ArgumentList and whose items are the items of ArgumentList, in order,\nfollowed at the end by GetValue(AssignmentExpression), which is the last item of\nthe new list",
"test": "function f_arg() {\n}\n\n//CHECK#1\nf_arg(x=1,x);\n",
"id": "S11.2.4_A1.4_T1"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Return an internal list whose length is one greater than the\nlength of ArgumentList and whose items are the items of ArgumentList, in order,\nfollowed at the end by GetValue(AssignmentExpression), which is the last item of\nthe new list",
"test": "function f_arg() {\n}\n\n//CHECK#1\ntry {\n f_arg(x,x=1);\n $ERROR('#1.1: function f_arg() {} f_arg(x,x=1) throw ReferenceError. Actual: ' + (f_arg(x,x=1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: function f_arg() {} f_arg(x,x=1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.2.4_A1.4_T2"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Return an internal list whose length is one greater than the\nlength of ArgumentList and whose items are the items of ArgumentList, in order,\nfollowed at the end by GetValue(AssignmentExpression), which is the last item of\nthe new list",
"test": "function f_arg(x,y,z) {\n return z;\n}\n\n//CHECK#1\nif (f_arg(x=1,y=x,x+y) !== 2) {\n $ERROR('#1: function f_arg(x,y,z) {return z;} f_arg(x=1,y=x,x+y) === 2. Actual: ' + (f_arg(x=1,y=x,x+y))); \n}\n",
"id": "S11.2.4_A1.4_T3"
},
{
"section": "11.2.4, 11.2.3, 10.1.8",
"description": "Return an internal list whose length is one greater than the\nlength of ArgumentList and whose items are the items of ArgumentList, in order,\nfollowed at the end by GetValue(AssignmentExpression), which is the last item of\nthe new list",
"test": "var x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\n\nfunction f_arg() {\n}\n\n//CHECK#1\ntry {\n f_arg(x(),y());\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; function f_arg() {} f_arg(x(),y()) throw \"x\". Actual: ' + (f_arg(x(),y()))); \n}\ncatch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First argument is evaluated first, and then second argument');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; function f_arg() {} f_arg(x(),y()) throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.2.4_A1.4_T4"
}
]
}
}

View File

@ -0,0 +1,24 @@
{
"testCollection": {
"name": "11.3.1",
"numTests": 2,
"tests": [
{
"id": "11.3.1-2-1-s",
"path": "TestCases/chapter11/11.3/11.3.1/11.3.1-2-1-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments++)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments++;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.3.1-2-2-s",
"path": "TestCases/chapter11/11.3/11.3.1/11.3.1-2-2-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval++)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval++;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,127 @@
{
"testCollection": {
"name": "11.3.1_Postfix_Increment_Operator",
"numTests": 19,
"tests": [
{
"section": "11.3.1, 11.6.3, 7.3",
"description": "Checking Line Feed",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u000A++\");\n",
"id": "S11.3.1_A1.1_T1"
},
{
"section": "11.3.1, 11.6.3, 7.3",
"description": "Carriage Return",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u000D++\");\n",
"id": "S11.3.1_A1.1_T2"
},
{
"section": "11.3.1, 11.6.3, 7.3",
"description": "Checking Line Seprator",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u2028++\");\n",
"id": "S11.3.1_A1.1_T3"
},
{
"section": "11.3.1, 11.6.3, 7.3",
"description": "Checking Paragraph separator",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u2029++\");\n",
"id": "S11.3.1_A1.1_T4"
},
{
"section": "11.3.1, 11.6.3, 7.2",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"var x = 0; x\\u0009++; x\") !== 1) {\n\t$ERROR('#1: var x = 0; x\\\\u0009++; x === 1. Actual: ' + (x));\n}\n\n//CHECK#2\nif (eval(\"var x = 0; x\\u000B++; x\") !== 1) {\n\t$ERROR('#2: var x = 0; x\\\\u000B++; x === 1. Actual: ' + (x));\t\n}\n\n//CHECK#3\nif (eval(\"var x = 0; x\\u000C++; x\") !== 1) {\n\t$ERROR('#3: var x = 0; x\\\\u000C++; x === 1. Actual: ' + (x));\n}\n\n//CHECK#4\nif (eval(\"var x = 0; x\\u0020++; x\") !== 1) {\n\t$ERROR('#4: var x = 0; x\\\\u0020++; x === 1. Actual: ' + (x));\n}\n\n//CHECK#5\nif (eval(\"var x = 0; x\\u00A0++; x\") !== 1) {\n\t$ERROR('#5: var x = 0; x\\\\u00A0++; x === 1. Actual: ' + (x));\n}\n\n//CHECK#6\nif (eval(\"var x = 0; x\\u0009\\u000B\\u000C\\u0020\\u00A0++; x\") !== 1) {\n $ERROR('#6: var x = 0; x\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0++; x === 1. Actual: ' + (x));\n}\n",
"id": "S11.3.1_A1.2_T1"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is Reference and GetBase(x) is not null",
"test": "//CHECK#1\nvar x = 1;\nvar y = x++;\nif (y !== 1) {\n $ERROR('#1: var x = 1; var y = x++; y === 1. Actual: ' + (y));\n} else {\n if (x !== 1 + 1) {\n $ERROR('#1: var x = 1; var y = x++; x === 1 + 1. Actual: ' + (x));\n } \n}\n\n//CHECK#2\nthis.x = 1;\nvar y = this.x++; \nif (y !== 1) {\n $ERROR('#2: this.x = 1; var y = this.x++; y === 1. Actual: ' + (y));\n} else {\n if (this.x !== 1 + 1) {\n $ERROR('#2: this.x = 1; var y = this.x++; this.x === 1 + 1. Actual: ' + (this.x));\n } \n}\n\n//CHECK#3\nvar object = new Object();\nobject.prop = 1;\nvar y = object.prop++;\nif (y !== 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; var y = object.prop++; y === 1. Actual: ' + (y));\n} else {\n if (this.x !== 1 + 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; var y = object.prop++; object.prop === 1 + 1. Actual: ' + (object.prop));\n } \n}\n\n\n",
"id": "S11.3.1_A2.1_T1"
},
{
"section": "11.3.1, 11.6.3",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x++;\n $ERROR('#1.1: x++ throw ReferenceError. Actual: ' + (x++)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x++ throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.3.1_A2.1_T2"
},
{
"section": "11.3.1, 11.6.3",
"description": "If Type(x) is not Reference, throw ReferenceError (or SyntaxError)",
"negative": "",
"test": "//CHECK#1\ntry {\n 1++;\n $ERROR('#1.1: 1++ throw ReferenceError (or SyntaxError). Actual: ' + (1++)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1++ throw ReferenceError (or SyntaxError). Actual: ' + (e)); \n } else {\n 1++;\n }\n}\n",
"id": "S11.3.1_A2.1_T3"
},
{
"section": "11.3.1, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nvar object = {valueOf: function() {return 1}};\nvar y = object++;\nif (y !== 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; var y = object++; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; object++; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return 1}, toString: function() {return 0}};\nvar y = object++;\nif (y !== 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; var y = object++; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; object++; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#3\nvar object = {valueOf: function() {return 1}, toString: function() {return {}}};\nvar y = object++;\nif (y !== 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; var y = object++; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; object++; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#4\ntry {\n var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}};\n var y = object++;\n if (y !== 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; var y = object++; y === 1. Actual: ' + (y));\n } else {\n if (object !== 1 + 1) {\n $ERROR('#4.2: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; object++; object === 1 + 1. Actual: ' + (object));\n }\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.3: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; var y = object++; y not throw \"error\"');\n } else {\n $ERROR('#4.4: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; var y = object++; y not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nvar object = {toString: function() {return 1}};\nvar y = object++;\nif (y !== 1) {\n $ERROR('#5.1: var object = {toString: function() {return 1}}; var y = object++; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#5.2: var object = {toString: function() {return 1}}; object++; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return 1}}\nvar y = object++;\nif (y !== 1) {\n $ERROR('#6.1: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; var y = object++; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#6.2: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; object++; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#7\ntry {\n var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n var y = object++;\n $ERROR('#7.1: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; object++ throw \"error\". Actual: ' + (y));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; object++ throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n var object = {valueOf: function() {return {}}, toString: function() {return {}}};\n var y = object++;\n $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; object++ throw TypeError. Actual: ' + (y));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; object++ throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.3.1_A2.2_T1"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = false; \nx++;\nif (x !== 0 + 1) {\n $ERROR('#1: var x = false; x++; x === 0 + 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Boolean(true); \nx++; \nif (x !== 1 + 1) {\n $ERROR('#2: var x = new Boolean(true); x++; x === 1 + 1. Actual: ' + (x));\n}\n",
"id": "S11.3.1_A3_T1"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 0.1; \nx++;\nif (x !== 0.1 + 1) {\n $ERROR('#1: var x = 0.1; x++; x === 0.1 + 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Number(-1.1); \nx++;\nif (x !== -1.1 + 1) {\n $ERROR('#2: var x = new Number(-1.1); x++; x === -1.1 + 1. Actual: ' + (x));\n}\n",
"id": "S11.3.1_A3_T2"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nvar x = \"1\"; \nx++;\nif (x !== 1 + 1) {\n $ERROR('#1: var x = \"1\"; x++; x === 1 + 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = \"x\"; \nx++; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = \"x\"; x++; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#3\nvar x = new Number(\"-1\"); \nx++; \nif (x !== -1 + 1) {\n $ERROR('#3: var x = new String(\"-1\"); x++; x === -1 + 1. Actual: ' + (x));\n}\n",
"id": "S11.3.1_A3_T3"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x; \nx++; \nif (isNaN(x) !== true) {\n $ERROR('#1: var x; x++; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = null; \nx++; \nif (x !== 1) {\n $ERROR('#2: var x = null; x++; x === 1. Actual: ' + (x));\n}\n",
"id": "S11.3.1_A3_T4"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \nx++; \nif (isNaN(x) !== true) {\n $ERROR('#1: var x = {}; x++; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \nx++; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = function(){return 1}; x++; x === Not-a-Number. Actual: ' + (x));\n}\n",
"id": "S11.3.1_A3_T5"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = false;\nvar y = x++;\nif (y !== 0) {\n $ERROR('#1: var x = false; var y = x++; y === 0. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = new Boolean(true);\nvar y = x++;\nif (y !== 1) {\n $ERROR('#2: var x = new Boolean(true); var y = x++; y === 1. Actual: ' + (y));\n}\n",
"id": "S11.3.1_A4_T1"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = -0.1;\nvar y = x++;\nif (y !== -0.1) {\n $ERROR('#1: var x = -0.1; var y = x++; y === -0.1. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = new Number(1.1);\nvar y = x++;\nif (y !== 1.1) {\n $ERROR('#2: var x = new Number(1.1); var y = x++; y === 1.1. Actual: ' + (y));\n}\n",
"id": "S11.3.1_A4_T2"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nvar x = \"1\";\nvar y = x++;\nif (y !== 1) {\n $ERROR('#1: var x = \"1\"; var y = x++; y === 1. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = \"x\";\nvar y = x++; \nif (isNaN(y) !== true) {\n $ERROR('#2: var x = \"x\"; var y = x++; y === Not-a-Number. Actual: ' + (y));\n}\n\n//CHECK#3\nvar x = new String(\"-1\"); \nvar y = x++;\nif (y !== -1) {\n $ERROR('#3: var x = new String(\"-1\"); var y = x++; y === -1. Actual: ' + (y));\n}\n",
"id": "S11.3.1_A4_T3"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x;\nvar y = x++;\nif (isNaN(y) !== true) {\n $ERROR('#1: var x; var y = x++; y === Not-a-Number. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = null;\nvar y = x++;\nif (y !== 0) {\n $ERROR('#2: var x = null; var y = x++; y === 0. Actual: ' + (y));\n}\n",
"id": "S11.3.1_A4_T4"
},
{
"section": "11.3.1, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \nvar y = x++;\nif (isNaN(y) !== true) {\n $ERROR('#1: var x = {}; var y = x++; y === Not-a-Number. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \nvar y = x++;\nif (isNaN(y) !== true) {\n $ERROR('#2: var x = function(){return 1}; var y = x++; y === Not-a-Number. Actual: ' + (y));\n}\n",
"id": "S11.3.1_A4_T5"
}
]
}
}

View File

@ -0,0 +1,24 @@
{
"testCollection": {
"name": "11.3.2",
"numTests": 2,
"tests": [
{
"id": "11.3.2-2-1-s",
"path": "TestCases/chapter11/11.3/11.3.2/11.3.2-2-1-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments--)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"arguments--;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.3.2-2-2-s",
"path": "TestCases/chapter11/11.3/11.3.2/11.3.2-2-2-s.js",
"description": "Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval--)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"eval--;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,127 @@
{
"testCollection": {
"name": "11.3.2_Postfix_Decrement_Operator",
"numTests": 19,
"tests": [
{
"section": "11.3.2, 11.6.3, 7.3",
"description": "Checking Line Feed",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u000A--\");\n",
"id": "S11.3.2_A1.1_T1"
},
{
"section": "11.3.2, 11.6.3, 7.3",
"description": "Checking Carriage Return",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u000D--\");\n",
"id": "S11.3.2_A1.1_T2"
},
{
"section": "11.3.2, 11.6.3, 7.3",
"description": "Checking Page separator",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u2028--\");\n",
"id": "S11.3.2_A1.1_T3"
},
{
"section": "11.3.2, 11.6.3, 7.3",
"description": "Checking Line separator",
"negative": "",
"test": "//CHECK#1\neval(\"var x = 1; x\\u2029--\");\n",
"id": "S11.3.2_A1.1_T4"
},
{
"section": "11.3.2, 11.6.3, 7.2",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"var x = 0; x\\u0009--; x\") !== -1) {\n $ERROR('#1: var x = 0; x\\\\u0009--; x === -1. Actual: ' + (x));\n}\n\n//CHECK#2\nif (eval(\"var x = 0; x\\u000B--; x\") !== -1) {\n $ERROR('#2: var x = 0; x\\\\u000B--; x === -1. Actual: ' + (x)); \n}\n\n//CHECK#3\nif (eval(\"var x = 0; x\\u000C--; x\") !== -1) {\n $ERROR('#3: var x = 0; x\\\\u000C--; x === -1. Actual: ' + (x));\n}\n\n//CHECK#4\nif (eval(\"var x = 0; x\\u0020--; x\") !== -1) {\n $ERROR('#4: var x = 0; x\\\\u0020--; x === -1. Actual: ' + (x));\n}\n\n//CHECK#5\nif (eval(\"var x = 0; x\\u00A0--; x\") !== -1) {\n $ERROR('#5: var x = 0; x\\\\u00A0--; x === -1. Actual: ' + (x));\n}\n\n//CHECK#6\nif (eval(\"var x = 0; x\\u0009\\u000B\\u000C\\u0020\\u00A0--; x\") !== -1) {\n $ERROR('#6: var x = 0; x\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0--; x === -1. Actual: ' + (x));\n}\n",
"id": "S11.3.2_A1.2_T1"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is Reference and GetBase(x) is not null",
"test": "//CHECK#1\nvar x = 1;\nif (x-- !== 1) {\n $ERROR('#1: var x = 1; x-- === 1. Actual: ' + (x--));\n} else {\n if (x !== 1 - 1) {\n $ERROR('#1: var x = 1; x--; x === 1 - 1. Actual: ' + (x));\n } \n}\n\n//CHECK#2\nthis.x = 1;\nif (this.x-- !== 1) {\n $ERROR('#2: this.x = 1; this.x-- === 1. Actual: ' + (this.x--));\n} else {\n if (this.x !== 1 - 1) {\n $ERROR('#2: this.x = 1; this.x--; this.x === 1 - 1. Actual: ' + (this.x));\n } \n}\n\n//CHECK#3\nvar object = new Object();\nobject.prop = 1;\nif (object.prop-- !== 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; object.prop-- === 1. Actual: ' + (object.prop--));\n} else {\n if (this.x !== 1 - 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; object.prop--; object.prop === 1 - 1. Actual: ' + (object.prop));\n } \n}\n",
"id": "S11.3.2_A2.1_T1"
},
{
"section": "11.3.2, 11.6.3",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x--;\n $ERROR('#1.1: x-- throw ReferenceError. Actual: ' + (x--)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x-- throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.3.2_A2.1_T2"
},
{
"section": "11.3.2, 11.6.3",
"description": "If Type(x) is not Reference, throw ReferenceError (or SyntaxError)",
"negative": "",
"test": "//CHECK#1\ntry {\n 1--;\n $ERROR('#1.1: 1-- throw ReferenceError (or SyntaxError). Actual: ' + (1--)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1-- throw ReferenceError (or SyntaxError). Actual: ' + (e)); \n } else {\n 1--;\n }\n}\n",
"id": "S11.3.2_A2.1_T3"
},
{
"section": "11.3.2, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nvar object = {valueOf: function() {return 1}};\nvar y = object--;\nif (y !== 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; var y = object--; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; object--; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return 1}, toString: function() {return 0}};\nvar y = object--;\nif (y !== 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; var y = object--; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; object--; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#3\nvar object = {valueOf: function() {return 1}, toString: function() {return {}}};\nvar y = object--;\nif (y !== 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; var y = object--; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; object--; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#4\ntry {\n var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}};\n var y = object--;\n if (y !== 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; var y = object--; y === 1. Actual: ' + (y));\n } else {\n if (object !== 1 - 1) {\n $ERROR('#4.2: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; object--; object === 1 - 1. Actual: ' + (object));\n }\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.3: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; y not throw \"error\"');\n } else {\n $ERROR('#4.4: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; y not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nvar object = {toString: function() {return 1}};\nvar y = object--;\nif (y !== 1) {\n $ERROR('#5.1: var object = {toString: function() {return 1}}; var y = object--; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#5.2: var object = {toString: function() {return 1}}; object--; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return 1}}\nvar y = object--;\nif (y !== 1) {\n $ERROR('#6.1: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; var y = object--; y === 1. Actual: ' + (y));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#6.2: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; object--; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#7\ntry {\n var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n var y = object--;\n $ERROR('#7.1: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; object-- throw \"error\". Actual: ' + (y));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; object-- throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n var object = {valueOf: function() {return {}}, toString: function() {return {}}};\n var y = object--;\n $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; object-- throw TypeError. Actual: ' + (y));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; object-- throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.3.2_A2.2_T1"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = true; \nx--;\nif (x !== 0) {\n $ERROR('#1: var x = true; x--; x === 0. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Boolean(false); \nx--;\nif (x !== 0 - 1) {\n $ERROR('#2: var x = new Boolean(false); x--; x === 0 - 1. Actual: ' + (x));\n}\n",
"id": "S11.3.2_A3_T1"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 1.1; \nx--;\nif (x !== 1.1 - 1) {\n $ERROR('#1: var x = 1.1; x--; x === 1.1 - 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Number(-0.1); \nx--; \nif (x !== -0.1 - 1) {\n $ERROR('#2: var x = new Number(-0.1); x--; x === -0.1 - 1. Actual: ' + (x));\n}\n",
"id": "S11.3.2_A3_T2"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nvar x = \"1\"; \nx--; \nif (x !== 1 - 1) {\n $ERROR('#1: var x = \"1\"; x--; x === 1 - 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = \"x\"; \nx--; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = \"x\"; x--; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#3\nvar x = new Number(\"-1\"); \nx--;\nif (x !== -1 - 1) {\n $ERROR('#3: var x = new String(\"-1\"); x--; x === -1 - 1. Actual: ' + (x));\n}\n",
"id": "S11.3.2_A3_T3"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x; \nx--;\nif (isNaN(x) !== true) {\n $ERROR('#1: var x; x--; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = null; \nx--;\nif (x !== -1) {\n $ERROR('#2: var x = null; x--; x === -1. Actual: ' + (x));\n}\n",
"id": "S11.3.2_A3_T4"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \nx--; \nif (isNaN(x) !== true) {\n $ERROR('#1: var x = {}; x--; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \nx--; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = function(){return 1}; x--; x === Not-a-Number. Actual: ' + (x));\n}\n",
"id": "S11.3.2_A3_T5"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = true;\nvar y = x--; \nif (y !== 1) {\n $ERROR('#1: var x = true; var y = x--; y === 1. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = new Boolean(false);\nvar y = x--;\nif (y !== 0) {\n $ERROR('#2: var x = new Boolean(false); var y = x--; y === 0. Actual: ' + (y));\n}\n",
"id": "S11.3.2_A4_T1"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 1.1;\nvar y = x--;\nif (y !== 1.1) {\n $ERROR('#1: var x = 1.1; var y = x--; y === 1.1. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = new Number(-0.1);\nvar y = x--;\nif (y !== -0.1) {\n $ERROR('#2: var x = new Number(-0.1); var y = x--; y === -0.1. Actual: ' + (y));\n}\n",
"id": "S11.3.2_A4_T2"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nvar x = \"1\"; \nvar y = x--;\nif (y !== 1) {\n $ERROR('#1: var x = \"1\"; var y = x--; y === 1. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = \"x\";\nvar y = x--;\nif (isNaN(y) !== true) {\n $ERROR('#2: var x = \"x\"; var y = x--; y === Not-a-Number. Actual: ' + (y));\n}\n\n//CHECK#3\nvar x = new String(\"-1\");\nvar y = x--;\nif (y !== -1) {\n $ERROR('#3: var x = new String(\"-1\"); var y = x--; y === -1. Actual: ' + (y));\n}\n",
"id": "S11.3.2_A4_T3"
},
{
"section": "11.3.2, 11.6.3",
"description": "If Type(x) is undefined or null",
"test": "//CHECK#1\nvar x; \nvar y = x--;\nif (isNaN(y) !== true) {\n $ERROR('#1: var x; var y = x--; y === Not-a-Number. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = null;\nvar y = x--;\nif (y !== 0) {\n $ERROR('#2: var x = null; var y = x--; y === 0. Actual: ' + (y));\n}\n",
"id": "S11.3.2_A4_T4"
},
{
"section": "11.3.2, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {};\nvar y = x--; \nif (isNaN(y) !== true) {\n $ERROR('#1: var x = {}; var y = x--; y === Not-a-Number. Actual: ' + (y));\n}\n\n//CHECK#2\nvar x = function(){return 1};\nvar y = x--; \nif (isNaN(y) !== true) {\n $ERROR('#2: var x = function(){return 1}; var y = x--; y === Not-a-Number. Actual: ' + (y));\n}\n",
"id": "S11.3.2_A4_T5"
}
]
}
}

View File

@ -0,0 +1,470 @@
{
"testCollection": {
"name": "11.4.1",
"numTests": 65,
"tests": [
{
"id": "11.4.1-0-1",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-0-1.js",
"description": "delete operator as UnaryExpression",
"test": "assertTrue((function testcase() {\n var x = 1;\n var y = 2;\n var z = 3;\n \n if( (!delete x || delete y) &&\n delete delete z)\n {\n return true;\n } \n }).call(this));\n"
},
{
"id": "11.4.1-2-1",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-2-1.js",
"description": "delete operator returns true when deleting a non-reference (number)",
"test": "assertTrue((function testcase() {\n var d = delete 42;\n if (d === true) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-2-2",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-2-2.js",
"description": "delete operator returns true when deleting returned value from a function",
"test": "assertTrue((function testcase() {\n var bIsFooCalled = false;\n var foo = function(){bIsFooCalled = true;};\n\n var d = delete foo();\n if(d === true && bIsFooCalled === true)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-2-3",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-2-3.js",
"description": "delete operator returns true when deleting a non-reference (boolean)",
"test": "assertTrue((function testcase() {\n var d = delete true;\n if (d === true) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-2-4",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-2-4.js",
"description": "delete operator returns true when deleting a non-reference (string)",
"test": "assertTrue((function testcase() {\n var d = delete \"abc\";\n if (d === true) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-2-5",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-2-5.js",
"description": "delete operator returns true when deleting a non-reference (obj)",
"test": "assertTrue((function testcase() {\n var d = delete {a:0} ;\n if (d === true) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-2-6",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-2-6.js",
"description": "delete operator returns true when deleting a non-reference (null)",
"test": "assertTrue((function testcase() {\n var d = delete null;\n if (d === true) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-3-1",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-3-1.js",
"description": "delete operator returns true when deleting an unresolvable reference",
"test": "assertTrue((function testcase() {\n // just cooking up a long/veryLikely unique name\n var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_0__;\n if (d === true) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-3-2",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-3-2.js",
"description": "delete operator throws ReferenceError when deleting an explicitly qualified yet unresolvable reference (base obj undefined)",
"test": "assertTrue((function testcase() {\n // just cooking up a long/veryLikely unique name\n try\n {\n var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_2__.x;\n }\n catch(e)\n {\n if (e instanceof ReferenceError)\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-3-3",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-3-3.js",
"description": "delete operator returns true when deleting an explicitly qualified yet unresolvable reference (property undefined for base obj)",
"test": "assertTrue((function testcase() {\n var __ES3_1_test_suite_test_11_4_1_3_unique_id_3__ = {};\n var d = delete __ES3_1_test_suite_test_11_4_1_3_unique_id_3__.x;\n if (d === true) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-3-a-1-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting an un-resolvable reference",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete obj\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-4-a-1-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js",
"description": "Strict Mode - TypeError is thrown when deleting non-configurable data property",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: \"abc\",\n configurable: false\n });\n\n try {\n delete obj.prop;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === \"abc\";\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-4-a-2-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js",
"description": "Strict Mode - TypeError is thrown when deleting non-configurable accessor property",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return \"abc\"; \n },\n configurable: false\n });\n\n try {\n delete obj.prop;\n return false;\n } catch (e) {\n return e instanceof TypeError && obj.prop === \"abc\";\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-4-a-3-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js",
"description": "Strict Mode - TypeError isn't thrown when deleting configurable data property",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n value: \"abc\",\n configurable: true\n });\n\n delete obj.prop;\n return !obj.hasOwnProperty(\"prop\");\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.4.1-4-a-4-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js",
"description": "Strict Mode - TypeError isn't thrown when deleting configurable accessor property",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = {};\n Object.defineProperty(obj, \"prop\", {\n get: function () {\n return \"abc\"; \n },\n configurable: true\n });\n\n delete obj.prop;\n return !obj.hasOwnProperty(\"prop\");\n }).call(this));\n",
"strict_only": ""
},
{
"id": "11.4.1-4.a-1",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-1.js",
"description": "delete operator returns true when deleting a configurable data property",
"test": "assertTrue((function testcase() {\n var o = {};\n\n var desc = { value: 1, configurable: true };\n Object.defineProperty(o, \"foo\", desc);\n\n var d = delete o.foo;\n if (d === true && o.hasOwnProperty(\"foo\") === false) {\n return true;\n }\n }).call(this));\n",
"precondition": "((fnExists(Object.defineProperty) && fnExists(Object.hasOwnProperty)))"
},
{
"id": "11.4.1-4.a-10",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-10.js",
"description": "delete operator returns true for property (stringify) defined on built-in object (JSON)",
"test": "assertTrue((function testcase() {\n try {\n var o = JSON.stringify;\n\t var desc;\n\t try {\n\t \tdesc = Object.getOwnPropertyDescriptor(JSON, 'stringify')\n\t } \n\t catch (e) {\n\t };\n var d = delete JSON.stringify;\n if (d === true && JSON.stringify === undefined) {\n return true;\n }\n } finally {\n if (desc) Object.defineProperty(JSON, 'stringify', desc)\n\telse JSON.stringify = o /* this branch messes up the attributes */;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-11",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-11.js",
"description": "delete operator returns true on deleting arguments propterties(arguments.callee)",
"test": "assertTrue((function testcase() {\n function foo(a,b)\n {\n return (delete arguments.callee); \n }\n var d = delete arguments.callee;\n if(d === true && arguments.callee === undefined)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-12",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-12.js",
"description": "delete operator returns false when deleting a property(length)",
"test": "assertTrue((function testcase() {\n\n var a = [1,2,3]\n a.x = 10;\n var d = delete a.length\n if(d === false && a.length === 3)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-13",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-13.js",
"description": "delete operator returns false when deleting Array object",
"test": "assertTrue((function testcase() {\n\n var a = [1,2,3]\n a.x = 10;\n\n var d = delete a \n\n if(d === false && Array.isArray(a) === true)\n return true;\n }).call(this));\n",
"precondition": "(fnExists(Array.isArray))"
},
{
"id": "11.4.1-4.a-14",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-14.js",
"description": "delete operator returns true when deleting Array elements",
"test": "assertTrue((function testcase() {\n\n var a = [1,2,3]\n a.x = 10;\n var d = delete a[1]\n if(d === true && a[1] === undefined)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-15",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-15.js",
"description": "delete operator returns true when deleting Array expandos",
"test": "assertTrue((function testcase() {\n\n var a = [1,2,3]\n a.x = 10;\n var d = delete a.x;\n if( d === true && a.x === undefined)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-16",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-16.js",
"description": "delete operator returns false on deleting arguments object",
"test": "assertTrue((function testcase() {\n\n if(delete arguments === false && arguments !== undefined)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-17",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-17.js",
"description": "delete operator returns true on deleting a arguments element",
"test": "assertTrue((function testcase() {\n function foo(a,b)\n {\n var d = delete arguments[0];\n return (d === true && arguments[0] === undefined); \n }\n\n if(foo(1,2) === true)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-2",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-2.js",
"description": "delete operator returns true when deleting a configurable accessor property",
"test": "assertTrue((function testcase() {\n var o = {};\n\n // define an accessor\n // dummy getter\n var getter = function () { return 1; }\n var desc = { get: getter, configurable: true };\n Object.defineProperty(o, \"foo\", desc);\n \n var d = delete o.foo;\n if (d === true && o.hasOwnProperty(\"foo\") === false) {\n return true;\n }\n }).call(this));\n",
"precondition": "((fnExists(Object.defineProperty) && fnExists(Object.hasOwnProperty)))"
},
{
"id": "11.4.1-4.a-3-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js",
"description": "delete operator throws TypeError when deleting a non-configurable data property in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n var o = {};\n var desc = { value : 1 }; // all other attributes default to false\n Object.defineProperty(o, \"foo\", desc);\n \n // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false.\n try {\n delete o.foo;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
},
{
"id": "11.4.1-4.a-3",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-3.js",
"description": "delete operator returns false when deleting a non-configurable data property",
"test": "assertTrue((function testcase() {\n var o = {};\n var desc = { value : 1, configurable: false }; // all other attributes default to false\n Object.defineProperty(o, \"foo\", desc);\n \n // Now, deleting o.foo should fail because [[Configurable]] on foo is false.\n var d = delete o.foo;\n if (d === false && o.hasOwnProperty(\"foo\") === true) {\n return true;\n }\n }).call(this));\n",
"precondition": "((fnExists(Object.defineProperty) && fnExists(Object.hasOwnProperty)))"
},
{
"id": "11.4.1-4.a-4",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-4.js",
"description": "delete operator returns false when deleting a non-configurable data property (NaN)",
"test": "assertTrue((function testcase() {\n // NaN (15.1.1.1) has [[Configurable]] set to false.\n var d = delete NaN;\n if (d === false) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-5",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-5.js",
"description": "delete operator returns false when deleting the environment object inside 'with'",
"test": "assertTrue((function testcase() {\n var o = new Object();\n o.x = 1;\n var d;\n with(o)\n {\n d = delete o;\n }\n if (d === false && typeof(o) === 'object' && o.x === 1) {\n return true;\n }\n return false;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-6",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-6.js",
"description": "delete operator returns true when deleting a property inside 'with'",
"test": "assertTrue((function testcase() {\n var o = new Object();\n o.x = 1;\n var d;\n with(o)\n {\n d = delete x;\n }\n if (d === true && o.x === undefined) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-7",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-7.js",
"description": "delete operator inside 'eval'",
"test": "assertTrue((function testcase() {\n var x = 1;\n var d = eval(\"delete x\");\n if (d === false && x === 1) {\n return true;\n }\n return false;\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-8-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js",
"description": "delete operator throws TypeError when deleting a non-configurable data property in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n \n // NaN (15.1.1.1) has [[Configurable]] set to false.\n try {\n delete fnGlobalObject().NaN;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-4.a-8",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-8.js",
"description": "delete operator returns true for built-in objects (JSON)",
"test": "assertTrue((function testcase() {\n try {\n var o = JSON;\n var d = delete JSON; \n if (d === true) {\t \n return true;\n }\n } finally {\n JSON = o;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-4.a-9-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js",
"description": "delete operator throws TypeError when deleting a non-configurable data property (Math.LN2) in strict mode ",
"test": "assertTrue((function testcase() {\n 'use strict';\n \n try {\n delete Math.LN2;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError); \n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-4.a-9",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-9.js",
"description": "delete operator returns false when deleting a non-configurable data property (Math.LN2)",
"test": "assertTrue((function testcase() {\n var d = delete Math.LN2;\n if (d === false) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "11.4.1-5-1",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-1.js",
"description": "delete operator returns false when deleting a direct reference to a var",
"test": "assertTrue((function testcase() {\n var x = 1;\n\n // Now, deleting 'x' directly should fail;\n var d = delete x;\n if(d === false && x === 1)\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-5-2",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-2.js",
"description": "delete operator returns false when deleting a direct reference to a function argument",
"test": "assertTrue((function testcase() {\n \n function foo(a,b) {\n \n // Now, deleting 'a' directly should fail\n // because 'a' is direct reference to a function argument;\n var d = delete a;\n return (d === false && a === 1);\n }\n return foo(1,2); \n }).call(this));\n"
},
{
"id": "11.4.1-5-3",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-3.js",
"description": "delete operator returns false when deleting a direct reference to a function name",
"test": "assertTrue((function testcase() {\n var foo = function(){};\n\n // Now, deleting 'foo' directly should fail;\n var d = delete foo;\n if(d === false && fnExists(foo))\n return true;\n }).call(this));\n"
},
{
"id": "11.4.1-5-a-1-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive value type (number)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_4_1_5 = 5;\n\n try {\n eval(\"delete _11_4_1_5;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-10-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type Array",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var arrObj = [1,2,3];\n\n try {\n eval(\"delete arrObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-11-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type String",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var strObj = new String(\"abc\");\n\n try {\n eval(\"delete strObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-12-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type Boolean",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var boolObj = new Boolean(false);\n\n try {\n eval(\"delete boolObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-13-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type Number",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var numObj = new Number(0);\n\n try {\n eval(\"delete numObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-14-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type Date",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var dateObj = new Date();\n\n try {\n eval(\"delete dateObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-15-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type RegExp",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var regObj = new RegExp();\n\n try {\n eval(\"delete regObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-16-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type Error",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var errObj = new Error();\n\n try {\n eval(\"delete errObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-17-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type Arguments",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"var argObj = (function (a, b) { delete arguments; }(1, 2));\");\n\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-18-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (Object)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete Object;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-19-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (Function)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete Function;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-2-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a function parameter",
"test": "assertTrue((function testcase() {\n \"use strict\";\n function funObj(x) {\n eval(\"delete x;\");\n }\n\n try {\n funObj(1);\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-20-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (Array)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete Array;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-21-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (String)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete String;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-22-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (Boolean)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete Boolean;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-23-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (Number)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete Number;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-24-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (Date)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete Date;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-25-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (RegExp)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete RegExp;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-26-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a built-in (Error)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"delete Error;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-3-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a function name",
"test": "assertTrue((function testcase() {\n \"use strict\";\n function funObj () { }\n\n try {\n eval(\"delete funObj\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-4-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a function parameter",
"test": "assertTrue((function testcase() {\n \"use strict\";\n function funObj(x, y, z) {\n eval(\"delete y;\");\n }\n\n try {\n funObj(1);\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-5-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (boolean)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_4_1_5 = true;\n\n try {\n eval(\"delete _11_4_1_5;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-6-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (string)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var _11_4_1_5 = \"abc\";\n\n try {\n eval(\"delete _11_4_1_5;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-7-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type Object",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var obj = new Object();\n\n try {\n eval(\"delete obj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-8-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a function object",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var funObj = function () { };\n\n try {\n eval(\"delete funObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.1-5-a-9-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js",
"description": "Strict Mode - SyntaxError is thrown when deleting a variable of type function (declaration)",
"test": "assertTrue((function testcase() {\n \"use strict\";\n function funObj () { };\n\n try {\n eval(\"delete funObj;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.4-4.a-3-s",
"path": "TestCases/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js",
"description": "delete operator throws TypeError when deleting a non-configurable data property in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n var o = {};\n var desc = { value : 1 }; // all other attributes default to false\n Object.defineProperty(o, \"foo\", desc);\n \n // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false.\n try {\n delete o.foo;\n return false;\n }\n catch (e) {\n return (e instanceof TypeError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict() && fnExists(Object.defineProperty))",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,56 @@
{
"testCollection": {
"name": "11.4.1_The_delete_Operator",
"numTests": 8,
"tests": [
{
"section": "11.4.1",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"delete\\u00090\") !== true) {\n $ERROR('#1: delete\\\\u00090 === true');\n}\n\n//CHECK#2\nif (eval(\"delete\\u000B0\") !== true) {\n $ERROR('#2: delete\\\\u000B0 === true'); \n}\n\n//CHECK#3\nif (eval(\"delete\\u000C0\") !== true) {\n $ERROR('#3: delete\\\\u000C0 === true');\n}\n\n//CHECK#4\nif (eval(\"delete\\u00200\") !== true) {\n $ERROR('#4: delete\\\\u00200 === true');\n}\n\n//CHECK#5\nif (eval(\"delete\\u00A00\") !== true) {\n $ERROR('#5: delete\\\\u00A00 === true');\n}\n\n//CHECK#6\nif (eval(\"delete\\u000A0\") !== true) {\n $ERROR('#6: delete\\\\u000A0 === true'); \n}\n\n//CHECK#7\nif (eval(\"delete\\u000D0\") !== true) {\n $ERROR('#7: delete\\\\u000D0 === true');\n}\n\n//CHECK#8\nif (eval(\"delete\\u20280\") !== true) {\n $ERROR('#8: delete\\\\u20280 === true');\n}\n\n//CHECK#9\nif (eval(\"delete\\u20290\") !== true) {\n $ERROR('#9: delete\\\\u20290 === true');\n}\n\n//CHECK#10\nif (eval(\"delete\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290\") !== true) {\n $ERROR('#10: delete\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20290 === true');\n}\n",
"id": "S11.4.1_A1"
},
{
"section": "11.4.1",
"description": "Checking primitive value and Object value cases",
"test": "//CHECK#1\nif (delete 1 !== true) {\n $ERROR('#1: delete 1 === true');\n}\n\n//CHECK#2\nif (delete new Object() !== true) {\n $ERROR('#2: delete new Object() === true');\n}\n\n",
"id": "S11.4.1_A2.1"
},
{
"section": "11.4.1",
"description": "Checking undeclared variable case",
"test": "//CHECK#1\nif (delete x !== true) {\n $ERROR('#1: delete x === true');\n}\n\n//CHECK#2\nif (delete this.x !== true) {\n $ERROR('#2: delete this.x === true');\n}\n",
"id": "S11.4.1_A2.2_T1"
},
{
"section": "11.4.1",
"description": "Checking Object object and Function object cases",
"test": "//CHECK#1\nfunction MyFunction(){}\nvar MyObject = new MyFunction();\nif (delete MyObject.prop !== true) {\n $ERROR('#1: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject.prop === true');\n}\n\n//CHECK#2\nvar MyObject = new Object();\nif (delete MyObject.prop !== true) {\n $ERROR('#2: var MyObject = new Object(); delete MyObject.prop === true');\n}\n",
"id": "S11.4.1_A2.2_T2"
},
{
"section": "11.4.1",
"description": "Checking declared variable",
"test": "//CHECK#1\nvar x = 1;\nif (delete x !== false) {\n $ERROR('#1: var x = 1; delete x === false');\n}\n\n//CHECK#2\nvar y = 1;\nif (delete this.y !== false) {\n $ERROR('#2: var y = 1; delete this.y === false');\n}\n\n//CHECK#3\nfunction MyFunction(){};\nif (delete MyFunction !== false) {\n $ERROR('#3: function MyFunction(){}; delete MyFunction === false');\n}\n\n//CHECK#4\nfunction MyFunction(){};\nvar MyObject = new MyFunction();\nif (delete MyObject !== false) {\n $ERROR('#4: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false');\n}\n\n//CHECK#5\nif (delete MyObject !== false) {\n $ERROR('#5: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false');\n}\n",
"id": "S11.4.1_A3.1"
},
{
"section": "11.4.1",
"description": "Checking declared variable",
"test": "//CHECK#1\nx = 1;\nif (delete x !== true) {\n $ERROR('#1: x = 1; delete x === true');\n}\n\n//CHECK#2\nfunction MyFunction(){};\nMyFunction.prop = 1;\nif (delete MyFunction.prop !== true) {\n $ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop === true');\n}\n\n//CHECK#3\nfunction MyFunction(){};\nvar MyObject = new MyFunction();\nMyObject.prop = 1;\nif (delete MyObject.prop !== true) {\n $ERROR('#3: function MyFunction(){}; var MyObject = new MyFunction(); MyFunction.prop = 1; delete MyObject.prop === true');\n}\n",
"id": "S11.4.1_A3.2"
},
{
"section": "11.4.1",
"description": "Checking declared variable",
"test": "//CHECK#1\ntry {\n x = 1;\n delete x;\n x; \n $ERROR('#1: x = 1; delete x; x is not exist');\n} catch (e) {\n if (e instanceof ReferenceError !== true) {\n $ERROR('#1: x = 1; delete x; x is not exist');\n }\n}\n\n\n//CHECK#2\nfunction MyFunction(){};\nMyFunction.prop = 1;\ndelete MyFunction.prop;\nif (MyFunction.prop !== undefined) {\n $ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop; MyFunction.prop === undefined. Actual: ' + (MyFunction.prop));\n\n}\n\n//CHECK#3\nfunction MyFunction(){};\nvar MyObjectVar = new MyFunction();\nMyObjectVar.prop = 1;\ndelete MyObjectVar.prop;\nif (MyObjectVar.prop !== undefined) {\n $ERROR('#3: function MyFunction(){}; var MyObjectVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectVar.prop; MyObjectVar.prop === undefined. Actual: ' + (MyObjectVar.prop));\n}\n\n//CHECK#4\nif (delete MyObjectVar !== false) {\n $ERROR('#4: function MyFunction(){}; var MyObjectVar = new MyFunction(); delete MyObjectVar === false');\n}\n\n//CHECK#5\nfunction MyFunction(){};\nMyObjectNotVar = new MyFunction();\nMyObjectNotVar.prop = 1;\ndelete MyObjectNotVar.prop;\nif (MyObjectNotVar.prop !== undefined) {\n $ERROR('#5: function MyFunction(){}; MyObjectNotVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectNotVar.prop; MyObjectNotVar.prop === undefined. Actual: ' + (MyObjectNotVar.prop));\n}\n\n//CHECK#6\nif (delete MyObjectNotVar !== true) {\n $ERROR('#6: function MyFunction(){}; var MyObjectNotVar = new MyFunction(); delete MyObjectNotVar === true');\n}\n\n",
"id": "S11.4.1_A3.3"
},
{
"section": "11.4.1",
"description": "Checking two reference by one object",
"test": "//CHECK#1\nobj = new Object();\nref = obj;\ndelete ref;\nif (typeof obj !== \"object\") {\n $ERROR('#1: obj = new Object(); ref = obj; delete ref; typeof obj === \"object\". Actual: ' + (typeof obj));\n}\n\n",
"id": "S11.4.1_A4"
}
]
}
}

View File

@ -0,0 +1,63 @@
{
"testCollection": {
"name": "11.4.2_The_void_Operator",
"numTests": 9,
"tests": [
{
"section": "11.4.2",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"void\\u00090\") !== undefined) {\n $ERROR('#1: void\\\\u00090 === undefined');\n}\n\n//CHECK#2\nif (eval(\"void\\u000B0\") !== undefined) {\n $ERROR('#2: void\\\\u000B0 === undefined'); \n}\n\n//CHECK#3\nif (eval(\"void\\u000C0\") !== undefined) {\n $ERROR('#3: void\\\\u000C0 === undefined');\n}\n\n//CHECK#4\nif (eval(\"void\\u00200\") !== undefined) {\n $ERROR('#4: void\\\\u00200 === undefined');\n}\n\n//CHECK#5\nif (eval(\"void\\u00A00\") !== undefined) {\n $ERROR('#5: void\\\\u00A00 === undefined');\n}\n\n//CHECK#6\nif (eval(\"void\\u000A0\") !== undefined) {\n $ERROR('#6: void\\\\u000A0 === undefined'); \n}\n\n//CHECK#7\nif (eval(\"void\\u000D0\") !== undefined) {\n $ERROR('#7: void\\\\u000D0 === undefined');\n}\n\n//CHECK#8\nif (eval(\"void\\u20280\") !== undefined) {\n $ERROR('#8: void\\\\u20280 === undefined');\n}\n\n//CHECK#9\nif (eval(\"void\\u20290\") !== undefined) {\n $ERROR('#9: void\\\\u20290 === undefined');\n}\n\n//CHECK#10\nif (eval(\"void\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290\") !== undefined) {\n $ERROR('#10: void\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20290 === undefined');\n}\n",
"id": "S11.4.2_A1"
},
{
"section": "11.4.2",
"description": "Either Type(x) is not Reference or GetBase(x) is not null",
"test": "//CHECK#1\nif (void 0 !== undefined) {\n $ERROR('#1: void 0 === undefined. Actual: ' + (void 0));\n}\n\n//CHECK#2\nvar x = 0;\nif (void x !== undefined) {\n $ERROR('#2: var x = 0; void x === undefined. Actual: ' + (void x));\n}\n\n//CHECK#3\nvar x = new Object();\nif (void x !== undefined) {\n $ERROR('#3: var x = new Object(); void x === undefined. Actual: ' + (void x));\n}\n",
"id": "S11.4.2_A2_T1"
},
{
"section": "11.4.2",
"description": "If GetBase(x) is null, throw ReferenceError",
"negative": "",
"test": "//CHECK#1\nvoid x;\n",
"id": "S11.4.2_A2_T2"
},
{
"section": "11.4.2",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = false; \nif (void x !== undefined) {\n $ERROR('#1: var x = false; void x === undefined. Actual: ' + (void x));\n}\n\n//CHECK#2\nvar x = new Boolean(true);\nif (void x !== undefined) {\n $ERROR('#2: var x = new Boolean(true); void x === undefined. Actual: ' + (void x));\n}\n",
"id": "S11.4.2_A4_T1"
},
{
"section": "11.4.2",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 0.1;\nif (void x !== undefined) {\n $ERROR('#1: var x = 0.1; void x === undefined. Actual: ' + (void x));\n}\n\n//CHECK#2\nvar x = new Number(-1.1);\nif (void x !== undefined) {\n $ERROR('#2: var x = new Number(-1.1); void x === undefined. Actual: ' + (void x));\n}\n",
"id": "S11.4.2_A4_T2"
},
{
"section": "11.4.2",
"description": "Type(x) is string primitive of String object",
"test": "//CHECK#1\nvar x = \"1\";\nif (void x !== undefined) {\n $ERROR('#1: var x = \"1\"; void x === undefined. Actual: ' + (void x));\n}\n\n//CHECK#2\nvar x = \"x\"; \nif (isNaN(void x) !== true) {\n $ERROR('#2: var x = \"x\"; void x === undefined. Actual: ' + (void x));\n}\n\n//CHECK#3\nvar x = new String(\"-1\");\nif (void x !== undefined) {\n $ERROR('#3: var x = new String(\"-1\"); void x === undefined. Actual: ' + (void x));\n}\n",
"id": "S11.4.2_A4_T3"
},
{
"section": "11.4.2",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x; \nif (isNaN(void x) !== true) {\n $ERROR('#1: var x; void x === undefined. Actual: ' + (void x));\n}\n\n//CHECK#2\nvar x = null;\nif (void x !== undefined) {\n $ERROR('#2: var x = null; void x === undefined. Actual: ' + (void x));\n}\n",
"id": "S11.4.2_A4_T4"
},
{
"section": "11.4.2",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \nif (isNaN(void x) !== true) {\n $ERROR('#1: var x = {}; void x === undefined. Actual: ' + (void x));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \nif (isNaN(void x) !== true) {\n $ERROR('#2: var x = function(){return 1}; void x === undefined. Actual: ' + (void x));\n}\n",
"id": "S11.4.2_A4_T5"
},
{
"section": "11.4.2",
"description": "Checking Simple Assignment operator",
"test": "//CHECK#1\nvar x = 0;\nif (void (x = 1) !== undefined) {\n $ERROR('#1: var x = 0; void (x = 1) === undefined. Actual: ' + (void (x = 1)));\n} else {\n if (x !== 1) {\n $ERROR('#1: var x = 0; void (x = 1); x === 1. Actual: ' + (x));\n } \n}\n",
"id": "S11.4.2_A4_T6"
}
]
}
}

View File

@ -0,0 +1,68 @@
{
"testCollection": {
"name": "11.4.3_The_typeof_Operator",
"numTests": 10,
"tests": [
{
"section": "11.4.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"var x = 0; typeof\\u0009x\") !== \"number\") {\n $ERROR('#1: var x = 0; typeof\\\\u0009x; x === \"number\". Actual: ' + (x));\n}\n\n//CHECK#2\nif (eval(\"var x = 0; typeof\\u000Bx\") !== \"number\") {\n $ERROR('#2: var x = 0; typeof\\\\u000Bx; x === \"number\". Actual: ' + (x)); \n}\n\n//CHECK#3\nif (eval(\"var x = 0; typeof\\u000Cx\") !== \"number\") {\n $ERROR('#3: var x = 0; typeof\\\\u000Cx; x === \"number\". Actual: ' + (x));\n}\n\n//CHECK#4\nif (eval(\"var x = 0; typeof\\u0020x\") !== \"number\") {\n $ERROR('#4: var x = 0; typeof\\\\u0020x; x === \"number\". Actual: ' + (x));\n}\n\n//CHECK#5\nif (eval(\"var x = 0; typeof\\u00A0x\") !== \"number\") {\n $ERROR('#5: var x = 0; typeof\\\\u00A0x; x === \"number\". Actual: ' + (x));\n}\n\n//CHECK#6\nif (eval(\"var x = 0; typeof\\u000Ax\") !== \"number\") {\n $ERROR('#6: var x = 0; typeof\\\\u000Ax; x === \"number\". Actual: ' + (x)); \n}\n\n//CHECK#7\nif (eval(\"var x = 0; typeof\\u000Dx\") !== \"number\") {\n $ERROR('#7: var x = 0; typeof\\\\u000Dx; x === \"number\". Actual: ' + (x));\n}\n\n//CHECK#8\nif (eval(\"var x = 0; typeof\\u2028x\") !== \"number\") {\n $ERROR('#8: var x = 0; typeof\\\\u2028x; x === \"number\". Actual: ' + (x));\n}\n\n//CHECK#9\nif (eval(\"var x = 0; typeof\\u2029x\") !== \"number\") {\n $ERROR('#9: var x = 0; typeof\\\\u2029x; x === \"number\". Actual: ' + (x));\n}\n\n//CHECK#10\nif (eval(\"var x = 0; typeof\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x\") !== \"number\") {\n $ERROR('#10: var x = 0; typeof\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029x; x === \"number\". Actual: ' + (x));\n}\n",
"id": "S11.4.3_A1"
},
{
"section": "11.4.3",
"description": "Either Type(x) is not Reference or GetBase(x) is not null",
"test": "//CHECK#1\nif (typeof 0 !== \"number\") {\n $ERROR('#1: typeof 0 === \"number\". Actual: ' + (typeof 0));\n}\n\n//CHECK#2\nvar x = 0;\nif (typeof x !== \"number\") {\n $ERROR('#2: typeof x === \"number\". Actual: ' + (typeof x));\n}\n\n//CHECK#3\nvar x = new Object();\nif (typeof x !== \"object\") {\n $ERROR('#3: var x = new Object(); typeof x === \"object\". Actual: ' + (typeof x));\n}\n",
"id": "S11.4.3_A2_T1"
},
{
"section": "11.4.3",
"description": "If GetBase(x) is null, return \"undefined\"",
"test": "//CHECK#1\nif (typeof x !== \"undefined\") {\n $ERROR('#1: typeof x === \"undefined\". Actual: ' + (typeof x));\n}\n",
"id": "S11.4.3_A2_T2"
},
{
"section": "11.4.3",
"description": "typeof undefined === \"undefined\"",
"test": "//CHECK#1\nif (typeof undefined !== \"undefined\") {\n $ERROR('#1: typeof undefined === \"undefined\". Actual: ' + (typeof undefined));\n}\n\n//CHECK#2\nif (typeof void 0 !== \"undefined\") {\n $ERROR('#2: typeof void 0 === \"undefined\". Actual: ' + (typeof void 0));\n}\n",
"id": "S11.4.3_A3.1"
},
{
"section": "11.4.3",
"description": "typeof null === \"object\"",
"test": "//CHECK#1\nif (typeof null !== \"object\") {\n $ERROR('#1: typeof null === \"object\". Actual: ' + (typeof null));\n}\n\n//CHECK#2\nif (typeof RegExp(\"0\").exec(\"1\") !== \"object\") {\n $ERROR('#2: typeof RegExp(\"0\").exec(\"1\") === \"object\". Actual: ' + (typeof RegExp(\"0\").exec(\"1\")));\n}\n",
"id": "S11.4.3_A3.2"
},
{
"section": "11.4.3",
"description": "typeof (boolean value) === \"boolean\"",
"test": "//CHECK#1\nif (typeof true !== \"boolean\") {\n $ERROR('#1: typeof true === \"boolean\". Actual: ' + (typeof true));\n}\n\n//CHECK#2\nif (typeof false !== \"boolean\") {\n $ERROR('#2: typeof false === \"boolean\". Actual: ' + (typeof false));\n}\n\n//CHECK#3\nif (typeof !-1 !== \"boolean\") {\n $ERROR('#3: typeof !-1 === \"boolean\". Actual: ' + (typeof !-1));\n}\n",
"id": "S11.4.3_A3.3"
},
{
"section": "11.4.3",
"description": "typeof (number value) === \"number\"",
"test": "//CHECK#1\nif (typeof 1 !== \"number\") {\n $ERROR('#1: typeof 1 === \"number\". Actual: ' + (typeof 1));\n}\n\n//CHECK#2\nif (typeof Number.NaN !== \"number\") {\n $ERROR('#2: typeof NaN === \"number\". Actual: ' + (typeof NaN));\n}\n\n//CHECK#3\nif (typeof Number.POSITIVE_INFINITY !== \"number\") {\n $ERROR('#3: typeof Infinity === \"number\". Actual: ' + (typeof Infinity));\n}\n\n//CHECK#4\nif (typeof Number.NEGATIVE_INFINITY !== \"number\") {\n $ERROR('#4: typeof -Infinity === \"number\". Actual: ' + (typeof -Infinity));\n}\n\n//CHECK#5\nif (typeof Math.PI !== \"number\") {\n $ERROR('#5: typeof Math.PI === \"number\". Actual: ' + (typeof Math.PI));\n}\n",
"id": "S11.4.3_A3.4"
},
{
"section": "11.4.3",
"description": "typeof (string value) === \"string\"",
"test": "//CHECK#1\nif (typeof \"1\" !== \"string\") {\n $ERROR('#1: typeof \"1\" === \"string\". Actual: ' + (typeof \"1\"));\n}\n\n//CHECK#2\nif (typeof \"NaN\" !== \"string\") {\n $ERROR('#2: typeof \"NaN\" === \"string\". Actual: ' + (typeof \"NaN\"));\n}\n\n//CHECK#3\nif (typeof \"Infinity\" !== \"string\") {\n $ERROR('#3: typeof \"Infinity\" === \"string\". Actual: ' + (typeof \"Infinity\"));\n}\n\n//CHECK#4\nif (typeof \"\" !== \"string\") {\n $ERROR('#4: typeof \"\" === \"string\". Actual: ' + (typeof \"\"));\n}\n\n//CHECK#5\nif (typeof \"true\" !== \"string\") {\n $ERROR('#5: typeof \"true\" === \"string\". Actual: ' + (typeof \"true\"));\n}\n\n//CHECK#6\nif (typeof Date() !== \"string\") {\n $ERROR('#6: typeof Date() === \"string\". Actual: ' + (typeof Date()));\n}\n",
"id": "S11.4.3_A3.5"
},
{
"section": "11.4.3",
"description": "typeof (object without [[Call]]) === \"object\"",
"test": "//CHECK#1\nif (typeof this !== \"object\") {\n $ERROR('#1: typeof this === \"object\". Actual: ' + (typeof this));\n}\n\n//CHECK#2\nif (typeof new Object() !== \"object\") {\n $ERROR('#2: typeof new Object() === \"object\". Actual: ' + (typeof new Object()));\n}\n\n//CHECK#3\nif (typeof new Array(1,2,3) !== \"object\") {\n $ERROR('#3: typeof new Array(1,2,3) === \"object\". Actual: ' + (typeof new Array(1,2,3)));\n}\n\n//CHECK#4\nif (typeof Array(1,2,3) !== \"object\") {\n $ERROR('#4: typeof Array(1,2,3) === \"object\". Actual: ' + (typeof Array(1,2,3)));\n}\n\n//CHECK#5\nif (typeof new String(\"x\") !== \"object\") {\n $ERROR('#5: typeof new String(\"x\") === \"object\". Actual: ' + (typeof new String(\"x\")));\n}\n\n//CHECK#6\nif (typeof new Boolean(true) !== \"object\") {\n $ERROR('#6: typeof new Boolean(true) === \"object\". Actual: ' + (typeof new Boolean(true)));\n}\n\n//CHECK#7\nif (typeof new Number(1) !== \"object\") {\n $ERROR('#7: typeof new Number(1) === \"object\". Actual: ' + (typeof new Number(1)));\n}\n\n//CHECK#8\n//The Math object does not have a [[Construct]] property; \n//it is not possible to use the Math object as a constructor with the new operator.\n//The Math object does not have a [[Call]] property; it is not possible to invoke the Math object as a object.\nif (typeof Math !== \"object\") {\n $ERROR('#8: typeof Math === \"object\". Actual: ' + (typeof Math));\n}\n\n//CHECK#9\nif (typeof new Date() !== \"object\") {\n $ERROR('#9: typeof new Date() === \"object\". Actual: ' + (typeof new Date()));\n}\n\n//CHECK#10\nif (typeof new Error() !== \"object\") {\n $ERROR('#10: typeof new Error() === \"object\". Actual: ' + (typeof new Error()));\n}\n\n//CHECK#11\nif (typeof new RegExp() !== \"object\") {\n $ERROR('#11: typeof new RegExp() === \"object\". Actual: ' + (typeof new RegExp()));\n}\n\n//CHECK#12\nif (typeof RegExp() !== \"object\") {\n $ERROR('#12: typeof RegExp() === \"object\". Actual: ' + (typeof RegExp()));\n}\n",
"id": "S11.4.3_A3.6"
},
{
"section": "11.4.3",
"description": "typeof (object with [[Call]]) === \"function\"",
"test": "//CHECK#1\nif (typeof new Function() !== \"function\") {\n $ERROR('#1: typeof new Function() === \"function\". Actual: ' + (typeof new Function()));\n}\n\n//CHECK#2\nif (typeof Function() !== \"function\") {\n $ERROR('#2: typeof Function() === \"function\". Actual: ' + (typeof Function()));\n}\n\n//CHECK#3\nif (typeof Object !== \"function\") {\n $ERROR('#3: typeof Object === \"function\". Actual: ' + (typeof Object));\n}\n\n//CHECK#4\nif (typeof String !== \"function\") {\n $ERROR('#4: typeof String === \"function\". Actual: ' + (typeof String));\n}\n\n//CHECK5\nif (typeof Boolean !== \"function\") {\n $ERROR('#5: typeof Boolean === \"function\". Actual: ' + (typeof Boolean));\n}\n\n//CHECK#6\nif (typeof Number !== \"function\") {\n $ERROR('#6: typeof Number === \"function\". Actual: ' + (typeof Number));\n}\n\n//CHECK#7\nif (typeof Date !== \"function\") {\n $ERROR('#7: typeof Date === \"function\". Actual: ' + (typeof Date));\n}\n\n//CHECK#8\nif (typeof Error !== \"function\") {\n $ERROR('#8: typeof Error === \"function\". Actual: ' + (typeof Error));\n}\n\n//CHECK#9\nif (typeof RegExp !== \"function\") {\n $ERROR('#9: typeof RegExp === \"function\". Actual: ' + (typeof RegExp));\n}\n",
"id": "S11.4.3_A3.7"
}
]
}
}

View File

@ -0,0 +1,24 @@
{
"testCollection": {
"name": "11.4.4",
"numTests": 2,
"tests": [
{
"id": "11.4.4-2-1-s",
"path": "TestCases/chapter11/11.4/11.4.4/11.4.4-2-1-s.js",
"description": "Strict Mode - SyntaxError is thrown for ++eval",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"++eval;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.4-2-2-s",
"path": "TestCases/chapter11/11.4/11.4.4/11.4.4-2-2-s.js",
"description": "Strict Mode - SyntaxError is thrown for ++arguments",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"++arguments;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,99 @@
{
"testCollection": {
"name": "11.4.4_Prefix_Increment_Operator",
"numTests": 15,
"tests": [
{
"section": "11.4.4, 11.6.3, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"var x = 0; ++\\u0009x\") !== 1) {\n $ERROR('#1: var x = 0; ++\\\\u0009x; x === 1. Actual: ' + (x));\n}\n\n//CHECK#2\nif (eval(\"var x = 0; ++\\u000Bx\") !== 1) {\n $ERROR('#2: var x = 0; ++\\\\u000Bx; x === 1. Actual: ' + (x)); \n}\n\n//CHECK#3\nif (eval(\"var x = 0; ++\\u000Cx\") !== 1) {\n $ERROR('#3: var x = 0; ++\\\\u000Cx; x === 1. Actual: ' + (x));\n}\n\n//CHECK#4\nif (eval(\"var x = 0; ++\\u0020x\") !== 1) {\n $ERROR('#4: var x = 0; ++\\\\u0020x; x === 1. Actual: ' + (x));\n}\n\n//CHECK#5\nif (eval(\"var x = 0; ++\\u00A0x\") !== 1) {\n $ERROR('#5: var x = 0; ++\\\\u00A0x; x === 1. Actual: ' + (x));\n}\n\n//CHECK#6\nif (eval(\"var x = 0; ++\\u000Ax\") !== 1) {\n $ERROR('#6: var x = 0; ++\\\\u000Ax; x === 1. Actual: ' + (x)); \n}\n\n//CHECK#7\nif (eval(\"var x = 0; ++\\u000Dx\") !== 1) {\n $ERROR('#7: var x = 0; ++\\\\u000Dx; x === 1. Actual: ' + (x));\n}\n\n//CHECK#8\nif (eval(\"var x = 0; ++\\u2028x\") !== 1) {\n $ERROR('#8: var x = 0; ++\\\\u2028x; x === 1. Actual: ' + (x));\n}\n\n//CHECK#9\nif (eval(\"var x = 0; ++\\u2029x\") !== 1) {\n $ERROR('#9: var x = 0; ++\\\\u2029x; x === 1. Actual: ' + (x));\n}\n\n//CHECK#10\nif (eval(\"var x = 0; ++\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x\") !== 1) {\n $ERROR('#10: var x = 0; ++\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029x; x === 1. Actual: ' + (x));\n}\n",
"id": "S11.4.4_A1"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is Reference and GetBase(x) is not null",
"test": "//CHECK#1\nvar x = 1;\nif (++x !== 1 + 1) {\n $ERROR('#1: var x = 1; ++x === 1 + 1. Actual: ' + (++x));\n} else {\n if (x !== 1 + 1) {\n $ERROR('#1: var x = 1; ++x; x === 1 + 1. Actual: ' + (x));\n } \n}\n\n//CHECK#2\nthis.x = 1;\nif (++this.x !== 1 + 1) {\n $ERROR('#2: this.x = 1; ++this.x === 1 + 1. Actual: ' + (++this.x));\n} else {\n if (this.x !== 1 + 1) {\n $ERROR('#2: this.x = 1; ++this.x; this.x === 1 + 1. Actual: ' + (this.x));\n } \n}\n\n//CHECK#3\nvar object = new Object();\nobject.prop = 1;\nif (++object.prop !== 1 + 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; ++object.prop === 1 + 1. Actual: ' + (++object.prop));\n} else {\n if (this.x !== 1 + 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; ++object.prop; object.prop === 1 + 1. Actual: ' + (object.prop));\n } \n}\n",
"id": "S11.4.4_A2.1_T1"
},
{
"section": "11.4.4, 11.6.3",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n ++x;\n $ERROR('#1.1: ++x throw ReferenceError. Actual: ' + (++x)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: ++x throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.4.4_A2.1_T2"
},
{
"section": "11.4.4, 11.6.3",
"description": "If Type(x) is not Reference, throw ReferenceError (or SyntaxError)",
"negative": "",
"test": "//CHECK#1\ntry {\n ++1;\n $ERROR('#1.1: ++1 throw ReferenceError (or SyntaxError). Actual: ' + (++1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: ++1 throw ReferenceError (or SyntaxError). Actual: ' + (e)); \n } else {\n ++1;\n }\n}\n\n",
"id": "S11.4.4_A2.1_T3"
},
{
"section": "11.4.4, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nvar object = {valueOf: function() {return 1}};\nif (++object !== 1 + 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; ++object === 1 + 1. Actual: ' + (++object));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; ++object; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return 1}, toString: function() {return 0}};\nif (++object !== 1 + 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; ++object === 1 + 1. Actual: ' + (++object));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; ++object; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#3\nvar object = {valueOf: function() {return 1}, toString: function() {return {}}};\nif (++object !== 1 + 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; ++object === 1 + 1. Actual: ' + (++object));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; ++object; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#4\ntry {\n var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}};\n if (++object !== 1 + 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; ++object === 1 + 1. Actual: ' + (++object));\n } else {\n if (object !== 1 + 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; ++object; object === 1 + 1. Actual: ' + (object));\n }\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; ++object not throw \"error\"');\n } else {\n $ERROR('#4.3: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; ++object not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nvar object = {toString: function() {return 1}};\nif (++object !== 1 + 1) {\n $ERROR('#5.1: var object = {toString: function() {return 1}}; ++object === 1 + 1. Actual: ' + (++object));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#5.2: var object = {toString: function() {return 1}}; ++object; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return 1}}\nif (++object !== 1 + 1) {\n $ERROR('#6.1: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; ++object === 1 + 1. Actual: ' + (++object));\n} else {\n if (object !== 1 + 1) {\n $ERROR('#6.2: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; ++object; object === 1 + 1. Actual: ' + (object));\n }\n}\n\n//CHECK#7\ntry {\n var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n ++object;\n $ERROR('#7.1: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; ++object throw \"error\". Actual: ' + (++object));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; ++object throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n var object = {valueOf: function() {return {}}, toString: function() {return {}}};\n ++object;\n $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; ++object throw TypeError. Actual: ' + (++object));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; ++object throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.4.4_A2.2_T1"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = false; \n++x;\nif (x !== 0 + 1) {\n $ERROR('#1: var x = false; ++x; x === 0 + 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Boolean(true); \n++x; \nif (x !== 1 + 1) {\n $ERROR('#2: var x = new Boolean(true); ++x; x === 1 + 1. Actual: ' + (x));\n}\n",
"id": "S11.4.4_A3_T1"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 0.1; \n++x;\nif (x !== 0.1 + 1) {\n $ERROR('#1: var x = 0.1; ++x; x === 0.1 + 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Number(-1.1); \n++x;\nif (x !== -1.1 + 1) {\n $ERROR('#2: var x = new Number(-1.1); ++x; x === -1.1 + 1. Actual: ' + (x));\n}\n",
"id": "S11.4.4_A3_T2"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nvar x = \"1\"; \n++x;\nif (x !== 1 + 1) {\n $ERROR('#1: var x = \"1\"; ++x; x === 1 + 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = \"x\"; \n++x; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = \"x\"; ++x; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#3\nvar x = new Number(\"-1\"); \n++x;\nif (x !== -1 + 1) {\n $ERROR('#3: var x = new String(\"-1\"); ++x; x === -1 + 1. Actual: ' + (x));\n}\n",
"id": "S11.4.4_A3_T3"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x; \n++x; \nif (isNaN(x) !== true) {\n $ERROR('#1: var x; ++x; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = null; \n++x;\nif (x !== 1) {\n $ERROR('#2: var x = null; ++x; x === 1. Actual: ' + (x));\n}\n",
"id": "S11.4.4_A3_T4"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \n++x; \nif (isNaN(x) !== true) {\n $ERROR('#1: var x = {}; ++x; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \n++x; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = function(){return 1}; ++x; x === Not-a-Number. Actual: ' + (x));\n}\n",
"id": "S11.4.4_A3_T5"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = false; \nif (++x !== 0 + 1) {\n $ERROR('#1: var x = false; ++x === 0 + 1. Actual: ' + (++x));\n}\n\n//CHECK#2\nvar x = new Boolean(true);\nif (++x !== 1 + 1) {\n $ERROR('#2: var x = new Boolean(true); ++x === 1 + 1. Actual: ' + (++x));\n}\n",
"id": "S11.4.4_A4_T1"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 0.1;\nif (++x !== 0.1 + 1) {\n $ERROR('#1: var x = 0.1; ++x === 0.1 + 1. Actual: ' + (++x));\n}\n\n//CHECK#2\nvar x = new Number(-1.1);\nif (++x !== -1.1 + 1) {\n $ERROR('#2: var x = new Number(-1.1); ++x === -1.1 + 1. Actual: ' + (++x));\n}\n",
"id": "S11.4.4_A4_T2"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nvar x = \"1\";\nif (++x !== 1 + 1) {\n $ERROR('#1: var x = \"1\"; ++x === 1 + 1. Actual: ' + (++x));\n}\n\n//CHECK#2\nvar x = \"x\"; \nif (isNaN(++x) !== true) {\n $ERROR('#2: var x = \"x\"; ++x === Not-a-Number. Actual: ' + (++x));\n}\n\n//CHECK#3\nvar x = new String(\"-1\");\nif (++x !== -1 + 1) {\n $ERROR('#3: var x = new String(\"-1\"); ++x === -1 + 1. Actual: ' + (++x));\n}\n",
"id": "S11.4.4_A4_T3"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x; \nif (isNaN(++x) !== true) {\n $ERROR('#1: var x; ++x === Not-a-Number. Actual: ' + (++x));\n}\n\n//CHECK#2\nvar x = null;\nif (++x !== 1) {\n $ERROR('#2: var x = null; ++x === 1. Actual: ' + (++x));\n}\n",
"id": "S11.4.4_A4_T4"
},
{
"section": "11.4.4, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \nif (isNaN(++x) !== true) {\n $ERROR('#1: var x = {}; ++x === Not-a-Number. Actual: ' + (++x));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \nif (isNaN(++x) !== true) {\n $ERROR('#2: var x = function(){return 1}; ++x === Not-a-Number. Actual: ' + (++x));\n}\n",
"id": "S11.4.4_A4_T5"
}
]
}
}

View File

@ -0,0 +1,24 @@
{
"testCollection": {
"name": "11.4.5",
"numTests": 2,
"tests": [
{
"id": "11.4.5-2-1-s",
"path": "TestCases/chapter11/11.4/11.4.5/11.4.5-2-1-s.js",
"description": "Strict Mode - SyntaxError is thrown for --eval",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = eval;\n try {\n eval(\"--eval;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === eval;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "11.4.5-2-2-s",
"path": "TestCases/chapter11/11.4/11.4.5/11.4.5-2-2-s.js",
"description": "Strict Mode - SyntaxError is thrown for --arguments",
"test": "assertTrue((function testcase() {\n \"use strict\";\n var blah = arguments;\n try {\n eval(\"--arguments;\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError && blah === arguments;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,99 @@
{
"testCollection": {
"name": "11.4.5_Prefix_Decrement_Operator",
"numTests": 15,
"tests": [
{
"section": "11.4.5, 11.6.3, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"var x = 1; --\\u0009x\") !== 0) {\n $ERROR('#1: var x = 1; --\\\\u0009x; x === 0. Actual: ' + (x));\n}\n\n//CHECK#2\nif (eval(\"var x = 1; --\\u000Bx\") !== 0) {\n $ERROR('#2: var x = 1; --\\\\u000Bx; x === 0. Actual: ' + (x)); \n}\n\n//CHECK#3\nif (eval(\"var x = 1; --\\u000Cx\") !== 0) {\n $ERROR('#3: var x = 1; --\\\\u000Cx; x === 0. Actual: ' + (x));\n}\n\n//CHECK#4\nif (eval(\"var x = 1; --\\u0020x\") !== 0) {\n $ERROR('#4: var x = 1; --\\\\u0020x; x === 0. Actual: ' + (x));\n}\n\n//CHECK#5\nif (eval(\"var x = 1; --\\u00A0x\") !== 0) {\n $ERROR('#5: var x = 1; --\\\\u00A0x; x === 0. Actual: ' + (x));\n}\n\n//CHECK#6\nif (eval(\"var x = 1; --\\u000Ax\") !== 0) {\n $ERROR('#6: var x = 1; --\\\\u000Ax; x === 0. Actual: ' + (x)); \n}\n\n//CHECK#7\nif (eval(\"var x = 1; --\\u000Dx\") !== 0) {\n $ERROR('#7: var x = 1; --\\\\u000Dx; x === 0. Actual: ' + (x));\n}\n\n//CHECK#8\nif (eval(\"var x = 1; --\\u2028x\") !== 0) {\n $ERROR('#8: var x = 1; --\\\\u2028x; x === 0. Actual: ' + (x));\n}\n\n//CHECK#9\nif (eval(\"var x = 1; --\\u2029x\") !== 0) {\n $ERROR('#9: var x = 1; --\\\\u2029x; x === 0. Actual: ' + (x));\n}\n\n//CHECK#10\nif (eval(\"var x = 1; --\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x\") !== 0) {\n $ERROR('#10: var x = 1; --\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029x; x === 0. Actual: ' + (x));\n}\n",
"id": "S11.4.5_A1"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is Reference and GetBase(x) is not null",
"test": "//CHECK#1\nvar x = 1;\nif (--x !== 1 - 1) {\n $ERROR('#1: var x = 1; --x === 1 - 1. Actual: ' + (--x));\n} else {\n if (x !== 1 - 1) {\n $ERROR('#1: var x = 1; --x; x === 1 - 1. Actual: ' + (x));\n } \n}\n\n//CHECK#2\nthis.x = 1;\nif (--this.x !== 1 - 1) {\n $ERROR('#2: this.x = 1; --this.x === 1 - 1. Actual: ' + (--this.x));\n} else {\n if (this.x !== 1 - 1) {\n $ERROR('#2: this.x = 1; --this.x; this.x === 1 - 1. Actual: ' + (this.x));\n } \n}\n\n//CHECK#3\nvar object = new Object();\nobject.prop = 1;\nif (--object.prop !== 1 - 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; --object.prop === 1 - 1. Actual: ' + (--object.prop));\n} else {\n if (this.x !== 1 - 1) {\n $ERROR('#3: var object = new Object(); object.prop = 1; --object.prop; object.prop === 1 - 1. Actual: ' + (object.prop));\n } \n}\n",
"id": "S11.4.5_A2.1_T1"
},
{
"section": "11.4.5, 11.6.3",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n --x;\n $ERROR('#1.1: --x throw ReferenceError. Actual: ' + (--x)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: --x throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.4.5_A2.1_T2"
},
{
"section": "11.4.5, 11.6.3",
"description": "If Type(x) is not Reference, throw ReferenceError (or SyntaxError)",
"negative": "",
"test": "//CHECK#1\ntry {\n --1;\n $ERROR('#1.1: --1 throw ReferenceError (or SyntaxError). Actual: ' + (--1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: --1 throw ReferenceError (or SyntaxError). Actual: ' + (e)); \n } else {\n --1;\n }\n}\n",
"id": "S11.4.5_A2.1_T3"
},
{
"section": "11.4.5, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nvar object = {valueOf: function() {return 1}};\nif (--object !== 1 - 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; --object === 1 - 1. Actual: ' + (--object));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; --object; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return 1}, toString: function() {return 0}};\nif (--object !== 1 - 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; --object === 1 - 1. Actual: ' + (--object));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; --object; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#3\nvar object = {valueOf: function() {return 1}, toString: function() {return {}}};\nif (--object !== 1 - 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; --object === 1 - 1. Actual: ' + (--object));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; --object; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#4\ntry {\n var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}};\n if (--object !== 1 - 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; --object === 1 - 1. Actual: ' + (--object));\n } else {\n if (object !== 1 - 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; --object; object === 1 - 1. Actual: ' + (object));\n }\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; --object not throw \"error\"');\n } else {\n $ERROR('#4.3: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; --object not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nvar object = {toString: function() {return 1}};\nif (--object !== 1 - 1) {\n $ERROR('#5.1: var object = {toString: function() {return 1}}; --object === 1 - 1. Actual: ' + (--object));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#5.2: var object = {toString: function() {return 1}}; --object; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return 1}}\nif (--object !== 1 - 1) {\n $ERROR('#6.1: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; --object === 1 - 1. Actual: ' + (--object));\n} else {\n if (object !== 1 - 1) {\n $ERROR('#6.2: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; --object; object === 1 - 1. Actual: ' + (object));\n }\n}\n\n//CHECK#7\ntry {\n var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n --object;\n $ERROR('#7.1: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; --object throw \"error\". Actual: ' + (--object));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; --object throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n var object = {valueOf: function() {return {}}, toString: function() {return {}}};\n --object;\n $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; --object throw TypeError. Actual: ' + (--object));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; --object throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.4.5_A2.2_T1"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = true; \n--x;\nif (x !== 1 - 1) {\n $ERROR('#1: var x = true; --x; x === 1 - 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Boolean(false); \n--x;\nif (x !== 0 - 1) {\n $ERROR('#2: var x = new Boolean(false); --x; x === 0 - 1. Actual: ' + (x));\n}\n",
"id": "S11.4.5_A3_T1"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 0.1; \n--x;\nif (x !== 0.1 - 1) {\n $ERROR('#1: var x = 0.1; --x; x === 0.1 - 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = new Number(-1.1); \n--x;\nif (x !== -1.1 - 1) {\n $ERROR('#2: var x = new Number(-1.1); --x; x === -1.1 - 1. Actual: ' + (x));\n}\n",
"id": "S11.4.5_A3_T2"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is primitive string or String object",
"test": "//CHECK#1\nvar x = \"1\"; \n--x;\nif (x !== 1 - 1) {\n $ERROR('#1: var x = \"1\"; --x; x === 1 - 1. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = \"x\"; \n--x; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = \"x\"; --x; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#3\nvar x = new Number(\"-1\"); \n--x;\nif (x !== -1 - 1) {\n $ERROR('#3: var x = new String(\"-1\"); --x; x === -1 - 1. Actual: ' + (x));\n}\n",
"id": "S11.4.5_A3_T3"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x; \n--x;\nif (isNaN(x) !== true) {\n $ERROR('#1: var x; --x; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = null; \n--x;\nif (x !== -1) {\n $ERROR('#2: var x = null; --x; x === -1. Actual: ' + (x));\n}\n",
"id": "S11.4.5_A3_T4"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \n--x; \nif (isNaN(x) !== true) {\n $ERROR('#1: var x = {}; --x; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \n--x; \nif (isNaN(x) !== true) {\n $ERROR('#2: var x = function(){return 1}; --x; x === Not-a-Number. Actual: ' + (x));\n}\n",
"id": "S11.4.5_A3_T5"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nvar x = true;\nif (--x !== 1 - 1) {\n $ERROR('#1: var x = true; --x === 1 - 1. Actual: ' + (--x));\n}\n\n//CHECK#2\nvar x = new Boolean(false);\nif (--x !== 0 - 1) {\n $ERROR('#2: var x = new Boolean(false); --x === 0 - 1. Actual: ' + (--x));\n}\n",
"id": "S11.4.5_A4_T1"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nvar x = 0.1;\nif (--x !== 0.1 - 1) {\n $ERROR('#1: var x = 0.1; --x === 0.1 - 1. Actual: ' + (--x));\n}\n\n//CHECK#2\nvar x = new Number(-1.1);\nif (--x !== -1.1 - 1) {\n $ERROR('#2: var x = new Number(-1.1); --x === -1.1- 1. Actual: ' + (--x));\n}\n",
"id": "S11.4.5_A4_T2"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nvar x = \"1\";\nif (--x !== 1 - 1) {\n $ERROR('#1: var x = \"1\"; --x === 1 - 1. Actual: ' + (--x));\n}\n\n//CHECK#2\nvar x = \"x\";\nif (isNaN(--x) !== true) {\n $ERROR('#2: var x = \"x\"; --x === Not-a-Number. Actual: ' + (--x));\n}\n\n//CHECK#3\nvar x = new String(\"-1\"); \nif (--x !== -1 - 1) {\n $ERROR('#3: var x = new String(\"-1\"); --x === -1 - 1. Actual: ' + (--x));\n}\n",
"id": "S11.4.5_A4_T3"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nvar x;\nif (isNaN(--x) !== true) {\n $ERROR('#1: var x; --x; x === Not-a-Number. Actual: ' + (x));\n}\n\n//CHECK#2\nvar x = null;\nif (--x !== -1) {\n $ERROR('#2: var x = null; --x === -1. Actual: ' + (--x));\n}\n",
"id": "S11.4.5_A4_T4"
},
{
"section": "11.4.5, 11.6.3",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nvar x = {}; \nif (isNaN(--x) !== true) {\n $ERROR('#1: var x = {}; --x === Not-a-Number. Actual: ' + (--x));\n}\n\n//CHECK#2\nvar x = function(){return 1}; \nif (isNaN(--x) !== true) {\n $ERROR('#2: var x = function(){return 1}; --x === Not-a-Number. Actual: ' + (--x));\n}\n",
"id": "S11.4.5_A4_T5"
}
]
}
}

View File

@ -0,0 +1,62 @@
{
"testCollection": {
"name": "11.4.6_Unary_plus_Operator",
"numTests": 9,
"tests": [
{
"section": "11.4.6, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"+\\u00091\") !== 1) {\n $ERROR('#1: +\\\\u00091 === 1');\n}\n\n//CHECK#2\nif (eval(\"+\\u000B1\") !== 1) {\n $ERROR('#2: +\\\\u000B1 === 1'); \n}\n\n//CHECK#3\nif (eval(\"+\\u000C1\") !== 1) {\n $ERROR('#3: +\\\\u000C1 === 1');\n}\n\n//CHECK#4\nif (eval(\"+\\u00201\") !== 1) {\n $ERROR('#4: +\\\\u0020 === 1');\n}\n\n//CHECK#5\nif (eval(\"+\\u00A01\") !== 1) {\n $ERROR('#5: +\\\\u00A01 === 1');\n}\n\n//CHECK#6\nif (eval(\"+\\u000A1\") !== 1) {\n $ERROR('#6: +\\\\u000A1 === 1'); \n}\n\n//CHECK#7\nif (eval(\"+\\u000D1\") !== 1) {\n $ERROR('#7: +\\\\u000D1 === 1');\n}\n\n//CHECK#8\nif (eval(\"+\\u20281\") !== 1) {\n $ERROR('#8: +\\\\u20281 === 1');\n}\n\n//CHECK#9\nif (eval(\"+\\u20291\") !== 1) {\n $ERROR('#9: +\\\\u20291 === 1');\n}\n\n//CHECK#10\nif (eval(\"+\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== 1) {\n $ERROR('#10: +\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === 1');\n}\n",
"id": "S11.4.6_A1"
},
{
"section": "11.4.6",
"description": "Either Type(x) is not Reference or GetBase(x) is not null",
"test": "//CHECK#1\nif (+1 !== 1) {\n $ERROR('#1: +1 === 1. Actual: ' + (+1));\n}\n\n//CHECK#2\nif (+(+1) !== 1) {\n $ERROR('#2: +(+1) === -1. Actual: ' + (+(+1)));\n}\n\n//CHECK#3\nvar x = 1;\nif (+x !== 1) {\n $ERROR('#3: var x = +1; -x === 1. Actual: ' + (-x));\n}\n\n//CHECK#4\nvar x = 1;\nif (+(+x) !== 1) {\n $ERROR('#4: var x = 1; +(+x) === 1. Actual: ' + (+(+x)));\n}\n\n//CHECK#5\nvar object = new Object();\nobject.prop = 1;\nif (+object.prop !== 1) {\n $ERROR('#5: var object = new Object(); object.prop = 1; +object.prop === 1. Actual: ' + (+object.prop));\n}\n",
"id": "S11.4.6_A2.1_T1"
},
{
"section": "11.4.6",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n +x;\n $ERROR('#1.1: +x throw ReferenceError. Actual: ' + (+x)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: +x throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.4.6_A2.1_T2"
},
{
"section": "11.4.6, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nvar object = {valueOf: function() {return 1}};\nif (+object !== 1) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; +object === 1. Actual: ' + (+object));\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return 1}, toString: function() {return 0}};\nif (+object !== 1) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; +object === 1. Actual: ' + (+object));\n} \n\n//CHECK#3\nvar object = {valueOf: function() {return 1}, toString: function() {return {}}};\nif (+object !== 1) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; +object === 1. Actual: ' + (+object));\n}\n\n//CHECK#4\ntry {\n var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}};\n if (+object !== 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; +object === 1. Actual: ' + (+object));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; +object not throw \"error\"');\n } else {\n $ERROR('#4.3: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; +object not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nvar object = {toString: function() {return 1}};\nif (+object !== 1) {\n $ERROR('#5: var object = {toString: function() {return 1}}; +object === 1. Actual: ' + (+object));\n}\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return 1}}\nif (+object !== 1) {\n $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; +object === 1. Actual: ' + (+object));\n}\n\n//CHECK#7\ntry {\n var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n +object;\n $ERROR('#7.1: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; +object throw \"error\". Actual: ' + (+object));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; +object throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n var object = {valueOf: function() {return {}}, toString: function() {return {}}};\n +object;\n $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; +object throw TypeError. Actual: ' + (+object));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; +object throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.4.6_A2.2_T1"
},
{
"section": "11.4.6",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nif (+false !== 0) {\n $ERROR('#1: +false === 0. Actual: ' + (+false));\n}\n\n//CHECK#2\nif (+new Boolean(true) !== 1) {\n $ERROR('#2: +new Boolean(true) === 1. Actual: ' + (+new Boolean(true)));\n}\n",
"id": "S11.4.6_A3_T1"
},
{
"section": "11.4.6",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nif (+0.1 !== 0.1) {\n $ERROR('#1: +0.1 === 0.1. Actual: ' + (+0.1));\n}\n\n//CHECK#2\nif (+new Number(-1.1) !== -1.1) {\n $ERROR('#2: +new Number(-1.1) === -1.1. Actual: ' + (+new Number(-1.1)));\n}\n",
"id": "S11.4.6_A3_T2"
},
{
"section": "11.4.6",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nif (+\"1\" !== 1) {\n $ERROR('#1: +\"1\" === 1. Actual: ' + (+\"1\"));\n}\n\n//CHECK#2\nif (isNaN(+\"x\") !== true) {\n $ERROR('#2: +\"x\" === Not-a-Number. Actual: ' + (+\"x\"));\n}\n\n//CHECK#3\nif (+new Number(\"-1\") !== -1) {\n $ERROR('#3: +new String(\"-1\") === -1. Actual: ' + (+new String(\"-1\")));\n}\n",
"id": "S11.4.6_A3_T3"
},
{
"section": "11.4.6",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nif (isNaN(+void 0) !== true) {\n $ERROR('#1: +void 0 === Not-a-Number. Actual: ' + (+void 0));\n}\n\n//CHECK#2\nif (+null !== 0) {\n $ERROR('#2: +null === 0. Actual: ' + (+null));\n}\n",
"id": "S11.4.6_A3_T4"
},
{
"section": "11.4.6",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nif (isNaN(+{}) !== true) {\n $ERROR('#1: +{} === Not-a-Number. Actual: ' + (+{}));\n}\n\n//CHECK#2 \nif (isNaN(+function(){return 1}) !== true) {\n $ERROR('#2: +function(){return 1} === Not-a-Number. Actual: ' + (+function(){return 1}));\n}\n",
"id": "S11.4.6_A3_T5"
}
]
}
}

View File

@ -0,0 +1,74 @@
{
"testCollection": {
"name": "11.4.7_Unary_minus_Operator",
"numTests": 11,
"tests": [
{
"section": "11.4.7, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"-\\u00091\") !== -1) {\n $ERROR('#1: -\\\\u00091 === -1');\n}\n\n//CHECK#2\nif (eval(\"-\\u000B1\") !== -1) {\n $ERROR('#2: -\\\\u000B1 === -1'); \n}\n\n//CHECK#3\nif (eval(\"-\\u000C1\") !== -1) {\n $ERROR('#3: -\\\\u000C1 === -1');\n}\n\n//CHECK#4\nif (eval(\"-\\u00201\") !== -1) {\n $ERROR('#4: -\\\\u0020 === -1');\n}\n\n//CHECK#5\nif (eval(\"-\\u00A01\") !== -1) {\n $ERROR('#5: -\\\\u00A01 === -1');\n}\n\n//CHECK#6\nif (eval(\"-\\u000A1\") !== -1) {\n $ERROR('#6: -\\\\u000A1 === -1'); \n}\n\n//CHECK#7\nif (eval(\"-\\u000D1\") !== -1) {\n $ERROR('#7: -\\\\u000D1 === -1');\n}\n\n//CHECK#8\nif (eval(\"-\\u20281\") !== -1) {\n $ERROR('#8: -\\\\u20281 === -1');\n}\n\n//CHECK#9\nif (eval(\"-\\u20291\") !== -1) {\n $ERROR('#9: -\\\\u20291 === -1');\n}\n\n//CHECK#10\nif (eval(\"-\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== -1) {\n $ERROR('#10: -\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === -1');\n}\n",
"id": "S11.4.7_A1"
},
{
"section": "11.4.7",
"description": "Either Type(x) is not Reference or GetBase(x) is not null",
"test": "//CHECK#1\nif (-1 !== -1) {\n $ERROR('#1: -1 === -1. Actual: ' + (-1));\n}\n\n//CHECK#2\nif (-(-1) !== 1) {\n $ERROR('#2: -(-1) === -1. Actual: ' + (-(-1)));\n}\n\n//CHECK#3\nvar x = -1;\nif (-x !== 1) {\n $ERROR('#3: var x = -1; -x === 1. Actual: ' + (-x));\n}\n\n//CHECK#4\nvar x = -1;\nif (-(-x) !== -1) {\n $ERROR('#4: var x = -1; -(-x) === -1. Actual: ' + (-(-x)));\n}\n\n//CHECK#5\nvar object = new Object();\nobject.prop = 1;\nif (-object.prop !== -1) {\n $ERROR('#5: var object = new Object(); object.prop = -1; -object.prop === -1. Actual: ' + (-object.prop));\n}\n",
"id": "S11.4.7_A2.1_T1"
},
{
"section": "11.4.7",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n -x;\n $ERROR('#1.1: -x throw ReferenceError. Actual: ' + (-x)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: -x throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.4.7_A2.1_T2"
},
{
"section": "11.4.7, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nvar object = {valueOf: function() {return -1}};\nif (-object !== 1) {\n $ERROR('#1: var object = {valueOf: function() {return -1}}; -object === 1. Actual: ' + (-object));\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return -1}, toString: function() {return 0}};\nif (-object !== 1) {\n $ERROR('#2: var object = {valueOf: function() {return -1}, toString: function() {return 0}}; -object === 1. Actual: ' + (-object));\n} \n\n//CHECK#3\nvar object = {valueOf: function() {return -1}, toString: function() {return {}}};\nif (-object !== 1) {\n $ERROR('#3: var object = {valueOf: function() {return -1}, toString: function() {return {}}}; -object === 1. Actual: ' + (-object));\n}\n\n//CHECK#4\ntry {\n var object = {valueOf: function() {return -1}, toString: function() {throw \"error\"}};\n if (-object !== 1) {\n $ERROR('#4.1: var object = {valueOf: function() {return -1}, toString: function() {throw \"error\"}}; -object === 1. Actual: ' + (-object));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: var object = {valueOf: function() {return -1}, toString: function() {throw \"error\"}}; -object not throw \"error\"');\n } else {\n $ERROR('#4.3: var object = {valueOf: function() {return -1}, toString: function() {throw \"error\"}}; -object not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nvar object = {toString: function() {return -1}};\nif (-object !== 1) {\n $ERROR('#5.1: var object = {toString: function() {return -1}}; -object === 1. Actual: ' + (-object));\n}\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return -1}}\nif (-object !== 1) {\n $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return -1}}; -object === 1. Actual: ' + (-object));\n}\n\n//CHECK#7\ntry {\n var object = {valueOf: function() {throw \"error\"}, toString: function() {return -1}};\n -object;\n $ERROR('#7.1: var object = {valueOf: function() {throw \"error\"}, toString: function() {return -1}}; -object throw \"error\". Actual: ' + (-object));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: var object = {valueOf: function() {throw \"error\"}, toString: function() {return -1}}; -object throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n var object = {valueOf: function() {return {}}, toString: function() {return {}}};\n -object;\n $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; -object throw TypeError. Actual: ' + (-object));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; -object throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.4.7_A2.2_T1"
},
{
"section": "11.4.7",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nif (-false !== 0) {\n $ERROR('#1: -false === 0. Actual: ' + (-false));\n}\n\n//CHECK#2\nif (-new Boolean(true) !== -1) {\n $ERROR('#2: -new Boolean(true) === -1. Actual: ' + (-new Boolean(true)));\n}\n",
"id": "S11.4.7_A3_T1"
},
{
"section": "11.4.7",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nif (-(1) !== -1) {\n $ERROR('#1: -(1) === -1. Actual: ' + (-(1)));\n}\n\n//CHECK#2\nif (-new Number(-1) !== 1) {\n $ERROR('#2: -new Number(-1) === 1. Actual: ' + (-new Number(-1)));\n}\n",
"id": "S11.4.7_A3_T2"
},
{
"section": "11.4.7",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nif (-\"1\" !== -1) {\n $ERROR('#1: -\"1\" === -1. Actual: ' + (-\"1\"));\n}\n\n//CHECK#2\nif (isNaN(-\"x\") !== true) {\n $ERROR('#2: -\"x\" === Not-a-Number. Actual: ' + (-\"x\"));\n}\n\n//CHECK#3\nif (-new String(\"-1\") !== 1) {\n $ERROR('#3: -new String(\"-1\") === 1. Actual: ' + (-new String(\"-1\")));\n}\n",
"id": "S11.4.7_A3_T3"
},
{
"section": "11.4.7",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nif (isNaN(-void 0) !== true) {\n $ERROR('#1: +void 0 === Not-a-Number. Actual: ' + (+void 0));\n}\n\n//CHECK#2\nif (-null !== 0) {\n $ERROR('#2: +null === 0. Actual: ' + (+null));\n}\n",
"id": "S11.4.7_A3_T4"
},
{
"section": "11.4.7",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nif (isNaN(-{}) !== true) {\n $ERROR('#1: -{} === Not-a-Number. Actual: ' + (-{}));\n}\n\n//CHECK#2 \nif (isNaN(-function(){return 1}) !== true) {\n $ERROR('#2: -function(){return 1} === Not-a-Number. Actual: ' + (-function(){return 1}));\n}\n",
"id": "S11.4.7_A3_T5"
},
{
"section": "11.4.7",
"description": "Checking NaN",
"test": "//CHECK#1\nif (isNaN(-NaN) !== true) {\n $ERROR('#1: -NaN === Not-a-Number. Actual: ' + (-NaN));\n}\n\n//CHECK#2\nvar x = NaN; \nif (isNaN(-x) != true) {\n $ERROR('#2: var x = NaN; -x === Not-a-Number. Actual: ' + (-x));\n}\n",
"id": "S11.4.7_A4.1"
},
{
"section": "11.4.7",
"description": "Checking Infinity",
"test": "//CHECK#1\nvar x = 0; \nx = -x;\nif (x !== -0) {\n $ERROR('#1.1: var x = 0; x = -x; x === 0. Actual: ' + (x));\n} else {\n if (1/x !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1.2: var x = 0; x = -x; x === - 0. Actual: +0');\n }\n}\n\n//CHECK#2\nvar x = -0; \nx = -x;\nif (x !== 0) {\n $ERROR('#2.1: var x = -0; x = -x; x === 0. Actual: ' + (x));\n} else {\n if (1/x !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: var x = -0; x = -x; x === + 0. Actual: -0');\n }\n}\n\n",
"id": "S11.4.7_A4.2"
}
]
}
}

View File

@ -0,0 +1,62 @@
{
"testCollection": {
"name": "11.4.8_Bitwise_NOT_Operator",
"numTests": 9,
"tests": [
{
"section": "11.4.8, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"~\\u00090\") !== -1) {\n $ERROR('#0: ~\\\\u00090 === -1');\n}\n\n//CHECK#2\nif (eval(\"~\\u000B0\") !== -1) {\n $ERROR('#2: ~\\\\u000B0 === -1'); \n}\n\n//CHECK#3\nif (eval(\"~\\u000C0\") !== -1) {\n $ERROR('#3: ~\\\\u000C0 === -1');\n}\n\n//CHECK#4\nif (eval(\"~\\u00200\") !== -1) {\n $ERROR('#4: ~\\\\u0020 === -1');\n}\n\n//CHECK#5\nif (eval(\"~\\u00A00\") !== -1) {\n $ERROR('#5: ~\\\\u00A00 === -1');\n}\n\n//CHECK#6\nif (eval(\"~\\u000A0\") !== -1) {\n $ERROR('#6: ~\\\\u000A0 === -1'); \n}\n\n//CHECK#7\nif (eval(\"~\\u000D0\") !== -1) {\n $ERROR('#7: ~\\\\u000D0 === -1');\n}\n\n//CHECK#8\nif (eval(\"~\\u20280\") !== -1) {\n $ERROR('#8: ~\\\\u20280 === -1');\n}\n\n//CHECK#9\nif (eval(\"~\\u20290\") !== -1) {\n $ERROR('#9: ~\\\\u20290 === -1');\n}\n\n//CHECK#10\nif (eval(\"~\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290\") !== -1) {\n $ERROR('#10: ~\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20290 === -1');\n}\n",
"id": "S11.4.8_A1"
},
{
"section": "11.4.8",
"description": "Either Type(x) is not Reference or GetBase(x) is not null",
"test": "//CHECK#1\nif (~0 !== -1) {\n $ERROR('#1: ~0 === -1. Actual: ' + (~0));\n}\n\n//CHECK#2\nif (~(~0) !== 0) {\n $ERROR('#2: ~(~0) === 0. Actual: ' + (~(~0)));\n}\n\n//CHECK#3\nvar x = 0;\nif (~x !== -1) {\n $ERROR('#3: var x = 0; ~x === -1. Actual: ' + (~x));\n}\n\n//CHECK#4\nvar x = 0;\nif (~(~x) !== 0) {\n $ERROR('#4: var x = 0; ~(~x) === 0. Actual: ' + (~(~x)));\n}\n\n//CHECK#5\nvar object = new Object();\nobject.prop = 0;\nif (~object.prop !== -1) {\n $ERROR('#5: var object = new Object(); object.prop = 0; ~object.prop === -1. Actual: ' + (~object.prop));\n}\n",
"id": "S11.4.8_A2.1_T1"
},
{
"section": "11.4.8",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n ~x;\n $ERROR('#1.1: ~x throw ReferenceError. Actual: ' + (~x)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: ~x throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.4.8_A2.1_T2"
},
{
"section": "11.4.8, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nvar object = {valueOf: function() {return 1}};\nif (~object !== -2) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; ~object === -2. Actual: ' + (~object));\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return 1}, toString: function() {return 0}};\nif (~object !== -2) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; ~object === -2. Actual: ' + (~object));\n} \n\n//CHECK#3\nvar object = {valueOf: function() {return 1}, toString: function() {return {}}};\nif (~object !== -2) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; ~object === -2. Actual: ' + (~object));\n}\n\n//CHECK#4\ntry {\n var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}};\n if (~object !== -2) {\n $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; ~object === -2. Actual: ' + (~object));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; ~object not throw \"error\"');\n } else {\n $ERROR('#4.3: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; ~object not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nvar object = {toString: function() {return 1}};\nif (~object !== -2) {\n $ERROR('#5: var object = {toString: function() {return 1}}; ~object === -2. Actual: ' + (~object));\n}\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return 1}}\nif (~object !== -2) {\n $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; ~object === -2. Actual: ' + (~object));\n}\n\n//CHECK#7\ntry {\n var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n ~object;\n $ERROR('#7.1: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; ~object throw \"error\". Actual: ' + (~object));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; ~object throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n var object = {valueOf: function() {return {}}, toString: function() {return {}}};\n ~object;\n $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; ~object throw TypeError. Actual: ' + (~object));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; ~object throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.4.8_A2.2_T1"
},
{
"section": "11.4.8",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nif (~false !== -1) {\n $ERROR('#1: ~false === -1. Actual: ' + (~false));\n}\n\n//CHECK#2\nif (~new Boolean(true) !== -2) {\n $ERROR('#2: ~new Boolean(true) === -2. Actual: ' + (~new Boolean(true)));\n}\n\n//CHECK#3\nif (~new Boolean(false) !== -1) {\n $ERROR('#3: ~new Boolean(false) === -1. Actual: ' + (~new Boolean(false)));\n}\n",
"id": "S11.4.8_A3_T1"
},
{
"section": "11.4.8",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nif (~0.1 !== -1) {\n $ERROR('#1: ~0.1 === -1. Actual: ' + (~0.1));\n}\n\n//CHECK#2\nif (~new Number(-0.1) !== -1) {\n $ERROR('#2: ~new Number(-0.1) === -1. Actual: ' + (~new Number(-0.1)));\n}\n\n//CHECK#3\nif (~NaN !== -1) {\n $ERROR('#3: ~NaN === -1. Actual: ' + (~NaN));\n}\n\n//CHECK#4\nif (~new Number(NaN) !== -1) {\n $ERROR('#4: ~new Number(NaN) === -1. Actual: ' + (~new Number(NaN)));\n}\n\n//CHECK#5\nif (~1 !== -2) {\n $ERROR('#5: ~1 === -2. Actual: ' + (~1));\n}\n\n//CHECK#6\nif (~new Number(-2) !== 1) {\n $ERROR('#6: ~new Number(-2) === 1. Actual: ' + (~new Number(-2)));\n}\n\n//CHECK#7\nif (~Infinity !== -1) {\n $ERROR('#7: ~Infinity === -1. Actual: ' + (~Infinity));\n}\n",
"id": "S11.4.8_A3_T2"
},
{
"section": "11.4.8",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nif (~\"1\" !== -2) {\n $ERROR('#1: ~\"1\" === -2. Actual: ' + (~\"1\"));\n}\n\n//CHECK#2\nif (~new String(\"0\") !== -1) {\n $ERROR('#2: ~new String(\"0\") === -1. Actual: ' + (~new String(\"0\")));\n}\n\n//CHECK#3\nif (~\"x\" !== -1) {\n $ERROR('#3: ~\"x\" === -1. Actual: ' + (~\"x\"));\n}\n\n//CHECK#4\nif (~\"\" !== -1) {\n $ERROR('#4: ~\"\" === -1. Actual: ' + (~\"\"));\n}\n\n//CHECK#5\nif (~new String(\"-2\") !== 1) {\n $ERROR('#5: ~new String(\"-2\") === 1. Actual: ' + (~new String(\"-2\")));\n}\n",
"id": "S11.4.8_A3_T3"
},
{
"section": "11.4.8",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nif (~void 0 !== -1) {\n $ERROR('#1: ~void 0 === -1. Actual: ' + (~void 0));\n}\n\n//CHECK#2\nif (~null !== -1) {\n $ERROR('#2: ~null === -1. Actual: ' + (~null));\n}\n",
"id": "S11.4.8_A3_T4"
},
{
"section": "11.4.8",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nif (~({}) !== -1) {\n $ERROR('#1: ~({}) === -1. Actual: ' + (~({})));\n}\n\n//CHECK#2 \nif (~(function(){return 1}) !== -1) {\n $ERROR('#2: ~(function(){return 1}) === -1. Actual: ' + (~(function(){return 1})));\n}\n",
"id": "S11.4.8_A3_T5"
}
]
}
}

View File

@ -0,0 +1,62 @@
{
"testCollection": {
"name": "11.4.9_Logical_NOT_Operator",
"numTests": 9,
"tests": [
{
"section": "11.4.9, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"!\\u0009true\") !== false) {\n $ERROR('#true: !\\\\u0009true === false');\n}\n\n//CHECK#2\nif (eval(\"!\\u000Btrue\") !== false) {\n $ERROR('#2: !\\\\u000Btrue === false'); \n}\n\n//CHECK#3\nif (eval(\"!\\u000Ctrue\") !== false) {\n $ERROR('#3: !\\\\u000Ctrue === false');\n}\n\n//CHECK#4\nif (eval(\"!\\u0020true\") !== false) {\n $ERROR('#4: !\\\\u0020 === false');\n}\n\n//CHECK#5\nif (eval(\"!\\u00A0true\") !== false) {\n $ERROR('#5: !\\\\u00A0true === false');\n}\n\n//CHECK#6\nif (eval(\"!\\u000Atrue\") !== false) {\n $ERROR('#6: !\\\\u000Atrue === false'); \n}\n\n//CHECK#7\nif (eval(\"!\\u000Dtrue\") !== false) {\n $ERROR('#7: !\\\\u000Dtrue === false');\n}\n\n//CHECK#8\nif (eval(\"!\\u2028true\") !== false) {\n $ERROR('#8: !\\\\u2028true === false');\n}\n\n//CHECK#9\nif (eval(\"!\\u2029true\") !== false) {\n $ERROR('#9: !\\\\u2029true === false');\n}\n\n//CHECK#10\nif (eval(\"!\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\") !== false) {\n $ERROR('#10: !\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true === false');\n}\n",
"id": "S11.4.9_A1"
},
{
"section": "11.4.9",
"description": "Either Type(x) is not Reference or GetBase(x) is not null",
"test": "//CHECK#1\nif (!true !== false) {\n $ERROR('#1: !true === false');\n}\n\n//CHECK#2\nif (!(!true) !== true) {\n $ERROR('#2: !(!true) === true');\n}\n\n//CHECK#3\nvar x = true;\nif (!x !== false) {\n $ERROR('#3: var x = true; !x === false');\n}\n\n//CHECK#4\nvar x = true;\nif (!(!x) !== true) {\n $ERROR('#4: var x = true; !(!x) === true');\n}\n\n//CHECK#5\nvar object = new Object();\nobject.prop = true;\nif (!object.prop !== false) {\n $ERROR('#5: var object = new Object(); object.prop = true; !object.prop === false');\n}\n",
"id": "S11.4.9_A2.1_T1"
},
{
"section": "11.4.9",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n !x;\n $ERROR('#1.1: !x throw ReferenceError. Actual: ' + (!x)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: !x throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.4.9_A2.1_T2"
},
{
"section": "11.4.9, 8.6.2.6",
"description": "If Type(value) is Object, return false",
"test": "//CHECK#1\nvar object = {valueOf: function() {return 1}};\nif (!object !== false) {\n $ERROR('#1: var object = {valueOf: function() {return 1}}; !object === false. Actual: ' + (!object));\n}\n\n//CHECK#2\nvar object = {valueOf: function() {return 1}, toString: function() {return 0}};\nif (!object !== false) {\n $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; !object === false. Actual: ' + (!object));\n} \n\n//CHECK#3\nvar object = {valueOf: function() {return 1}, toString: function() {return {}}};\nif (!object !== false) {\n $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; !object === false. Actual: ' + (!object));\n}\n\n//CHECK#4\nvar object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}};\nif (!object !== false) {\n $ERROR('#4: var object = {valueOf: function() {return 1}, toString: function() {throw \"error\"}}; !object === false. Actual: ' + (!object));\n}\n\n//CHECK#5\nvar object = {toString: function() {return 1}};\nif (!object !== false) {\n $ERROR('#5: var object = {toString: function() {return 1}}; !object === false. Actual: ' + (!object));\n}\n\n//CHECK#6\nvar object = {valueOf: function() {return {}}, toString: function() {return 1}}\nif (!object !== false) {\n $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; !object === false. Actual: ' + (!object));\n}\n\n//CHECK#7\nvar object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\nif (!object !== false) {\n $ERROR('#7: var object = {valueOf: function() {throw \"error\"}, toString: function() {return 1}}; !object === false. Actual: ' + (!object));\n} \n\n//CHECK#8\nvar object = {valueOf: function() {return {}}, toString: function() {return {}}};\nif (!object !== false) {\n $ERROR('#8: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; !object === false. Actual: ' + (!object));\n} \n",
"id": "S11.4.9_A2.2_T1"
},
{
"section": "11.4.9",
"description": "Type(x) is boolean primitive or Boolean object",
"test": "//CHECK#1\nif (!false !== true) {\n $ERROR('#1: !false === true');\n}\n\n//CHECK#2\nif (!new Boolean(true) !== false) {\n $ERROR('#2: !new Boolean(true) === false');\n}\n\n//CHECK#3\nif (!new Boolean(false) !== false) {\n $ERROR('#3: !new Boolean(false) === false');\n}\n",
"id": "S11.4.9_A3_T1"
},
{
"section": "11.4.9",
"description": "Type(x) is number primitive or Number object",
"test": "//CHECK#1\nif (!0.1 !== false) {\n $ERROR('#1: !0.1 === false');\n}\n\n//CHECK#2\nif (!new Number(-0.1) !== false) {\n $ERROR('#2: !new Number(-0.1) === false');\n}\n\n//CHECK#3\nif (!NaN !== true) {\n $ERROR('#3: !NaN === true');\n}\n\n//CHECK#4\nif (!new Number(NaN) !== false) {\n $ERROR('#4: !new Number(NaN) === false');\n}\n\n//CHECK#5\nif (!0 !== true) {\n $ERROR('#5: !0 === true');\n}\n\n//CHECK#6\nif (!new Number(0) !== false) {\n $ERROR('#6: !new Number(0) === false');\n}\n\n//CHECK#7\nif (!Infinity !== false) {\n $ERROR('#7: !Infinity === false');\n}\n",
"id": "S11.4.9_A3_T2"
},
{
"section": "11.4.9",
"description": "Type(x) is string primitive or String object",
"test": "//CHECK#1\nif (!\"1\" !== false) {\n $ERROR('#1: !\"1\" === false');\n}\n\n//CHECK#2\nif (!new String(\"0\") !== false) {\n $ERROR('#2: !new String(\"0\") === false');\n}\n\n//CHECK#3\nif (!\"x\" !== false) {\n $ERROR('#3: !\"x\" === false');\n}\n\n//CHECK#4\nif (!\"\" !== true) {\n $ERROR('#4: !\"\" === true');\n}\n\n//CHECK#5\nif (!new String(\"\") !== false) {\n $ERROR('#5: !new String(\"\") === false');\n}\n",
"id": "S11.4.9_A3_T3"
},
{
"section": "11.4.9",
"description": "Type(x) is undefined or null",
"test": "//CHECK#1\nif (!void 0 !== true) {\n $ERROR('#1: !void 0 === true');\n}\n\n//CHECK#2\nif (!null !== true) {\n $ERROR('#2: !null === true');\n}\n",
"id": "S11.4.9_A3_T4"
},
{
"section": "11.4.9",
"description": "Type(x) is Object object or Function object",
"test": "//CHECK#1\nif ((!{}) !== false) {\n $ERROR('#1: !({}) === false');\n}\n\n//CHECK#2 \nif (!(function(){return 1}) !== false) {\n $ERROR('#2: !(function(){return 1}) === false');\n}\n",
"id": "S11.4.9_A3_T5"
}
]
}
}

View File

@ -0,0 +1,200 @@
{
"testCollection": {
"name": "11.5.1_Applying_the_asterisk_Operator",
"numTests": 32,
"tests": [
{
"section": "11.5.1, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009*\\u00091\") !== 1) {\n $ERROR('#1: 1\\\\u0009*\\\\u00091 === 1');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B*\\u000B1\") !== 1) {\n $ERROR('#2: 1\\\\u000B*\\\\u000B1 === 1'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C*\\u000C1\") !== 1) {\n $ERROR('#3: 1\\\\u000C*\\\\u000C1 === 1');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020*\\u00201\") !== 1) {\n $ERROR('#4: 1\\\\u0020*\\\\u00201 === 1');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0*\\u00A01\") !== 1) {\n $ERROR('#5: 1\\\\u00A0*\\\\u00A01 === 1');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A*\\u000A1\") !== 1) {\n $ERROR('#6: 1\\\\u000A*\\\\u000A1 === 1'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D*\\u000D1\") !== 1) {\n $ERROR('#7: 1\\\\u000D*\\\\u000D1 === 1');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028*\\u20281\") !== 1) {\n $ERROR('#8: 1\\\\u2028*\\\\u20281 === 1');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029*\\u20291\") !== 1) {\n $ERROR('#9: 1\\\\u2029*\\\\u20291 === 1');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029*\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== 1) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029*\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === 1');\n}\n",
"id": "S11.5.1_A1"
},
{
"section": "11.5.1",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 * 1 !== 1) {\n $ERROR('#1: 1 * 1 === 1. Actual: ' + (1 * 1));\n}\n\n//CHECK#2\nvar x = 1;\nif (x * 1 !== 1) {\n $ERROR('#2: var x = 1; x * 1 === 1. Actual: ' + (x * 1));\n}\n\n//CHECK#3\nvar y = 1;\nif (1 * y !== 1) {\n $ERROR('#3: var y = 1; 1 * y === 1. Actual: ' + (1 * y));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (x * y !== 1) {\n $ERROR('#4: var x = 1; var y = 1; x * y === 1. Actual: ' + (x * y));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (objectx.prop * objecty.prop !== 1) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop * objecty.prop === 1. Actual: ' + (objectx.prop * objecty.prop));\n}\n",
"id": "S11.5.1_A2.1_T1"
},
{
"section": "11.5.1",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x * 1;\n $ERROR('#1.1: x * 1 throw ReferenceError. Actual: ' + (x * 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x * 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.5.1_A2.1_T2"
},
{
"section": "11.5.1",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 * y;\n $ERROR('#1.1: 1 * y throw ReferenceError. Actual: ' + (1 * y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 * y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.5.1_A2.1_T3"
},
{
"section": "11.5.1, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 1}} * 1 !== 1) {\n $ERROR('#1: {valueOf: function() {return 1}} * 1 === 1. Actual: ' + ({valueOf: function() {return 1}} * 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 1}, toString: function() {return 0}} * 1 !== 1) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} * 1 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} * 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 1}, toString: function() {return {}}} * 1 !== 1) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} * 1 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} * 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} * 1 !== 1) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} * 1 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} * 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} * 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} * 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 * {toString: function() {return 1}} !== 1) {\n $ERROR('#5: 1 * {toString: function() {return 1}} === 1. Actual: ' + (1 * {toString: function() {return 1}}));\n}\n\n//CHECK#6\nif (1 * {valueOf: function() {return {}}, toString: function() {return 1}} !== 1) {\n $ERROR('#6: 1 * {valueOf: function() {return {}}, toString: function() {return 1}} === 1. Actual: ' + (1 * {valueOf: function() {return {}}, toString: function() {return 1}}));\n}\n\n//CHECK#7\ntry {\n 1 * {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n $ERROR('#7.1: 1 * {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (1 * {valueOf: function() {throw \"error\"}, toString: function() {return 1}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 * {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 * {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 * {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 * {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 * {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.5.1_A2.2_T1"
},
{
"section": "11.5.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x * y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x * y throw \"x\". Actual: ' + (x * y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x * y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.5.1_A2.3_T1"
},
{
"section": "11.5.1",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) * x !== 1) {\n $ERROR('#1: var x = 0; (x = 1) * x === 1. Actual: ' + ((x = 1) * x));\n}\n\n//CHECK#2\nvar x = 0; \nif (x * (x = 1) !== 0) {\n $ERROR('#2: var x = 0; x * (x = 1) === 0. Actual: ' + (x * (x = 1)));\n}\n\n",
"id": "S11.5.1_A2.4_T1"
},
{
"section": "11.5.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() * y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() * y() throw \"x\". Actual: ' + (x() * y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() * y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.5.1_A2.4_T2"
},
{
"section": "11.5.1",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x * (x = 1);\n $ERROR('#1.1: x * (x = 1) throw ReferenceError. Actual: ' + (x * (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x * (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) * y !== 1) {\n $ERROR('#2: (y = 1) * y === 1. Actual: ' + ((y = 1) * y));\n}\n\n",
"id": "S11.5.1_A2.4_T3"
},
{
"section": "11.5.1",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true * true !== 1) {\n $ERROR('#1: true * true === 1. Actual: ' + (true * true));\n}\n\n//CHECK#2\nif (new Boolean(true) * true !== 1) {\n $ERROR('#2: new Boolean(true) * true === 1. Actual: ' + (new Boolean(true) * true));\n}\n\n//CHECK#3\nif (true * new Boolean(true) !== 1) {\n $ERROR('#3: true * new Boolean(true) === 1. Actual: ' + (true * new Boolean(true)));\n}\n\n//CHECK#4\nif (new Boolean(true) * new Boolean(true) !== 1) {\n $ERROR('#4: new Boolean(true) * new Boolean(true) === 1. Actual: ' + (new Boolean(true) * new Boolean(true)));\n}\n",
"id": "S11.5.1_A3_T1.1"
},
{
"section": "11.5.1",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 * 1 !== 1) {\n $ERROR('#1: 1 * 1 === 1. Actual: ' + (1 * 1));\n}\n\n//CHECK#2\nif (new Number(1) * 1 !== 1) {\n $ERROR('#2: new Number(1) * 1 === 1. Actual: ' + (new Number(1) * 1));\n}\n\n//CHECK#3\nif (1 * new Number(1) !== 1) {\n $ERROR('#3: 1 * new Number(1) === 1. Actual: ' + (1 * new Number(1)));\n}\n\n//CHECK#4\nif (new Number(1) * new Number(1) !== 1) {\n $ERROR('#4: new Number(1) * new Number(1) === 1. Actual: ' + (new Number(1) * new Number(1)));\n}\n\n",
"id": "S11.5.1_A3_T1.2"
},
{
"section": "11.5.1",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" * \"1\" !== 1) {\n $ERROR('#1: \"1\" * \"1\" === 1. Actual: ' + (\"1\" * \"1\"));\n}\n\n//CHECK#2\nif (new String(\"1\") * \"1\" !== 1) {\n $ERROR('#2: new String(\"1\") * \"1\" === 1. Actual: ' + (new String(\"1\") * \"1\"));\n}\n\n//CHECK#3\nif (\"1\" * new String(\"1\") !== 1) {\n $ERROR('#3: \"1\" * new String(\"1\") === 1. Actual: ' + (\"1\" * new String(\"1\")));\n}\n\n//CHECK#4\nif (new String(\"1\") * new String(\"1\") !== 1) {\n $ERROR('#4: new String(\"1\") * new String(\"1\") === 1. Actual: ' + (new String(\"1\") * new String(\"1\")));\n}\n\n//CHECK#5\nif (isNaN(\"x\" * \"1\") !== true) {\n $ERROR('#5: \"x\" * \"1\" === Not-a-Number. Actual: ' + (\"x\" * \"1\"));\n}\n\n//CHECK#6\nif (isNaN(\"1\" * \"x\") !== true) {\n $ERROR('#6: \"1\" * \"x\" === Not-a-Number. Actual: ' + (\"1\" * \"x\"));\n}\n",
"id": "S11.5.1_A3_T1.3"
},
{
"section": "11.5.1",
"description": "Type(x) and Type(y) vary between Null and Undefined",
"test": "//CHECK#1\nif (isNaN(null * undefined) !== true) {\n $ERROR('#1: null * undefined === Not-a-Number. Actual: ' + (null * undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined * null) !== true) {\n $ERROR('#2: undefined * null === Not-a-Number. Actual: ' + (undefined * null));\n}\n\n//CHECK#3\nif (isNaN(undefined * undefined) !== true) {\n $ERROR('#3: undefined * undefined === Not-a-Number. Actual: ' + (undefined * undefined));\n}\n\n//CHECK#4\nif (null * null !== 0) {\n $ERROR('#4: null * null === 0. Actual: ' + (null * null));\n}\n",
"id": "S11.5.1_A3_T1.4"
},
{
"section": "11.5.1",
"description": "Type(x) and Type(y) vary between Object object and Function object",
"test": "//CHECK#1\nif (isNaN({} * function(){return 1}) !== true) {\n $ERROR('#1: {} * function(){return 1} === Not-a-Number. Actual: ' + ({} * function(){return 1}));\n}\n\n//CHECK#2\nif (isNaN(function(){return 1} * {}) !== true) {\n $ERROR('#2: function(){return 1} * {} === Not-a-Number. Actual: ' + (function(){return 1} * {}));\n}\n\n//CHECK#3\nif (isNaN(function(){return 1} * function(){return 1}) !== true) {\n $ERROR('#3: function(){return 1} * function(){return 1} === Not-a-Number. Actual: ' + (function(){return 1} * function(){return 1}));\n}\n\n//CHECK#4\nif (isNaN({} * {}) !== true) {\n $ERROR('#4: {} * {} === Not-a-Number. Actual: ' + ({} * {}));\n}\n",
"id": "S11.5.1_A3_T1.5"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Number (primitive and object)",
"test": "//CHECK#1\nif (true * 1 !== 1) {\n $ERROR('#1: true * 1 === 1. Actual: ' + (true * 1));\n}\n\n//CHECK#2\nif (1 * true !== 1) {\n $ERROR('#2: 1 * true === 1. Actual: ' + (1 * true));\n}\n\n//CHECK#3\nif (new Boolean(true) * 1 !== 1) {\n $ERROR('#3: new Boolean(true) * 1 === 1. Actual: ' + (new Boolean(true) * 1));\n}\n\n//CHECK#4\nif (1 * new Boolean(true) !== 1) {\n $ERROR('#4: 1 * new Boolean(true) === 1. Actual: ' + (1 * new Boolean(true)));\n}\n\n//CHECK#5\nif (true * new Number(1) !== 1) {\n $ERROR('#5: true * new Number(1) === 1. Actual: ' + (true * new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) * true !== 1) {\n $ERROR('#6: new Number(1) * true === 1. Actual: ' + (new Number(1) * true));\n}\n\n//CHECK#7\nif (new Boolean(true) * new Number(1) !== 1) {\n $ERROR('#7: new Boolean(true) * new Number(1) === 1. Actual: ' + (new Boolean(true) * new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) * new Boolean(true) !== 1) {\n $ERROR('#8: new Number(1) * new Boolean(true) === 1. Actual: ' + (new Number(1) * new Boolean(true)));\n}\n",
"id": "S11.5.1_A3_T2.1"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" * 1 !== 1) {\n $ERROR('#1: \"1\" * 1 === 1. Actual: ' + (\"1\" * 1));\n}\n\n//CHECK#2\nif (1 * \"1\" !== 1) {\n $ERROR('#2: 1 * \"1\" === 1. Actual: ' + (1 * \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") * 1 !== 1) {\n $ERROR('#3: new String(\"1\") * 1 === 1. Actual: ' + (new String(\"1\") * 1));\n}\n\n//CHECK#4\nif (1 * new String(\"1\") !== 1) {\n $ERROR('#4: 1 * new String(\"1\") === 1. Actual: ' + (1 * new String(\"1\")));\n}\n\n//CHECK#5\nif (\"1\" * new Number(1) !== 1) {\n $ERROR('#5: \"1\" * new Number(1) === 1. Actual: ' + (\"1\" * new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) * \"1\" !== 1) {\n $ERROR('#6: new Number(1) * \"1\" === 1. Actual: ' + (new Number(1) * \"1\"));\n}\n\n//CHECK#7\nif (new String(\"1\") * new Number(1) !== 1) {\n $ERROR('#7: new String(\"1\") * new Number(1) === 1. Actual: ' + (new String(\"1\") * new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) * new String(\"1\") !== 1) {\n $ERROR('#8: new Number(1) * new String(\"1\") === 1. Actual: ' + (new Number(1) * new String(\"1\")));\n}\n\n//CHECK#9\nif (isNaN(\"x\" * 1) !== true) {\n $ERROR('#9: \"x\" * 1 === Not-a-Number. Actual: ' + (\"x\" * 1));\n}\n\n//CHECK#10\nif (isNaN(1 * \"x\") !== true) {\n $ERROR('#10: 1 * \"x\" === Not-a-Number. Actual: ' + (1 * \"x\"));\n}\n",
"id": "S11.5.1_A3_T2.2"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 * null !== 0) {\n $ERROR('#1: 1 * null === 0. Actual: ' + (1 * null));\n}\n\n//CHECK#2\nif (null * 1 !== 0) {\n $ERROR('#2: null * 1 === 0. Actual: ' + (null * 1));\n}\n\n//CHECK#3\nif (new Number(1) * null !== 0) {\n $ERROR('#3: new Number(1) * null === 0. Actual: ' + (new Number(1) * null));\n}\n\n//CHECK#4\nif (null * new Number(1) !== 0) {\n $ERROR('#4: null * new Number(1) === 0. Actual: ' + (null * new Number(1)));\n}\n",
"id": "S11.5.1_A3_T2.3"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(1 * undefined) !== true) {\n $ERROR('#1: 1 * undefined === Not-a-Number. Actual: ' + (1 * undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined * 1) !== true) {\n $ERROR('#2: undefined * 1 === Not-a-Number. Actual: ' + (undefined * 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) * undefined) !== true) {\n $ERROR('#3: new Number(1) * undefined === Not-a-Number. Actual: ' + (new Number(1) * undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined * new Number(1)) !== true) {\n $ERROR('#4: undefined * new Number(1) === Not-a-Number. Actual: ' + (undefined * new Number(1)));\n}\n",
"id": "S11.5.1_A3_T2.4"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true * \"1\" !== 1) {\n $ERROR('#1: true * \"1\" === 1. Actual: ' + (true * \"1\"));\n}\n\n//CHECK#2\nif (\"1\" * true !== 1) {\n $ERROR('#2: \"1\" * true === 1. Actual: ' + (\"1\" * true));\n}\n\n//CHECK#3\nif (new Boolean(true) * \"1\" !== 1) {\n $ERROR('#3: new Boolean(true) * \"1\" === 1. Actual: ' + (new Boolean(true) * \"1\"));\n}\n\n//CHECK#4\nif (\"1\" * new Boolean(true) !== 1) {\n $ERROR('#4: \"1\" * new Boolean(true) === 1. Actual: ' + (\"1\" * new Boolean(true)));\n}\n\n//CHECK#5\nif (true * new String(\"1\") !== 1) {\n $ERROR('#5: true * new String(\"1\") === 1. Actual: ' + (true * new String(\"1\")));\n}\n\n//CHECK#6\nif (new String(\"1\") * true !== 1) {\n $ERROR('#6: new String(\"1\") * true === 1. Actual: ' + (new String(\"1\") * true));\n}\n\n//CHECK#7\nif (new Boolean(true) * new String(\"1\") !== 1) {\n $ERROR('#7: new Boolean(true) * new String(\"1\") === 1. Actual: ' + (new Boolean(true) * new String(\"1\")));\n}\n\n//CHECK#8\nif (new String(\"1\") * new Boolean(true) !== 1) {\n $ERROR('#8: new String(\"1\") * new Boolean(true) === 1. Actual: ' + (new String(\"1\") * new Boolean(true)));\n}\n",
"id": "S11.5.1_A3_T2.5"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between primitive String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(\"1\" * undefined) !== true) {\n $ERROR('#1: \"1\" * undefined === Not-a-Number. Actual: ' + (\"1\" * undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined * \"1\") !== true) {\n $ERROR('#2: undefined * \"1\" === Not-a-Number. Actual: ' + (undefined * \"1\"));\n}\n\n//CHECK#3\nif (isNaN(new String(\"1\") * undefined) !== true) {\n $ERROR('#3: new String(\"1\") * undefined === Not-a-Number. Actual: ' + (new String(\"1\") * undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined * new String(\"1\")) !== true) {\n $ERROR('#4: undefined * new String(\"1\") === Not-a-Number. Actual: ' + (undefined * new String(\"1\")));\n}\n",
"id": "S11.5.1_A3_T2.6"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" * null !== 0) {\n $ERROR('#1: \"1\" * null === 0. Actual: ' + (\"1\" * null));\n}\n\n//CHECK#2\nif (null * \"1\" !== 0) {\n $ERROR('#2: null * \"1\" === 0. Actual: ' + (null * \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") * null !== 0) {\n $ERROR('#3: new String(\"1\") * null === 0. Actual: ' + (new String(\"1\") * null));\n}\n\n//CHECK#4\nif (null * new String(\"1\") !== 0) {\n $ERROR('#4: null * new String(\"1\") === 0. Actual: ' + (null * new String(\"1\")));\n}\n",
"id": "S11.5.1_A3_T2.7"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(true * undefined) !== true) {\n $ERROR('#1: true * undefined === Not-a-Number. Actual: ' + (true * undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined * true) !== true) {\n $ERROR('#2: undefined * true === Not-a-Number. Actual: ' + (undefined * true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) * undefined) !== true) {\n $ERROR('#3: new Boolean(true) * undefined === Not-a-Number. Actual: ' + (new Boolean(true) * undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined * new Boolean(true)) !== true) {\n $ERROR('#4: undefined * new Boolean(true) === Not-a-Number. Actual: ' + (undefined * new Boolean(true)));\n}\n",
"id": "S11.5.1_A3_T2.8"
},
{
"section": "11.5.1",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true * null !== 0) {\n $ERROR('#1: true * null === 0. Actual: ' + (true * null));\n}\n\n//CHECK#2\nif (null * true !== 0) {\n $ERROR('#2: null * true === 0. Actual: ' + (null * true));\n}\n\n//CHECK#3\nif (new Boolean(true) * null !== 0) {\n $ERROR('#3: new Boolean(true) * null === 0. Actual: ' + (new Boolean(true) * null));\n}\n\n//CHECK#4\nif (null * new Boolean(true) !== 0) {\n $ERROR('#4: null * new Boolean(true) === 0. Actual: ' + (null * new Boolean(true)));\n}\n",
"id": "S11.5.1_A3_T2.9"
},
{
"section": "11.5.1",
"description": "If left operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN * Number.NaN) !== true) {\n $ERROR('#1: NaN * NaN === Not-a-Number. Actual: ' + (NaN * NaN));\n} \n\n//CHECK#2\nif (isNaN(Number.NaN * +0) !== true) {\n $ERROR('#2: NaN * +0 === Not-a-Number. Actual: ' + (NaN * +0)); \n} \n\n//CHECK#3\nif (isNaN(Number.NaN * -0) !== true) {\n $ERROR('#3: NaN * -0 === Not-a-Number. Actual: ' + (NaN * -0)); \n} \n\n//CHECK#4\nif (isNaN(Number.NaN * Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: NaN * Infinity === Not-a-Number. Actual: ' + (NaN * Infinity));\n} \n\n//CHECK#5\nif (isNaN(Number.NaN * Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#5: NaN * -Infinity === Not-a-Number. Actual: ' + (NaN * -Infinity)); \n} \n\n//CHECK#6\nif (isNaN(Number.NaN * Number.MAX_VALUE) !== true) {\n $ERROR('#6: NaN * Number.MAX_VALUE === Not-a-Number. Actual: ' + (NaN * Number.MAX_VALUE));\n} \n\n//CHECK#7\nif (isNaN(Number.NaN * Number.MIN_VALUE) !== true) {\n $ERROR('#7: NaN * Number.MIN_VALUE === Not-a-Number. Actual: ' + (NaN * Number.MIN_VALUE)); \n}\n\n//CHECK#8\nif (isNaN(Number.NaN * 1) !== true) {\n $ERROR('#8: NaN * 1 === Not-a-Number. Actual: ' + (NaN * 1)); \n} \n",
"id": "S11.5.1_A4_T1.1"
},
{
"section": "11.5.1",
"description": "If right operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN * Number.NaN) !== true) {\n $ERROR('#1: NaN * NaN === Not-a-Number. Actual: ' + (NaN * NaN));\n} \n\n//CHECK#2\nif (isNaN(+0 * Number.NaN) !== true) {\n $ERROR('#2: +0 * NaN === Not-a-Number. Actual: ' + (+0 * NaN)); \n} \n\n//CHECK#3\nif (isNaN(-0 * Number.NaN) !== true) {\n $ERROR('#3: -0 * NaN === Not-a-Number. Actual: ' + (-0 * NaN)); \n} \n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY * Number.NaN) !== true) {\n $ERROR('#4: Infinity * NaN === Not-a-Number. Actual: ' + (Infinity * NaN));\n} \n\n//CHECK#5\nif (isNaN(Number.NEGATIVE_INFINITY * Number.NaN) !== true) {\n $ERROR('#5: -Infinity * NaN === Not-a-Number. Actual: ' + ( -Infinity * NaN)); \n} \n\n//CHECK#6\nif (isNaN(Number.MAX_VALUE * Number.NaN) !== true) {\n $ERROR('#6: Number.MAX_VALUE * NaN === Not-a-Number. Actual: ' + (Number.MAX_VALUE * NaN));\n} \n\n//CHECK#7\nif (isNaN(Number.MIN_VALUE * Number.NaN) !== true) {\n $ERROR('#7: Number.MIN_VALUE * NaN === Not-a-Number. Actual: ' + (Number.MIN_VALUE * NaN)); \n}\n\n//CHECK#8\nif (isNaN(1 * Number.NaN) !== true) {\n $ERROR('#8: 1 * NaN === Not-a-Number. Actual: ' + (1 * NaN)); \n}\n",
"id": "S11.5.1_A4_T1.2"
},
{
"section": "11.5.1",
"description": "The sign of the result is positive if both operands have the same sign, negative if the operands have different signs",
"test": "//CHECK#1\nif (1 * 1 !== 1) {\n $ERROR('#1: 1 * 1 === 1. Actual: ' + (1 * 1));\n}\n\n//CHECK#2\nif (1 * -1 !== -1) {\n $ERROR('#2: 1 * -1 === -1. Actual: ' + (1 * -1));\n}\n\n//CHECK#3\nif (-1 * 1 !== -1) {\n $ERROR('#3: -1 * 1 === -1. Actual: ' + (-1 * 1));\n}\n\n//CHECK#4\nif (-1 * -1 !== 1) {\n $ERROR('#4: -1 * -1 === 1. Actual: ' + (-1 * -1));\n}\n\n//CHECK#5\nif (0 * 0 !== 0) {\n $ERROR('#5.1: 0 * 0 === 0. Actual: ' + (0 * 0));\n} else {\n if (1 / (0 * 0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#5.2: 0 * 0 === + 0. Actual: -0');\n }\n}\n\n//CHECK#6\nif (0 * -0 !== -0) {\n $ERROR('#6.1: 0 * -0 === 0. Actual: ' + (0 * -0));\n} else {\n if (1 / (0 * -0) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#6.2: 0 * -0 === - 0. Actual: +0');\n }\n}\n\n//CHECK#7\nif (-0 * 0 !== -0) {\n $ERROR('#7.1: -0 * 0 === 0. Actual: ' + (-0 * 0));\n} else {\n if (1 / (-0 * 0) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#7.2: -0 * 0 === - 0. Actual: +0');\n }\n}\n\n//CHECK#8\nif (-0 * -0 !== 0) {\n $ERROR('#8.1: -0 * -0 === 0. Actual: ' + (-0 * -0));\n} else {\n if (1 / (-0 * -0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#8.2: 0 * -0 === - 0. Actual: +0');\n }\n}\n",
"id": "S11.5.1_A4_T2"
},
{
"section": "11.5.1",
"description": "Multiplication of an infinity by a zero results in NaN",
"test": "//CHECK#1\nif (isNaN(Number.NEGATIVE_INFINITY * 0) !== true) {\n $ERROR('#1: Infinity * 0 === Not-a-Number. Actual: ' + (Infinity * 0));\n}\n\n//CHECK#2\nif (isNaN(-0 * Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#2: -0 * -Infinity === Not-a-Number. Actual: ' + (-0 * -Infinity));\n}\n\n//CHECK#3\nif (isNaN(Number.POSITIVE_INFINITY * -0) !== true) {\n $ERROR('#3: Infinity * -0 === Not-a-Number. Actual: ' + (Infinity * -0));\n}\n\n//CHECK#4\nif (isNaN(0 * Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: 0 * Infinity === Not-a-Number. Actual: ' + (0 * Infinity));\n}\n\n//CHECK#5\nif (isNaN(Number.NEGATIVE_INFINITY * -0) !== true) {\n $ERROR('#5: Infinity * -0 === Not-a-Number. Actual: ' + (Infinity * -0));\n}\n\n//CHECK#6\nif (isNaN(0 * Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#6: 0 * -Infinity === Not-a-Number. Actual: ' + (0 * -Infinity));\n}\n\n//CHECK#7\nif (isNaN(Number.POSITIVE_INFINITY * 0) !== true) {\n $ERROR('#7: Infinity * 0 === Not-a-Number. Actual: ' + (Infinity * 0));\n}\n\n//CHECK#8\nif (isNaN(-0 * Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#8: -0 * Infinity === Not-a-Number. Actual: ' + (-0 * Infinity));\n}\n",
"id": "S11.5.1_A4_T3"
},
{
"section": "11.5.1",
"description": "Multiplication of an infinity by an infinity results in an infinity of appropriate sign",
"test": "//CHECK#1\nif (Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: -Infinity * -Infinity === Infinity. Actual: ' + (-Infinity * -Infinity));\n}\n\n//CHECK#2\nif (Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY) {\n $ERROR('#2: Infinity * Infinity === Infinity. Actual: ' + (Infinity * Infinity));\n}\n\n//CHECK#3\nif (Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3: -Infinity * Infinity === -Infinity. Actual: ' + (-Infinity * Infinity));\n}\n\n//CHECK#4\nif (Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4: Infinity * -Infinity === -Infinity. Actual: ' + (Infinity * -Infinity));\n}\n",
"id": "S11.5.1_A4_T4"
},
{
"section": "11.5.1",
"description": "Multiplication of an infinity by a finite non-zero value results in a signed infinity",
"test": "//CHECK#1\nif (Number.NEGATIVE_INFINITY * -1 !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: -Infinity * -1 === Infinity. Actual: ' + (-Infinity * -1));\n}\n\n//CHECK#2\nif (-1 * Number.NEGATIVE_INFINITY !== Number.POSITIVE_INFINITY) {\n $ERROR('#2: -1 * -Infinity === Infinity. Actual: ' + (-1 * -Infinity));\n}\n\n//CHECK#3\nif (Number.POSITIVE_INFINITY * -1 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3: Infinity * -1 === -Infinity. Actual: ' + (Infinity * -1));\n}\n\n//CHECK#4\nif (-1 * Number.POSITIVE_INFINITY !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4: -1 * Infinity === -Infinity. Actual: ' + (-1 * Infinity));\n} \n\n//CHECK#5\nif (Number.POSITIVE_INFINITY * Number.MAX_VALUE !== Number.POSITIVE_INFINITY) {\n $ERROR('#5: Infinity * Number.MAX_VALUE === Infinity. Actual: ' + (Infinity * Number.MAX_VALUE));\n}\n\n//CHECK#6\nif (Number.POSITIVE_INFINITY * Number.MAX_VALUE !== Number.MAX_VALUE * Number.POSITIVE_INFINITY) {\n $ERROR('#6: Infinity * Number.MAX_VALUE === Number.MAX_VALUE * Infinity. Actual: ' + (Infinity * Number.MAX_VALUE));\n}\n\n//CHECK#7\nif (Number.NEGATIVE_INFINITY * Number.MIN_VALUE !== Number.NEGATIVE_INFINITY) {\n $ERROR('#7: -Infinity * Number.MIN_VALUE === -Infinity. Actual: ' + (-Infinity * Number.MIN_VALUE));\n}\n\n//CHECK#8\nif (Number.NEGATIVE_INFINITY * Number.MIN_VALUE !== Number.MIN_VALUE * Number.NEGATIVE_INFINITY) {\n $ERROR('#8: -Infinity * Number.MIN_VALUE === Number.MIN_VALUE * -Infinity. Actual: ' + (-Infinity * Number.MIN_VALUE));\n} \n",
"id": "S11.5.1_A4_T5"
},
{
"section": "11.5.1",
"description": "If the magnitude is too large to represent, the result is then an infinity of appropriate sign",
"test": "//CHECK#1\nif (Number.MAX_VALUE * 1.1 !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: Number.MAX_VALUE * 1.1 === Number.POSITIVE_INFINITY. Actual: ' + (Number.MAX_VALUE * 1.1));\n}\n\n//CHECK#2\nif (-1.1 * Number.MAX_VALUE !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2: -1.1 * Number.MAX_VALUE === Number.NEGATIVE_INFINITY. Actual: ' + (-1.1 * Number.MAX_VALUE));\n} \n\n//CHECK#3\nif (Number.MAX_VALUE * 1 !== Number.MAX_VALUE) {\n $ERROR('#3: Number.MAX_VALUE * 1 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE * 1));\n}\n\n//CHECK#4\nif (-1 * Number.MAX_VALUE !== -Number.MAX_VALUE) {\n $ERROR('#4: -1 * Number.MAX_VALUE === -Number.MAX_VALUE. Actual: ' + (-1 * Number.MAX_VALUE));\n} \n",
"id": "S11.5.1_A4_T6"
},
{
"section": "11.5.1",
"description": "If the magnitude is too small to represent, the result is then a zero of appropriate sign",
"test": "//CHECK#1\nif (Number.MIN_VALUE * 0.1 !== 0) {\n $ERROR('#1: Number.MIN_VALUE * 0.1 === 0. Actual: ' + (Number.MIN_VALUE * 0.1));\n}\n\n//CHECK#2\nif (-0.1 * Number.MIN_VALUE !== -0) {\n $ERROR('#2.1: -0.1 * Number.MIN_VALUE === -0. Actual: ' + (-0.1 * Number.MIN_VALUE));\n} else {\n if (1 / (-0.1 * Number.MIN_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2.2: -0.1 * Number.MIN_VALUE === -0. Actual: +0');\n }\n}\n\n//CHECK#3\nif (Number.MIN_VALUE * 0.5 !== 0) {\n $ERROR('#3: Number.MIN_VALUE * 0.5 === 0. Actual: ' + (Number.MIN_VALUE * 0.5));\n}\n\n//CHECK#4\nif (-0.5 * Number.MIN_VALUE !== -0) {\n $ERROR('#4.1: -0.5 * Number.MIN_VALUE === -0. Actual: ' + (-0.5 * Number.MIN_VALUE));\n} else {\n if (1 / (-0.5 * Number.MIN_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4.2: -0.5 * Number.MIN_VALUE === -0. Actual: +0');\n }\n}\n\n//CHECK#5\nif (Number.MIN_VALUE * 0.51 !== Number.MIN_VALUE) {\n $ERROR('#5: Number.MIN_VALUE * 0.51 === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE * 0.51));\n}\n\n//CHECK#6\nif (-0.51 * Number.MIN_VALUE !== -Number.MIN_VALUE) {\n $ERROR('#6: -0.51 * Number.MIN_VALUE === -Number.MIN_VALUE. Actual: ' + (-0.51 * Number.MIN_VALUE));\n}\n\n//CHECK#7\nif (Number.MIN_VALUE * 0.9 !== Number.MIN_VALUE) {\n $ERROR('#7: Number.MIN_VALUE * 0.9 === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE * 0.9));\n}\n\n//CHECK#8\nif (-0.9 * Number.MIN_VALUE !== -Number.MIN_VALUE) {\n $ERROR('#8: -0.9 * Number.MIN_VALUE === -Number.MIN_VALUE. Actual: ' + (-0.9 * Number.MIN_VALUE));\n} \n",
"id": "S11.5.1_A4_T7"
},
{
"section": "11.5.1",
"description": "Multiplication is not always associative (x * y * z is the same as (x * y) * z, not x * (y * z))",
"test": "//CHECK#1\nif (Number.MAX_VALUE * 1.1 * 0.9 !== (Number.MAX_VALUE * 1.1) * 0.9) {\n $ERROR('#1: Number.MAX_VALUE * 1.1 * 0.9 === (Number.MAX_VALUE * 1.1) * 0.9. Actual: ' + (Number.MAX_VALUE * 1.1 * 0.9));\n} \n\n//CHECK#2\nif ((Number.MAX_VALUE * 1.1) * 0.9 === Number.MAX_VALUE * (1.1 * 0.9)) {\n $ERROR('#2: (Number.MAX_VALUE * 1.1) * 0.9 !== Number.MAX_VALUE * (1.1 * 0.9)');\n}\n",
"id": "S11.5.1_A4_T8"
}
]
}
}

View File

@ -0,0 +1,212 @@
{
"testCollection": {
"name": "11.5.2_Applying_the_slash_Operator",
"numTests": 34,
"tests": [
{
"section": "11.5.2, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009/\\u00091\") !== 1) {\n $ERROR('#1: 1\\\\u0009/\\\\u00091 === 1');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B/\\u000B1\") !== 1) {\n $ERROR('#2: 1\\\\u000B/\\\\u000B1 === 1'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C/\\u000C1\") !== 1) {\n $ERROR('#3: 1\\\\u000C/\\\\u000C1 === 1');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020/\\u00201\") !== 1) {\n $ERROR('#4: 1\\\\u0020/\\\\u00201 === 1');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0/\\u00A01\") !== 1) {\n $ERROR('#5: 1\\\\u00A0/\\\\u00A01 === 1');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A/\\u000A1\") !== 1) {\n $ERROR('#6: 1\\\\u000A/\\\\u000A1 === 1'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D/\\u000D1\") !== 1) {\n $ERROR('#7: 1\\\\u000D/\\\\u000D1 === 1');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028/\\u20281\") !== 1) {\n $ERROR('#8: 1\\\\u2028/\\\\u20281 === 1');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029/\\u20291\") !== 1) {\n $ERROR('#9: 1\\\\u2029/\\\\u20291 === 1');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029/\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== 1) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029/\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === 1');\n}\n",
"id": "S11.5.2_A1"
},
{
"section": "11.5.2",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 / 1 !== 1) {\n $ERROR('#1: 1 / 1 === 1. Actual: ' + (1 / 1));\n}\n\n//CHECK#2\nvar x = 1;\nif (x / 1 !== 1) {\n $ERROR('#2: var x = 1; x / 1 === 1. Actual: ' + (x / 1));\n}\n\n//CHECK#3\nvar y = 1;\nif (1 / y !== 1) {\n $ERROR('#3: var y = 1; 1 / y === 1. Actual: ' + (1 / y));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (x / y !== 1) {\n $ERROR('#4: var x = 1; var y = 1; x / y === 1. Actual: ' + (x / y));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (objectx.prop / objecty.prop !== 1) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop / objecty.prop === 1. Actual: ' + (objectx.prop / objecty.prop));\n}\n \n",
"id": "S11.5.2_A2.1_T1"
},
{
"section": "11.5.2",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x / 1;\n $ERROR('#1.1: x / 1 throw ReferenceError. Actual: ' + (x / 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x / 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.5.2_A2.1_T2"
},
{
"section": "11.5.2",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 / y;\n $ERROR('#1.1: 1 / y throw ReferenceError. Actual: ' + (1 / y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 / y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.5.2_A2.1_T3"
},
{
"section": "11.5.2, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 1}} / 1 !== 1) {\n $ERROR('#1: {valueOf: function() {return 1}} / 1 === 1. Actual: ' + ({valueOf: function() {return 1}} / 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 1}, toString: function() {return 0}} / 1 !== 1) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} / 1 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} / 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 1}, toString: function() {return {}}} / 1 !== 1) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} / 1 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} / 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} / 1 !== 1) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} / 1 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} / 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} / 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} / 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 / {toString: function() {return 1}} !== 1) {\n $ERROR('#5: 1 / {toString: function() {return 1}} === 1. Actual: ' + (1 / {toString: function() {return 1}}));\n}\n\n//CHECK#6\nif (1 / {valueOf: function() {return {}}, toString: function() {return 1}} !== 1) {\n $ERROR('#6: 1 / {valueOf: function() {return {}}, toString: function() {return 1}} === 1. Actual: ' + (1 / {valueOf: function() {return {}}, toString: function() {return 1}}));\n}\n\n//CHECK#7\ntry {\n 1 / {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n $ERROR('#7.1: 1 / {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (1 / {valueOf: function() {throw \"error\"}, toString: function() {return 1}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 / {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 / {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 / {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 / {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 / {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.5.2_A2.2_T1"
},
{
"section": "11.5.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x / y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x / y throw \"x\". Actual: ' + (x / y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x / y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.5.2_A2.3_T1"
},
{
"section": "11.5.2",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) / x !== 1) {\n $ERROR('#1: var x = 0; (x = 1) / x === 1. Actual: ' + ((x = 1) / x));\n}\n\n//CHECK#2\nvar x = 0; \nif (x / (x = 1) !== 0) {\n $ERROR('#2: var x = 0; x / (x = 1) === 0. Actual: ' + (x / (x = 1)));\n}\n\n",
"id": "S11.5.2_A2.4_T1"
},
{
"section": "11.5.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() / y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() / y() throw \"x\". Actual: ' + (x() / y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() / y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.5.2_A2.4_T2"
},
{
"section": "11.5.2",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x / (x = 1);\n $ERROR('#1.1: x / (x = 1) throw ReferenceError. Actual: ' + (x / (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x / (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) / y !== 1) {\n $ERROR('#2: (y = 1) / y === 1. Actual: ' + ((y = 1) / y));\n}\n\n",
"id": "S11.5.2_A2.4_T3"
},
{
"section": "11.5.2",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true / true !== 1) {\n $ERROR('#1: true / true === 1. Actual: ' + (true / true));\n}\n\n//CHECK#2\nif (new Boolean(true) / true !== 1) {\n $ERROR('#2: new Boolean(true) / true === 1. Actual: ' + (new Boolean(true) / true));\n}\n\n//CHECK#3\nif (true / new Boolean(true) !== 1) {\n $ERROR('#3: true / new Boolean(true) === 1. Actual: ' + (true / new Boolean(true)));\n}\n\n//CHECK#4\nif (new Boolean(true) / new Boolean(true) !== 1) {\n $ERROR('#4: new Boolean(true) / new Boolean(true) === 1. Actual: ' + (new Boolean(true) / new Boolean(true)));\n}\n",
"id": "S11.5.2_A3_T1.1"
},
{
"section": "11.5.2",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 / 1 !== 1) {\n $ERROR('#1: 1 / 1 === 1. Actual: ' + (1 / 1));\n}\n\n//CHECK#2\nif (new Number(1) / 1 !== 1) {\n $ERROR('#2: new Number(1) / 1 === 1. Actual: ' + (new Number(1) / 1));\n}\n\n//CHECK#3\nif (1 / new Number(1) !== 1) {\n $ERROR('#3: 1 / new Number(1) === 1. Actual: ' + (1 / new Number(1)));\n}\n\n//CHECK#4\nif (new Number(1) / new Number(1) !== 1) {\n $ERROR('#4: new Number(1) / new Number(1) === 1. Actual: ' + (new Number(1) / new Number(1)));\n}\n\n",
"id": "S11.5.2_A3_T1.2"
},
{
"section": "11.5.2",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" / \"1\" !== 1) {\n $ERROR('#1: \"1\" / \"1\" === 1. Actual: ' + (\"1\" / \"1\"));\n}\n\n//CHECK#2\nif (new String(\"1\") / \"1\" !== 1) {\n $ERROR('#2: new String(\"1\") / \"1\" === 1. Actual: ' + (new String(\"1\") / \"1\"));\n}\n\n//CHECK#3\nif (\"1\" / new String(\"1\") !== 1) {\n $ERROR('#3: \"1\" / new String(\"1\") === 1. Actual: ' + (\"1\" / new String(\"1\")));\n}\n\n//CHECK#4\nif (new String(\"1\") / new String(\"1\") !== 1) {\n $ERROR('#4: new String(\"1\") / new String(\"1\") === 1. Actual: ' + (new String(\"1\") / new String(\"1\")));\n}\n\n//CHECK#5\nif (isNaN(\"x\" / \"1\") !== true) {\n $ERROR('#5: \"x\" / \"1\" === Not-a-Number. Actual: ' + (\"x\" / \"1\"));\n}\n\n//CHECK#6\nif (isNaN(\"1\" / \"x\") !== true) {\n $ERROR('#6: \"1\" / \"x\" === Not-a-Number. Actual: ' + (\"1\" / \"x\"));\n}\n",
"id": "S11.5.2_A3_T1.3"
},
{
"section": "11.5.2",
"description": "Type(x) and Type(y) vary between Null and Undefined",
"test": "//CHECK#1\nif (isNaN(null / undefined) !== true) {\n $ERROR('#1: null / undefined === Not-a-Number. Actual: ' + (null / undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined / null) !== true) {\n $ERROR('#2: undefined / null === Not-a-Number. Actual: ' + (undefined / null));\n}\n\n//CHECK#3\nif (isNaN(undefined / undefined) !== true) {\n $ERROR('#3: undefined / undefined === Not-a-Number. Actual: ' + (undefined / undefined));\n}\n\n//CHECK#4\nif (isNaN(null / null) !== true) {\n $ERROR('#4: null / null === Not-a-Number. Actual: ' + (null / null));\n}\n",
"id": "S11.5.2_A3_T1.4"
},
{
"section": "11.5.2",
"description": "Type(x) and Type(y) vary between Object object and Function object",
"test": "//CHECK#1\nif (isNaN({} / function(){return 1}) !== true) {\n $ERROR('#1: {} / function(){return 1} === Not-a-Number. Actual: ' + ({} / function(){return 1}));\n}\n\n//CHECK#2\nif (isNaN(function(){return 1} / {}) !== true) {\n $ERROR('#2: function(){return 1} / {} === Not-a-Number. Actual: ' + (function(){return 1} / {}));\n}\n\n//CHECK#3\nif (isNaN(function(){return 1} / function(){return 1}) !== true) {\n $ERROR('#3: function(){return 1} / function(){return 1} === Not-a-Number. Actual: ' + (function(){return 1} / function(){return 1}));\n}\n\n//CHECK#4\nif (isNaN({} / {}) !== true) {\n $ERROR('#4: {} / {} === Not-a-Number. Actual: ' + ({} / {}));\n}\n",
"id": "S11.5.2_A3_T1.5"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true / 1 !== 1) {\n $ERROR('#1: true / 1 === 1. Actual: ' + (true / 1));\n}\n\n//CHECK#2\nif (1 / true !== 1) {\n $ERROR('#2: 1 / true === 1. Actual: ' + (1 / true));\n}\n\n//CHECK#3\nif (new Boolean(true) / 1 !== 1) {\n $ERROR('#3: new Boolean(true) / 1 === 1. Actual: ' + (new Boolean(true) / 1));\n}\n\n//CHECK#4\nif (1 / new Boolean(true) !== 1) {\n $ERROR('#4: 1 / new Boolean(true) === 1. Actual: ' + (1 / new Boolean(true)));\n}\n\n//CHECK#5\nif (true / new Number(1) !== 1) {\n $ERROR('#5: true / new Number(1) === 1. Actual: ' + (true / new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) / true !== 1) {\n $ERROR('#6: new Number(1) / true === 1. Actual: ' + (new Number(1) / true));\n}\n\n//CHECK#7\nif (new Boolean(true) / new Number(1) !== 1) {\n $ERROR('#7: new Boolean(true) / new Number(1) === 1. Actual: ' + (new Boolean(true) / new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) / new Boolean(true) !== 1) {\n $ERROR('#8: new Number(1) / new Boolean(true) === 1. Actual: ' + (new Number(1) / new Boolean(true)));\n}\n",
"id": "S11.5.2_A3_T2.1"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" / 1 !== 1) {\n $ERROR('#1: \"1\" / 1 === 1. Actual: ' + (\"1\" / 1));\n}\n\n//CHECK#2\nif (1 / \"1\" !== 1) {\n $ERROR('#2: 1 / \"1\" === 1. Actual: ' + (1 / \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") / 1 !== 1) {\n $ERROR('#3: new String(\"1\") / 1 === 1. Actual: ' + (new String(\"1\") / 1));\n}\n\n//CHECK#4\nif (1 / new String(\"1\") !== 1) {\n $ERROR('#4: 1 / new String(\"1\") === 1. Actual: ' + (1 / new String(\"1\")));\n}\n\n//CHECK#5\nif (\"1\" / new Number(1) !== 1) {\n $ERROR('#5: \"1\" / new Number(1) === 1. Actual: ' + (\"1\" / new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) / \"1\" !== 1) {\n $ERROR('#6: new Number(1) / \"1\" === 1. Actual: ' + (new Number(1) / \"1\"));\n}\n\n//CHECK#7\nif (new String(\"1\") / new Number(1) !== 1) {\n $ERROR('#7: new String(\"1\") / new Number(1) === 1. Actual: ' + (new String(\"1\") / new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) / new String(\"1\") !== 1) {\n $ERROR('#8: new Number(1) / new String(\"1\") === 1. Actual: ' + (new Number(1) / new String(\"1\")));\n}\n\n//CHECK#9\nif (isNaN(\"x\" / 1) !== true) {\n $ERROR('#9: \"x\" / 1 === Not-a-Number. Actual: ' + (\"x\" / 1));\n}\n\n//CHECK#10\nif (isNaN(1 / \"x\") !== true) {\n $ERROR('#10: 1 / \"x\" === Not-a-Number. Actual: ' + (1 / \"x\"));\n}\n",
"id": "S11.5.2_A3_T2.2"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 / null !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: 1 / null === +Infinity. Actual: ' + (1 / null));\n}\n\n//CHECK#2\nif (null / 1 !== 0) {\n $ERROR('#2: null / 1 === 0. Actual: ' + (null / 1));\n}\n\n//CHECK#3\nif (new Number(1) / null !== Number.POSITIVE_INFINITY) {\n $ERROR('#3: new Number(1) / null === +Infinity. Actual: ' + (new Number(1) / null));\n}\n\n//CHECK#4\nif (null / new Number(1) !== 0) {\n $ERROR('#4: null / new Number(1) === 0. Actual: ' + (null / new Number(1)));\n}\n",
"id": "S11.5.2_A3_T2.3"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(1 / undefined) !== true) {\n $ERROR('#1: 1 / undefined === Not-a-Number. Actual: ' + (1 / undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined / 1) !== true) {\n $ERROR('#2: undefined / 1 === Not-a-Number. Actual: ' + (undefined / 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) / undefined) !== true) {\n $ERROR('#3: new Number(1) / undefined === Not-a-Number. Actual: ' + (new Number(1) / undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined / new Number(1)) !== true) {\n $ERROR('#4: undefined / new Number(1) === Not-a-Number. Actual: ' + (undefined / new Number(1)));\n}\n",
"id": "S11.5.2_A3_T2.4"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true / \"1\" !== 1) {\n $ERROR('#1: true / \"1\" === 1. Actual: ' + (true / \"1\"));\n}\n\n//CHECK#2\nif (\"1\" / true !== 1) {\n $ERROR('#2: \"1\" / true === 1. Actual: ' + (\"1\" / true));\n}\n\n//CHECK#3\nif (new Boolean(true) / \"1\" !== 1) {\n $ERROR('#3: new Boolean(true) / \"1\" === 1. Actual: ' + (new Boolean(true) / \"1\"));\n}\n\n//CHECK#4\nif (\"1\" / new Boolean(true) !== 1) {\n $ERROR('#4: \"1\" / new Boolean(true) === 1. Actual: ' + (\"1\" / new Boolean(true)));\n}\n\n//CHECK#5\nif (true / new String(\"1\") !== 1) {\n $ERROR('#5: true / new String(\"1\") === 1. Actual: ' + (true / new String(\"1\")));\n}\n\n//CHECK#6\nif (new String(\"1\") / true !== 1) {\n $ERROR('#6: new String(\"1\") / true === 1. Actual: ' + (new String(\"1\") / true));\n}\n\n//CHECK#7\nif (new Boolean(true) / new String(\"1\") !== 1) {\n $ERROR('#7: new Boolean(true) / new String(\"1\") === 1. Actual: ' + (new Boolean(true) / new String(\"1\")));\n}\n\n//CHECK#8\nif (new String(\"1\") / new Boolean(true) !== 1) {\n $ERROR('#8: new String(\"1\") / new Boolean(true) === 1. Actual: ' + (new String(\"1\") / new Boolean(true)));\n}\n",
"id": "S11.5.2_A3_T2.5"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(\"1\" / undefined) !== true) {\n $ERROR('#1: \"1\" / undefined === Not-a-Number. Actual: ' + (\"1\" / undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined / \"1\") !== true) {\n $ERROR('#2: undefined / \"1\" === Not-a-Number. Actual: ' + (undefined / \"1\"));\n}\n\n//CHECK#3\nif (isNaN(new String(\"1\") / undefined) !== true) {\n $ERROR('#3: new String(\"1\") / undefined === Not-a-Number. Actual: ' + (new String(\"1\") / undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined / new String(\"1\")) !== true) {\n $ERROR('#4: undefined / new String(\"1\") === Not-a-Number. Actual: ' + (undefined / new String(\"1\")));\n}\n",
"id": "S11.5.2_A3_T2.6"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" / null !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: \"1\" / null === +Infinity. Actual: ' + (\"1\" / null));\n}\n\n//CHECK#2\nif (null / \"1\" !== 0) {\n $ERROR('#2: null / \"1\" === 0. Actual: ' + (null / \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") / null !== Number.POSITIVE_INFINITY) {\n $ERROR('#3: new String(\"1\") / null === +Infinity. Actual: ' + (new String(\"1\") / null));\n}\n\n//CHECK#4\nif (null / new String(\"1\") !== 0) {\n $ERROR('#4: null / new String(\"1\") === 0. Actual: ' + (null / new String(\"1\")));\n}\n",
"id": "S11.5.2_A3_T2.7"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(true / undefined) !== true) {\n $ERROR('#1: true / undefined === Not-a-Number. Actual: ' + (true / undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined / true) !== true) {\n $ERROR('#2: undefined / true === Not-a-Number. Actual: ' + (undefined / true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) / undefined) !== true) {\n $ERROR('#3: new Boolean(true) / undefined === Not-a-Number. Actual: ' + (new Boolean(true) / undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined / new Boolean(true)) !== true) {\n $ERROR('#4: undefined / new Boolean(true) === Not-a-Number. Actual: ' + (undefined / new Boolean(true)));\n}\n",
"id": "S11.5.2_A3_T2.8"
},
{
"section": "11.5.2",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true / null !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: true / null === +Infinity. Actual: ' + (true / null));\n}\n\n//CHECK#2\nif (null / true !== 0) {\n $ERROR('#2: null / true === 0. Actual: ' + (null / true));\n}\n\n//CHECK#3\nif (new Boolean(true) / null !== Number.POSITIVE_INFINITY) {\n $ERROR('#3: new Boolean(true) / null === +Infinity. Actual: ' + (new Boolean(true) / null));\n}\n\n//CHECK#4\nif (null / new Boolean(true) !== 0) {\n $ERROR('#4: null / new Boolean(true) === 0. Actual: ' + (null / new Boolean(true)));\n}\n",
"id": "S11.5.2_A3_T2.9"
},
{
"section": "11.5.2",
"description": "If left operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN / Number.NaN) !== true) {\n $ERROR('#1: NaN / NaN === Not-a-Number. Actual: ' + (NaN / NaN));\n} \n\n//CHECK#2\nif (isNaN(Number.NaN / +0) !== true) {\n $ERROR('#2: NaN / +0 === Not-a-Number. Actual: ' + (NaN / +0)); \n} \n\n//CHECK#3\nif (isNaN(Number.NaN / -0) !== true) {\n $ERROR('#3: NaN / -0 === Not-a-Number. Actual: ' + (NaN / -0)); \n} \n\n//CHECK#4\nif (isNaN(Number.NaN / Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: NaN / Infinity === Not-a-Number. Actual: ' + (NaN / Infinity));\n} \n\n//CHECK#5\nif (isNaN(Number.NaN / Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#5: NaN / -Infinity === Not-a-Number. Actual: ' + (NaN / -Infinity)); \n} \n\n//CHECK#6\nif (isNaN(Number.NaN / Number.MAX_VALUE) !== true) {\n $ERROR('#6: NaN / Number.MAX_VALUE === Not-a-Number. Actual: ' + (NaN / Number.MAX_VALUE));\n} \n\n//CHECK#7\nif (isNaN(Number.NaN / Number.MIN_VALUE) !== true) {\n $ERROR('#7: NaN / Number.MIN_VALUE === Not-a-Number. Actual: ' + (NaN / Number.MIN_VALUE)); \n}\n\n//CHECK#8\nif (isNaN(Number.NaN / 1) !== true) {\n $ERROR('#8: NaN / 1 === Not-a-Number. Actual: ' + (NaN / 1)); \n} \n",
"id": "S11.5.2_A4_T1.1"
},
{
"section": "11.5.2",
"description": "If right operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN / Number.NaN) !== true) {\n $ERROR('#1: NaN / NaN === Not-a-Number. Actual: ' + (NaN / NaN));\n} \n\n//CHECK#2\nif (isNaN(+0 / Number.NaN) !== true) {\n $ERROR('#2: +0 / NaN === Not-a-Number. Actual: ' + (+0 / NaN)); \n} \n\n//CHECK#3\nif (isNaN(-0 / Number.NaN) !== true) {\n $ERROR('#3: -0 / NaN === Not-a-Number. Actual: ' + (-0 / NaN)); \n} \n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY / Number.NaN) !== true) {\n $ERROR('#4: Infinity / NaN === Not-a-Number. Actual: ' + (Infinity / NaN));\n} \n\n//CHECK#5\nif (isNaN(Number.NEGATIVE_INFINITY / Number.NaN) !== true) {\n $ERROR('#5: -Infinity / NaN === Not-a-Number. Actual: ' + ( -Infinity / NaN)); \n} \n\n//CHECK#6\nif (isNaN(Number.MAX_VALUE / Number.NaN) !== true) {\n $ERROR('#6: Number.MAX_VALUE / NaN === Not-a-Number. Actual: ' + (Number.MAX_VALUE / NaN));\n} \n\n//CHECK#7\nif (isNaN(Number.MIN_VALUE / Number.NaN) !== true) {\n $ERROR('#7: Number.MIN_VALUE / NaN === Not-a-Number. Actual: ' + (Number.MIN_VALUE / NaN)); \n}\n\n//CHECK#8\nif (isNaN(1 / Number.NaN) !== true) {\n $ERROR('#8: 1 / NaN === Not-a-Number. Actual: ' + (1 / NaN)); \n}\n",
"id": "S11.5.2_A4_T1.2"
},
{
"section": "11.5.2",
"description": "If both operands are finite and nonzero, the quotient is computed and rounded using IEEE 754 round-to-nearest mode.\nIf the magnitude is too small to represent, the result is then a zero of appropriate sign",
"test": "//CHECK#1\nif (Number.MIN_VALUE / 2.1 !== 0) {\n $ERROR('#1: Number.MIN_VALUE / 2.1 === 0. Actual: ' + (Number.MIN_VALUE / 2.1));\n}\n\n//CHECK#2\nif (Number.MIN_VALUE / -2.1 !== -0) {\n $ERROR('#2.1: Number.MIN_VALUE / -2.1 === 0. Actual: ' + (Number.MIN_VALUE / -2.1));\n} else {\n if (1 / (Number.MIN_VALUE / -2.1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2.2: Number.MIN_VALUE / -2.1 === -0. Actual: +0');\n }\n}\n\n//CHECK#3\nif (Number.MIN_VALUE / 2.0 !== 0) {\n $ERROR('#3: Number.MIN_VALUE / 2.0 === 0. Actual: ' + (Number.MIN_VALUE / 2.0));\n}\n\n//CHECK#4\nif (Number.MIN_VALUE / -2.0 !== -0) {\n $ERROR('#4.1: Number.MIN_VALUE / -2.0 === -0. Actual: ' + (Number.MIN_VALUE / -2.0));\n} else {\n if (1 / (Number.MIN_VALUE / -2.0) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4.2: Number.MIN_VALUE / -2.0 === -0. Actual: +0');\n }\n}\n\n//CHECK#5\nif (Number.MIN_VALUE / 1.9 !== Number.MIN_VALUE) {\n $ERROR('#5: Number.MIN_VALUE / 1.9 === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / 1.9));\n}\n\n//CHECK#6\nif (Number.MIN_VALUE / -1.9 !== -Number.MIN_VALUE) {\n $ERROR('#6: Number.MIN_VALUE / -1.9 === -Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / -1.9));\n}\n\n//CHECK#7\nif (Number.MIN_VALUE / 1.1 !== Number.MIN_VALUE) {\n $ERROR('#7: Number.MIN_VALUE / 1.1 === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / 1.1));\n}\n\n//CHECK#8\nif (Number.MIN_VALUE / -1.1 !== -Number.MIN_VALUE) {\n $ERROR('#8: Number.MIN_VALUE / -1.1 === -Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / -1.1));\n} \n",
"id": "S11.5.2_A4_T10"
},
{
"section": "11.5.2",
"description": "The sign of the result is positive if both operands have the same sign, negative if the operands have different signs",
"test": "//CHECK#1\nif (1 / 1 !== 1) {\n $ERROR('#1: 1 / 1 === 1. Actual: ' + (1 / 1));\n}\n\n//CHECK#2\nif (1 / -1 !== -1) {\n $ERROR('#2: 1 / -1 === -1. Actual: ' + (1 / -1));\n}\n\n//CHECK#3\nif (-1 / 1 !== -1) {\n $ERROR('#3: -1 / 1 === -1. Actual: ' + (-1 / 1));\n}\n\n//CHECK#4\nif (-1 / -1 !== 1) {\n $ERROR('#4: -1 / -1 === 1. Actual: ' + (-1 / -1));\n}\n",
"id": "S11.5.2_A4_T2"
},
{
"section": "11.5.2",
"description": "Division of an infinity by a zero results in an infinity of appropriate sign",
"test": "//CHECK#1\nif (Number.NEGATIVE_INFINITY / 0 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1: Infinity / 0 === Infinity. Actual: ' + (Infinity / 0));\n}\n\n//CHECK#2\nif (Number.NEGATIVE_INFINITY / -0 !== Number.POSITIVE_INFINITY) {\n $ERROR('#2: -Infinity / -0 === Infinity. Actual: ' + (-Infinity / -0));\n}\n\n//CHECK#3\nif (Number.POSITIVE_INFINITY / 0 !== Number.POSITIVE_INFINITY) {\n $ERROR('#3: Infinity / 0 === Infinity. Actual: ' + (Infinity / 0));\n}\n\n//CHECK#4\nif (Number.POSITIVE_INFINITY / -0 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4: Infinity / -0 === -Infinity. Actual: ' + (Infinity / -0));\n}\n",
"id": "S11.5.2_A4_T3"
},
{
"section": "11.5.2",
"description": "Division of an infinity by an infinity results in NaN",
"test": "//CHECK#1\nif (isNaN(Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#1: -Infinity / -Infinity === Not-a-Number. Actual: ' + (-Infinity / -Infinity));\n}\n\n//CHECK#2\nif (isNaN(Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#2: Infinity / Infinity === Not-a-Number. Actual: ' + (Infinity / Infinity));\n}\n\n//CHECK#3\nif (isNaN(Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#3: -Infinity / Infinity === Not-a-Number. Actual: ' + (-Infinity / Infinity));\n}\n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: Infinity / -Infinity === Not-a-Number. Actual: ' + (Infinity / -Infinity));\n}\n",
"id": "S11.5.2_A4_T4"
},
{
"section": "11.5.2",
"description": "Division of an infinity by a finite non-zero value results in a signed infinity",
"test": "//CHECK#1\nif (Number.NEGATIVE_INFINITY / 1 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1: -Infinity / 1 === -Infinity. Actual: ' + (-Infinity / 1));\n}\n\n//CHECK#2\nif (Number.NEGATIVE_INFINITY / -1 !== Number.POSITIVE_INFINITY) {\n $ERROR('#2: -Infinity / -1 === Infinity. Actual: ' + (-Infinity / -1));\n}\n\n//CHECK#3\nif (Number.POSITIVE_INFINITY / 1 !== Number.POSITIVE_INFINITY) {\n $ERROR('#3: Infinity / 1 === Infinity. Actual: ' + (Infinity / 1));\n}\n\n//CHECK#4\nif (Number.POSITIVE_INFINITY / -1 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4: Infinity / -1 === -Infinity. Actual: ' + (Infinity / -1));\n}\n\n//CHECK#5\nif (Number.POSITIVE_INFINITY / -Number.MAX_VALUE !== Number.NEGATIVE_INFINITY) {\n $ERROR('#5: Infinity / -Number.MAX_VALUE === -Infinity. Actual: ' + (Infinity / -Number.MAX_VALUE));\n}\n\n//CHECK#6\nif (Number.NEGATIVE_INFINITY / Number.MIN_VALUE !== Number.NEGATIVE_INFINITY) {\n $ERROR('#6: -Infinity / Number.MIN_VALUE === -Infinity. Actual: ' + (-Infinity / Number.MIN_VALUE));\n}\n",
"id": "S11.5.2_A4_T5"
},
{
"section": "11.5.2",
"description": "Division of a finite value by an infinity results in zero of appropriate sign",
"test": "//CHECK#1\nif (1 / Number.NEGATIVE_INFINITY !== -0) {\n $ERROR('#1.1: 1 / -Infinity === 0. Actual: ' + (1 / -Infinity));\n} else {\n if (1 / (1 / Number.NEGATIVE_INFINITY) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1.2: 1 / -Infinity === - 0. Actual: +0');\n }\n}\n\n//CHECK#2\nif (-1 / Number.NEGATIVE_INFINITY !== +0) {\n $ERROR('#2.1: -1 / -Infinity === 0. Actual: ' + (-1 / -Infinity));\n} else {\n if (1 / (-1 / Number.NEGATIVE_INFINITY) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: -1 / -Infinity === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (1 / Number.POSITIVE_INFINITY !== +0) {\n $ERROR('#3.1: 1 / Infinity === 0. Actual: ' + (1 / Infinity));\n} else {\n if (1 / (1 / Number.POSITIVE_INFINITY) !== Number.POSITIVE_INFINITY) {\n $ERROR('#3.2: 1 / Infinity === + 0. Actual: -0');\n }\n}\n\n//CHECK#4\nif (-1 / Number.POSITIVE_INFINITY !== -0) {\n $ERROR('#4.1: -1 / Infinity === 0. Actual: ' + (-1 / Infinity));\n} else {\n if (1 / (-1 / Number.POSITIVE_INFINITY) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4.2: -1 / Infinity === - 0. Actual: +0');\n }\n}\n",
"id": "S11.5.2_A4_T6"
},
{
"section": "11.5.2",
"description": "Division of a zero by a zero results in NaN",
"test": "//CHECK#1\nif (isNaN(+0 / +0) !== true) {\n $ERROR('#1: +0 / +0 === Not-a-Number. Actual: ' + (+0 / +0));\n} \n\n//CHECK#2\nif (isNaN(-0 / +0) !== true) {\n $ERROR('#2: -0 / +0 === Not-a-Number. Actual: ' + (-0 / +0)); \n} \n\n//CHECK#3\nif (isNaN(+0 / -0) !== true) {\n $ERROR('#3: +0 / -0 === Not-a-Number. Actual: ' + (+0 / -0)); \n} \n\n//CHECK#4\nif (isNaN(-0 / -0) !== true) {\n $ERROR('#4: -0 / -0 === Not-a-Number. Actual: ' + (-0 / -0));\n} \n",
"id": "S11.5.2_A4_T7"
},
{
"section": "11.5.2",
"description": "Division of a zero by any non-zero finite value -0 results in zero of appropriate sign",
"test": "//CHECK#1\nif (-0 / 1 !== -0) {\n $ERROR('#1.1: -0 / 1 === 0. Actual: ' + (-0 / 1));\n} else {\n if (1 / (-0 / 1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1.2: -0 / 1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#2\nif (-0 / -1 !== +0) {\n $ERROR('#2.1: -0 / -1 === 0. Actual: ' + (-0 / -1));\n} else {\n if (1 / (-0 / -1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: -0 / -1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (+0 / 1 !== +0) {\n $ERROR('#3.1: +0 / 1 === 0. Actual: ' + (+0 / 1));\n} else {\n if (1 / (+0 / -1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3.2: +0 / -1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#4\nif (+0 / -1 !== -0) {\n $ERROR('#4.1: +0 / -1 === 0. Actual: ' + (+0 / -1));\n} else {\n if (1 / (+0 / -1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4.2: +0 / -1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#5\nif (+0 / -Number.MAX_VALUE !== -0) {\n $ERROR('#5.1: 0 / -Number.MAX_VALUE === 0. Actual: ' + (0 / -Number.MAX_VALUE));\n} else {\n if (1 / (+0 / -Number.MAX_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#5.2: +0 / -Number.MAX_VALUE === - 0. Actual: +0');\n }\n}\n\n//CHECK#6\nif (-0 / Number.MIN_VALUE !== -0) {\n $ERROR('#6.1: -0 / Number.MIN_VALUE === 0. Actual: ' + (-0 / Number.MIN_VALUE));\n} else {\n if (1 / (-0 / Number.MIN_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#6.2: -0 / Number.MIN_VALUE === - 0. Actual: +0');\n }\n}\n",
"id": "S11.5.2_A4_T8"
},
{
"section": "11.5.2",
"description": "If the magnitude is too large to represent, the result is then an infinity of appropriate sign",
"test": "//CHECK#1\nif (Number.MAX_VALUE / 0.9 !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: Number.MAX_VALUE / 0.9 === Number.POSITIVE_INFINITY. Actual: ' + (Number.MAX_VALUE / 0.9));\n}\n\n//CHECK#2\nif (Number.MAX_VALUE / -0.9 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2: Number.MAX_VALUE / -0.9 === Number.NEGATIVE_INFINITY. Actual: ' + (Number.MAX_VALUE / -0.9));\n} \n\n//CHECK#3\nif (Number.MAX_VALUE / 1 !== Number.MAX_VALUE) {\n $ERROR('#3: Number.MAX_VALUE / 1 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE / 1));\n}\n\n//CHECK#4\nif (Number.MAX_VALUE / -1 !== -Number.MAX_VALUE) {\n $ERROR('#4: Number.MAX_VALUE / -1 === -Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE / -1));\n} \n\n//CHECK#5\nif (Number.MAX_VALUE / (Number.MAX_VALUE / 0.9) === (Number.MAX_VALUE / Number.MAX_VALUE) / 0.9) {\n $ERROR('#5: Number.MAX_VALUE / (Number.MAX_VALUE / 0.9) !== (Number.MAX_VALUE / Number.MAX_VALUE) / 0.9');\n}\n",
"id": "S11.5.2_A4_T9"
}
]
}
}

View File

@ -0,0 +1,194 @@
{
"testCollection": {
"name": "11.5.3_Applying_the_percent_Operator",
"numTests": 31,
"tests": [
{
"section": "11.5.3, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009%\\u00091\") !== 0) {\n $ERROR('#1: 1\\\\u0009%\\\\u00091 === 0');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B%\\u000B1\") !== 0) {\n $ERROR('#2: 1\\\\u000B%\\\\u000B1 === 0'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C%\\u000C1\") !== 0) {\n $ERROR('#3: 1\\\\u000C%\\\\u000C1 === 0');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020%\\u00201\") !== 0) {\n $ERROR('#4: 1\\\\u0020%\\\\u00201 === 0');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0%\\u00A01\") !== 0) {\n $ERROR('#5: 1\\\\u00A0%\\\\u00A01 === 0');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A%\\u000A1\") !== 0) {\n $ERROR('#6: 1\\\\u000A%\\\\u000A1 === 0'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D%\\u000D1\") !== 0) {\n $ERROR('#7: 1\\\\u000D%\\\\u000D1 === 0');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028%\\u20281\") !== 0) {\n $ERROR('#8: 1\\\\u2028%\\\\u20281 === 0');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029%\\u20291\") !== 0) {\n $ERROR('#9: 1\\\\u2029%\\\\u20291 === 0');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029%\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== 0) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029%\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === 0');\n}\n",
"id": "S11.5.3_A1"
},
{
"section": "11.5.3",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 % 2 !== 1) {\n $ERROR('#1: 1 % 2 === 1. Actual: ' + (1 % 2));\n}\n\n//CHECK#2\nvar x = 1;\nif (x % 2 !== 1) {\n $ERROR('#2: var x = 1; x % 2 === 1. Actual: ' + (x % 2));\n}\n\n//CHECK#3\nvar y = 2;\nif (1 % y !== 1) {\n $ERROR('#3: var y = 2; 1 % y === 1. Actual: ' + (1 % y));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 2;\nif (x % y !== 1) {\n $ERROR('#4: var x = 1; var y = 2; x % y === 1. Actual: ' + (x % y));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 2;\nif (objectx.prop % objecty.prop !== 1) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 2; objectx.prop % objecty.prop === 1. Actual: ' + (objectx.prop % objecty.prop));\n}\n",
"id": "S11.5.3_A2.1_T1"
},
{
"section": "11.5.3",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x % 1;\n $ERROR('#1.1: x % 1 throw ReferenceError. Actual: ' + (x % 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x % 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.5.3_A2.1_T2"
},
{
"section": "11.5.3",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 % y;\n $ERROR('#1.1: 1 % y throw ReferenceError. Actual: ' + (1 % y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 % y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.5.3_A2.1_T3"
},
{
"section": "11.5.3, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 1}} % 2 !== 1) {\n $ERROR('#1: {valueOf: function() {return 1}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}} % 2));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 1}, toString: function() {return 0}} % 2 !== 1) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} % 2));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 1}, toString: function() {return {}}} % 2 !== 1) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} % 2));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 !== 1) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 % {toString: function() {return 2}} !== 1) {\n $ERROR('#5: 1 % {toString: function() {return 2}} === 1. Actual: ' + (1 % {toString: function() {return 2}}));\n}\n\n//CHECK#6\nif (1 % {valueOf: function() {return {}}, toString: function() {return 2}} !== 1) {\n $ERROR('#6: 1 % {valueOf: function() {return {}}, toString: function() {return 2}} === 1. Actual: ' + (1 % {valueOf: function() {return {}}, toString: function() {return 2}}));\n}\n\n//CHECK#7\ntry {\n 1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}};\n $ERROR('#7.1: 1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 % {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 % {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 % {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 % {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.5.3_A2.2_T1"
},
{
"section": "11.5.3",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x % y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x % y throw \"x\". Actual: ' + (x % y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x % y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.5.3_A2.3_T1"
},
{
"section": "11.5.3",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) % x !== 0) {\n $ERROR('#1: var x = 0; (x = 1) % x === 0. Actual: ' + ((x = 1) % x));\n}\n\n//CHECK#2\nvar x = 1; \nif (x % (x = 2) !== 1) {\n $ERROR('#2: var x = 1; x % (x = 2) === 1. Actual: ' + (x % (x = 2)));\n}\n\n",
"id": "S11.5.3_A2.4_T1"
},
{
"section": "11.5.3",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() % y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() % y() throw \"x\". Actual: ' + (x() % y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() % y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.5.3_A2.4_T2"
},
{
"section": "11.5.3",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x % (x = 1);\n $ERROR('#1.1: x % (x = 1) throw ReferenceError. Actual: ' + (x % (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x % (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) % y !== 0) {\n $ERROR('#2: (y = 1) % y === 0. Actual: ' + ((y = 1) % y));\n}\n\n",
"id": "S11.5.3_A2.4_T3"
},
{
"section": "11.5.3",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true % true !== 0) {\n $ERROR('#1: true % true === 0. Actual: ' + (true % true));\n}\n\n//CHECK#2\nif (new Boolean(true) % true !== 0) {\n $ERROR('#2: new Boolean(true) % true === 0. Actual: ' + (new Boolean(true) % true));\n}\n\n//CHECK#3\nif (true % new Boolean(true) !== 0) {\n $ERROR('#3: true % new Boolean(true) === 0. Actual: ' + (true % new Boolean(true)));\n}\n\n//CHECK#4\nif (new Boolean(true) % new Boolean(true) !== 0) {\n $ERROR('#4: new Boolean(true) % new Boolean(true) === 0. Actual: ' + (new Boolean(true) % new Boolean(true)));\n}\n",
"id": "S11.5.3_A3_T1.1"
},
{
"section": "11.5.3",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 % 1 !== 0) {\n $ERROR('#1: 1 % 1 === 0. Actual: ' + (1 % 1));\n}\n\n//CHECK#2\nif (new Number(1) % 1 !== 0) {\n $ERROR('#2: new Number(1) % 1 === 0. Actual: ' + (new Number(1) % 1));\n}\n\n//CHECK#3\nif (1 % new Number(1) !== 0) {\n $ERROR('#3: 1 % new Number(1) === 0. Actual: ' + (1 % new Number(1)));\n}\n\n//CHECK#4\nif (new Number(1) % new Number(1) !== 0) {\n $ERROR('#4: new Number(1) % new Number(1) === 0. Actual: ' + (new Number(1) % new Number(1)));\n}\n\n",
"id": "S11.5.3_A3_T1.2"
},
{
"section": "11.5.3",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" % \"1\" !== 0) {\n $ERROR('#1: \"1\" % \"1\" === 0. Actual: ' + (\"1\" % \"1\"));\n}\n\n//CHECK#2\nif (new String(\"1\") % \"1\" !== 0) {\n $ERROR('#2: new String(\"1\") % \"1\" === 0. Actual: ' + (new String(\"1\") % \"1\"));\n}\n\n//CHECK#3\nif (\"1\" % new String(\"1\") !== 0) {\n $ERROR('#3: \"1\" % new String(\"1\") === 0. Actual: ' + (\"1\" % new String(\"1\")));\n}\n\n//CHECK#4\nif (new String(\"1\") % new String(\"1\") !== 0) {\n $ERROR('#4: new String(\"1\") % new String(\"1\") === 0. Actual: ' + (new String(\"1\") % new String(\"1\")));\n}\n\n//CHECK#5\nif (isNaN(\"x\" % \"1\") !== true) {\n $ERROR('#5: \"x\" % \"1\" === Not-a-Number. Actual: ' + (\"x\" % \"1\"));\n}\n\n//CHECK#6\nif (isNaN(\"1\" % \"x\") !== true) {\n $ERROR('#6: \"1\" % \"x\" === Not-a-Number. Actual: ' + (\"1\" % \"x\"));\n}\n",
"id": "S11.5.3_A3_T1.3"
},
{
"section": "11.5.3",
"description": "Type(x) and Type(y) vary between Null and Undefined",
"test": "//CHECK#1\nif (isNaN(null % undefined) !== true) {\n $ERROR('#1: null % undefined === Not-a-Number. Actual: ' + (null % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % null) !== true) {\n $ERROR('#2: undefined % null === Not-a-Number. Actual: ' + (undefined % null));\n}\n\n//CHECK#3\nif (isNaN(undefined % undefined) !== true) {\n $ERROR('#3: undefined % undefined === Not-a-Number. Actual: ' + (undefined % undefined));\n}\n\n//CHECK#4\nif (isNaN(null % null) !== true) {\n $ERROR('#4: null % null === Not-a-Number. Actual: ' + (null % null));\n}\n",
"id": "S11.5.3_A3_T1.4"
},
{
"section": "11.5.3",
"description": "Type(x) and Type(y) vary between Object object and Function object",
"test": "//CHECK#1\nif (isNaN({} % function(){return 1}) !== true) {\n $ERROR('#1: {} % function(){return 1} === Not-a-Number. Actual: ' + ({} % function(){return 1}));\n}\n\n//CHECK#2\nif (isNaN(function(){return 1} % {}) !== true) {\n $ERROR('#2: function(){return 1} % {} === Not-a-Number. Actual: ' + (function(){return 1} % {}));\n}\n\n//CHECK#3\nif (isNaN(function(){return 1} % function(){return 1}) !== true) {\n $ERROR('#3: function(){return 1} % function(){return 1} === Not-a-Number. Actual: ' + (function(){return 1} % function(){return 1}));\n}\n\n//CHECK#4\nif (isNaN({} % {}) !== true) {\n $ERROR('#4: {} % {} === Not-a-Number. Actual: ' + ({} % {}));\n}\n",
"id": "S11.5.3_A3_T1.5"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true % 1 !== 0) {\n $ERROR('#1: true % 1 === 0. Actual: ' + (true % 1));\n}\n\n//CHECK#2\nif (1 % true !== 0) {\n $ERROR('#2: 1 % true === 0. Actual: ' + (1 % true));\n}\n\n//CHECK#3\nif (new Boolean(true) % 1 !== 0) {\n $ERROR('#3: new Boolean(true) % 1 === 0. Actual: ' + (new Boolean(true) % 1));\n}\n\n//CHECK#4\nif (1 % new Boolean(true) !== 0) {\n $ERROR('#4: 1 % new Boolean(true) === 0. Actual: ' + (1 % new Boolean(true)));\n}\n\n//CHECK#5\nif (true % new Number(1) !== 0) {\n $ERROR('#5: true % new Number(1) === 0. Actual: ' + (true % new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) % true !== 0) {\n $ERROR('#6: new Number(1) % true === 0. Actual: ' + (new Number(1) % true));\n}\n\n//CHECK#7\nif (new Boolean(true) % new Number(1) !== 0) {\n $ERROR('#7: new Boolean(true) % new Number(1) === 0. Actual: ' + (new Boolean(true) % new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) % new Boolean(true) !== 0) {\n $ERROR('#8: new Number(1) % new Boolean(true) === 0. Actual: ' + (new Number(1) % new Boolean(true)));\n}\n",
"id": "S11.5.3_A3_T2.1"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" % 1 !== 0) {\n $ERROR('#1: \"1\" % 1 === 0. Actual: ' + (\"1\" % 1));\n}\n\n//CHECK#2\nif (1 % \"1\" !== 0) {\n $ERROR('#2: 1 % \"1\" === 0. Actual: ' + (1 % \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") % 1 !== 0) {\n $ERROR('#3: new String(\"1\") % 1 === 0. Actual: ' + (new String(\"1\") % 1));\n}\n\n//CHECK#4\nif (1 % new String(\"1\") !== 0) {\n $ERROR('#4: 1 % new String(\"1\") === 0. Actual: ' + (1 % new String(\"1\")));\n}\n\n//CHECK#5\nif (\"1\" % new Number(1) !== 0) {\n $ERROR('#5: \"1\" % new Number(1) === 0. Actual: ' + (\"1\" % new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) % \"1\" !== 0) {\n $ERROR('#6: new Number(1) % \"1\" === 0. Actual: ' + (new Number(1) % \"1\"));\n}\n\n//CHECK#7\nif (new String(\"1\") % new Number(1) !== 0) {\n $ERROR('#7: new String(\"1\") % new Number(1) === 0. Actual: ' + (new String(\"1\") % new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) % new String(\"1\") !== 0) {\n $ERROR('#8: new Number(1) % new String(\"1\") === 0. Actual: ' + (new Number(1) % new String(\"1\")));\n}\n\n//CHECK#9\nif (isNaN(\"x\" % 1) !== true) {\n $ERROR('#9: \"x\" % 1 === Not-a-Number. Actual: ' + (\"x\" % 1));\n}\n\n//CHECK#10\nif (isNaN(1 % \"x\") !== true) {\n $ERROR('#10: 1 % \"x\" === Not-a-Number. Actual: ' + (1 % \"x\"));\n}\n",
"id": "S11.5.3_A3_T2.2"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (isNaN(1 % null) !== true) {\n $ERROR('#1: 1 % null === Not-a-Number. Actual: ' + (1 % null));\n}\n\n//CHECK#2\nif (null % 1 !== 0) {\n $ERROR('#2: null % 1 === 0. Actual: ' + (null % 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) % null) !== true) {\n $ERROR('#3: new Number(1) % null === Not-a-Number. Actual: ' + (new Number(1) % null));\n}\n\n//CHECK#4\nif (null % new Number(1) !== 0) {\n $ERROR('#4: null % new Number(1) === 0. Actual: ' + (null % new Number(1)));\n}\n",
"id": "S11.5.3_A3_T2.3"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(1 % undefined) !== true) {\n $ERROR('#1: 1 % undefined === Not-a-Number. Actual: ' + (1 % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % 1) !== true) {\n $ERROR('#2: undefined % 1 === Not-a-Number. Actual: ' + (undefined % 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) % undefined) !== true) {\n $ERROR('#3: new Number(1) % undefined === Not-a-Number. Actual: ' + (new Number(1) % undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined % new Number(1)) !== true) {\n $ERROR('#4: undefined % new Number(1) === Not-a-Number. Actual: ' + (undefined % new Number(1)));\n}\n",
"id": "S11.5.3_A3_T2.4"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true % \"1\" !== 0) {\n $ERROR('#1: true % \"1\" === 0. Actual: ' + (true % \"1\"));\n}\n\n//CHECK#2\nif (\"1\" % true !== 0) {\n $ERROR('#2: \"1\" % true === 0. Actual: ' + (\"1\" % true));\n}\n\n//CHECK#3\nif (new Boolean(true) % \"1\" !== 0) {\n $ERROR('#3: new Boolean(true) % \"1\" === 0. Actual: ' + (new Boolean(true) % \"1\"));\n}\n\n//CHECK#4\nif (\"1\" % new Boolean(true) !== 0) {\n $ERROR('#4: \"1\" % new Boolean(true) === 0. Actual: ' + (\"1\" % new Boolean(true)));\n}\n\n//CHECK#5\nif (true % new String(\"1\") !== 0) {\n $ERROR('#5: true % new String(\"1\") === 0. Actual: ' + (true % new String(\"1\")));\n}\n\n//CHECK#6\nif (new String(\"1\") % true !== 0) {\n $ERROR('#6: new String(\"1\") % true === 0. Actual: ' + (new String(\"1\") % true));\n}\n\n//CHECK#7\nif (new Boolean(true) % new String(\"1\") !== 0) {\n $ERROR('#7: new Boolean(true) % new String(\"1\") === 0. Actual: ' + (new Boolean(true) % new String(\"1\")));\n}\n\n//CHECK#8\nif (new String(\"1\") % new Boolean(true) !== 0) {\n $ERROR('#8: new String(\"1\") % new Boolean(true) === 0. Actual: ' + (new String(\"1\") % new Boolean(true)));\n}\n",
"id": "S11.5.3_A3_T2.5"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(\"1\" % undefined) !== true) {\n $ERROR('#1: \"1\" % undefined === Not-a-Number. Actual: ' + (\"1\" % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % \"1\") !== true) {\n $ERROR('#2: undefined % \"1\" === Not-a-Number. Actual: ' + (undefined % \"1\"));\n}\n\n//CHECK#3\nif (isNaN(new String(\"1\") % undefined) !== true) {\n $ERROR('#3: new String(\"1\") % undefined === Not-a-Number. Actual: ' + (new String(\"1\") % undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined % new String(\"1\")) !== true) {\n $ERROR('#4: undefined % new String(\"1\") === Not-a-Number. Actual: ' + (undefined % new String(\"1\")));\n}\n",
"id": "S11.5.3_A3_T2.6"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (isNaN(\"1\" % null) !== true) {\n $ERROR('#1: \"1\" % null === Not-a-Number. Actual: ' + (\"1\" % null));\n}\n\n//CHECK#2\nif (null % \"1\" !== 0) {\n $ERROR('#2: null % \"1\" === 0. Actual: ' + (null % \"1\"));\n}\n\n//CHECK#3\nif (isNaN(new String(\"1\") % null) !== true) {\n $ERROR('#3: new String(\"1\") % null === Not-a-Number. Actual: ' + (new String(\"1\") % null));\n}\n\n//CHECK#4\nif (null % new String(\"1\") !== 0) {\n $ERROR('#4: null % new String(\"1\") === 0. Actual: ' + (null % new String(\"1\")));\n}\n",
"id": "S11.5.3_A3_T2.7"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(true % undefined) !== true) {\n $ERROR('#1: true % undefined === Not-a-Number. Actual: ' + (true % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % true) !== true) {\n $ERROR('#2: undefined % true === Not-a-Number. Actual: ' + (undefined % true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) % undefined) !== true) {\n $ERROR('#3: new Boolean(true) % undefined === Not-a-Number. Actual: ' + (new Boolean(true) % undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined % new Boolean(true)) !== true) {\n $ERROR('#4: undefined % new Boolean(true) === Not-a-Number. Actual: ' + (undefined % new Boolean(true)));\n}\n",
"id": "S11.5.3_A3_T2.8"
},
{
"section": "11.5.3",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (isNaN(true % null) !== true) {\n $ERROR('#1: true % null === Not-a-Number. Actual: ' + (true % null));\n}\n\n//CHECK#2\nif (null % true !== 0) {\n $ERROR('#2: null % true === 0. Actual: ' + (null % true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) % null) !== true) {\n $ERROR('#3: new Boolean(true) % null === Not-a-Number. Actual: ' + (new Boolean(true) % null));\n}\n\n//CHECK#4\nif (null % new Boolean(true) !== 0) {\n $ERROR('#4: null % new Boolean(true) === 0. Actual: ' + (null % new Boolean(true)));\n}\n",
"id": "S11.5.3_A3_T2.9"
},
{
"section": "11.5.3",
"description": "If either operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN % Number.NaN) !== true) {\n $ERROR('#1: NaN % NaN === Not-a-Number. Actual: ' + (NaN % NaN));\n} \n\n//CHECK#2\nif (isNaN(Number.NaN % +0) !== true) {\n $ERROR('#2: NaN % +0 === Not-a-Number. Actual: ' + (NaN % +0)); \n} \n\n//CHECK#3\nif (isNaN(Number.NaN % -0) !== true) {\n $ERROR('#3: NaN % -0 === Not-a-Number. Actual: ' + (NaN % -0)); \n} \n\n//CHECK#4\nif (isNaN(Number.NaN % Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: NaN % Infinity === Not-a-Number. Actual: ' + (NaN % Infinity));\n} \n\n//CHECK#5\nif (isNaN(Number.NaN % Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#5: NaN % -Infinity === Not-a-Number. Actual: ' + (NaN % -Infinity)); \n} \n\n//CHECK#6\nif (isNaN(Number.NaN % Number.MAX_VALUE) !== true) {\n $ERROR('#6: NaN % Number.MAX_VALUE === Not-a-Number. Actual: ' + (NaN % Number.MAX_VALUE));\n} \n\n//CHECK#7\nif (isNaN(Number.NaN % Number.MIN_VALUE) !== true) {\n $ERROR('#7: NaN % Number.MIN_VALUE === Not-a-Number. Actual: ' + (NaN % Number.MIN_VALUE)); \n}\n\n//CHECK#8\nif (isNaN(Number.NaN % 1) !== true) {\n $ERROR('#8: NaN % 1 === Not-a-Number. Actual: ' + (NaN % 1)); \n}\n",
"id": "S11.5.3_A4_T1.1"
},
{
"section": "11.5.3",
"description": "If either operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN % Number.NaN) !== true) {\n $ERROR('#1: NaN % NaN === Not-a-Number. Actual: ' + (NaN % NaN));\n} \n\n//CHECK#2\nif (isNaN(+0 % Number.NaN) !== true) {\n $ERROR('#2: +0 % NaN === Not-a-Number. Actual: ' + (+0 % NaN)); \n} \n\n//CHECK#3\nif (isNaN(-0 % Number.NaN) !== true) {\n $ERROR('#3: -0 % NaN === Not-a-Number. Actual: ' + (-0 % NaN)); \n} \n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY % Number.NaN) !== true) {\n $ERROR('#4: Infinity % NaN === Not-a-Number. Actual: ' + (Infinity % NaN));\n} \n\n//CHECK#5\nif (isNaN(Number.NEGATIVE_INFINITY % Number.NaN) !== true) {\n $ERROR('#5: -Infinity % NaN === Not-a-Number. Actual: ' + ( -Infinity % NaN)); \n} \n\n//CHECK#6\nif (isNaN(Number.MAX_VALUE % Number.NaN) !== true) {\n $ERROR('#6: Number.MAX_VALUE % NaN === Not-a-Number. Actual: ' + (Number.MAX_VALUE % NaN));\n} \n\n//CHECK#7\nif (isNaN(Number.MIN_VALUE % Number.NaN) !== true) {\n $ERROR('#7: Number.MIN_VALUE % NaN === Not-a-Number. Actual: ' + (Number.MIN_VALUE % NaN)); \n}\n\n//CHECK#8\nif (isNaN(1 % Number.NaN) !== true) {\n $ERROR('#8: 1 % NaN === Not-a-Number. Actual: ' + (1 % NaN)); \n}\n",
"id": "S11.5.3_A4_T1.2"
},
{
"section": "11.5.3",
"description": "The sign of the finite non-zero value result equals the sign of the divided",
"test": "//CHECK#1\nif (1 % 1 !== 0) {\n $ERROR('#1.1: 1 % 1 === 0. Actual: ' + (1 % 1));\n} else {\n if (1 / (1 % 1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#1.2: 1 % 1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#2\nif (-1 % -1 !== -0) {\n $ERROR('#2.1: -1 % -1 === 0. Actual: ' + (-1 % -1));\n} else {\n if (1 / (-1 % -1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2.2: -1 % -1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#3\nif (-1 % 1 !== -0) {\n $ERROR('#3.1: -1 % 1 === 0. Actual: ' + (-1 % 1));\n} else {\n if (1 / (-1 % 1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3.2: -1 % 1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#4\nif (1 % -1 !== 0) {\n $ERROR('#4.1: 1 % -1 === 0. Actual: ' + (1 % -1));\n} else {\n if (1 / (1 % -1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#4.2: 1 % -1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#5\nif (101 % 51 !== 50) {\n $ERROR('#5: 101 % 51 === 50. Actual: ' + (101 % 51));\n}\n\n//CHECK#6\nif (101 % -51 !== 50) {\n $ERROR('#6: 101 % -51 === 50. Actual: ' + (101 % -51));\n}\n\n//CHECK#7\nif (-101 % 51 !== -50) {\n $ERROR('#7: -101 % 51 === -50. Actual: ' + (-101 % 51));\n}\n\n//CHECK#8\nif (-101 % -51 !== -50) {\n $ERROR('#8: -101 % -51 === -50. Actual: ' + (-101 % -51));\n}\n",
"id": "S11.5.3_A4_T2"
},
{
"section": "11.5.3",
"description": "If the dividend is an infinity results is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#1: -Infinity % Infinity === Not-a-Number. Actual: ' + (-Infinity % Infinity));\n}\n\n//CHECK#2\nif (isNaN(Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#2: -Infinity % -Infinity === Not-a-Number. Actual: ' + (-Infinity % -Infinity));\n}\n\n//CHECK#3\nif (isNaN(Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#3: Infinity % Infinity === Not-a-Number. Actual: ' + (Infinity % Infinity));\n}\n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: Infinity % -Infinity === Not-a-Number. Actual: ' + (Infinity % -Infinity));\n}\n\n//CHECK#5\nif (isNaN(Number.NEGATIVE_INFINITY % 1) !== true) {\n $ERROR('#5: Infinity % 1 === Not-a-Number. Actual: ' + (Infinity % 1));\n}\n\n//CHECK#6\nif (isNaN(Number.NEGATIVE_INFINITY % -1) !== true) {\n $ERROR('#6: -Infinity % -1 === Not-a-Number. Actual: ' + (-Infinity % -1));\n}\n\n//CHECK#7\nif (isNaN(Number.POSITIVE_INFINITY % 1) !== true) {\n $ERROR('#7: Infinity % 1 === Not-a-Number. Actual: ' + (Infinity % 1));\n}\n\n//CHECK#8\nif (isNaN(Number.POSITIVE_INFINITY % -1) !== true) {\n $ERROR('#8: Infinity % -1 === Not-a-Number. Actual: ' + (Infinity % -1));\n}\n\n//CHECK#9\nif (isNaN(Number.NEGATIVE_INFINITY % Number.MAX_VALUE) !== true) {\n $ERROR('#9: Infinity % Number.MAX_VALUE === Not-a-Number. Actual: ' + (Infinity % Number.MAX_VALUE));\n}\n\n//CHECK#10\nif (isNaN(Number.NEGATIVE_INFINITY % -Number.MAX_VALUE) !== true) {\n $ERROR('#10: -Infinity % -Number.MAX_VALUE === Not-a-Number. Actual: ' + (-Infinity % -Number.MAX_VALUE));\n}\n\n//CHECK#11\nif (isNaN(Number.POSITIVE_INFINITY % Number.MAX_VALUE) !== true) {\n $ERROR('#11: Infinity % Number.MAX_VALUE === Not-a-Number. Actual: ' + (Infinity % Number.MAX_VALUE));\n}\n\n//CHECK#12\nif (isNaN(Number.POSITIVE_INFINITY % -Number.MAX_VALUE) !== true) {\n $ERROR('#12: Infinity % -Number.MAX_VALUE === Not-a-Number. Actual: ' + (Infinity % -Number.MAX_VALUE));\n}\n",
"id": "S11.5.3_A4_T3"
},
{
"section": "11.5.3",
"description": "If the divisor is zero results is NaN",
"test": "//CHECK#1\nif (isNaN(-0 % 0) !== true) {\n $ERROR('#1: -0 % 0 === Not-a-Number. Actual: ' + (-0 % 0));\n}\n\n//CHECK#2\nif (isNaN(-0 % -0) !== true) {\n $ERROR('#2: -0 % -0 === Not-a-Number. Actual: ' + (-0 % -0));\n}\n\n//CHECK#3\nif (isNaN(0 % 0) !== true) {\n $ERROR('#3: 0 % 0 === Not-a-Number. Actual: ' + (0 % 0));\n}\n\n//CHECK#4\nif (isNaN(0 % -0) !== true) {\n $ERROR('#4: 0 % -0 === Not-a-Number. Actual: ' + (0 % -0));\n}\n\n//CHECK#5\nif (isNaN(-1 % 0) !== true) {\n $ERROR('#5: 1 % 0 === Not-a-Number. Actual: ' + (1 % 0));\n}\n\n//CHECK#6\nif (isNaN(-1 % -0) !== true) {\n $ERROR('#6: -1 % -0 === Not-a-Number. Actual: ' + (-1 % -0));\n}\n\n//CHECK#7\nif (isNaN(1 % 0) !== true) {\n $ERROR('#7: 1 % 0 === Not-a-Number. Actual: ' + (1 % 0));\n}\n\n//CHECK#8\nif (isNaN(1 % -0) !== true) {\n $ERROR('#8: 1 % -0 === Not-a-Number. Actual: ' + (1 % -0));\n}\n\n//CHECK#9\nif (isNaN(Number.NEGATIVE_INFINITY % 0) !== true) {\n $ERROR('#9: Infinity % 0 === Not-a-Number. Actual: ' + (Infinity % 0));\n}\n\n//CHECK#10\nif (isNaN(Number.NEGATIVE_INFINITY % -0) !== true) {\n $ERROR('#10: -Infinity % -0 === Not-a-Number. Actual: ' + (-Infinity % -0));\n}\n\n//CHECK#11\nif (isNaN(Number.POSITIVE_INFINITY % 0) !== true) {\n $ERROR('#11: Infinity % 0 === Not-a-Number. Actual: ' + (Infinity % 0));\n}\n\n//CHECK#12\nif (isNaN(Number.POSITIVE_INFINITY % -0) !== true) {\n $ERROR('#12: Infinity % -0 === Not-a-Number. Actual: ' + (Infinity % -0));\n}\n\n//CHECK#13\nif (isNaN(Number.MIN_VALUE % 0) !== true) {\n $ERROR('#13: Number.MIN_VALUE % 0 === Not-a-Number. Actual: ' + (Number.MIN_VALUE % 0));\n}\n\n//CHECK#14\nif (isNaN(Number.MIN_VALUE % -0) !== true) {\n $ERROR('#14: -Number.MIN_VALUE % -0 === Not-a-Number. Actual: ' + (-Number.MIN_VALUE % -0));\n}\n\n//CHECK#15\nif (isNaN(Number.MAX_VALUE % 0) !== true) {\n $ERROR('#15: Number.MAX_VALUE % 0 === Not-a-Number. Actual: ' + (Number.MAX_VALUE % 0));\n}\n\n//CHECK#16\nif (isNaN(Number.MAX_VALUE % -0) !== true) {\n $ERROR('#16: Number.MAX_VALUE % -0 === Not-a-Number. Actual: ' + (Number.MAX_VALUE % -0));\n}\n",
"id": "S11.5.3_A4_T4"
},
{
"section": "11.5.3",
"description": "If dividend is finite and the divisor is an infinity, the result equals the dividend",
"test": "//CHECK#1\nif (1 % Number.NEGATIVE_INFINITY !== 1) {\n $ERROR('#1: 1 % -Infinity === 1. Actual: ' + (1 % -Infinity));\n}\n//CHECK#2\nif (1 % Number.POSITIVE_INFINITY !==1) {\n $ERROR('#2: 1 % Infinity === 1. Actual: ' + (1 % Infinity));\n}\n\n//CHECK#3\nif (-1 % Number.POSITIVE_INFINITY !== -1) {\n $ERROR('#3: -1 % Infinity === -1. Actual: ' + (-1 % Infinity));\n}\n\n//CHECK#4\nif (-1 % Number.NEGATIVE_INFINITY !== -1) {\n $ERROR('#4: -1 % -Infinity === -1. Actual: ' + (-1 % -Infinity));\n}\n\n//CHECK#5\nif (0 % Number.POSITIVE_INFINITY !== 0) {\n $ERROR('#5.1: 0 % Infinity === 0. Actual: ' + (0 % Infinity));\n} else {\n if (1 / (0 % Number.POSITIVE_INFINITY) !== Number.POSITIVE_INFINITY) {\n $ERROR('#5.2: 0 % Infinity === + 0. Actual: -0');\n }\n}\n\n//CHECK#6\nif (0 % Number.NEGATIVE_INFINITY !== 0) {\n $ERROR('#6.1: 0 % -Infinity === 0. Actual: ' + (0 % -Infinity));\n} else {\n if (1 / (0 % Number.NEGATIVE_INFINITY) !== Number.POSITIVE_INFINITY) {\n $ERROR('#6.2: 0 % -Infinity === + 0. Actual: -0');\n }\n}\n\n//CHECK#7\nif (-0 % Number.POSITIVE_INFINITY !== -0) {\n $ERROR('#7.1: -0 % Infinity === 0. Actual: ' + (-0 % Infinity));\n} else {\n if (1 / (-0 % Number.POSITIVE_INFINITY) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#7.2: -0 % Infinity === - 0. Actual: +0');\n }\n}\n\n//CHECK#8\nif (-0 % Number.NEGATIVE_INFINITY !== -0) {\n $ERROR('#8.1: -0 % -Infinity === 0. Actual: ' + (-0 % -Infinity));\n} else {\n if (1 / (-0 % Number.NEGATIVE_INFINITY) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#8.2: -0 % -Infinity === - 0. Actual: +0');\n }\n}\n\n//CHECK#9\nif (Number.MAX_VALUE % Number.NEGATIVE_INFINITY !== Number.MAX_VALUE) {\n $ERROR('#9: Number.MAX_VALUE % -Infinity === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE % -Infinity));\n}\n\n//CHECK#10\nif (Number.MAX_VALUE % Number.POSITIVE_INFINITY !== Number.MAX_VALUE) {\n $ERROR('#10: Number.MAX_VALUE % Infinity === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE % Infinity));\n}\n\n//CHECK#11\nif (-Number.MAX_VALUE % Number.POSITIVE_INFINITY !== -Number.MAX_VALUE) {\n $ERROR('#11: -Number.MAX_VALUE % Infinity === -Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE % Infinity));\n}\n\n//CHECK#12\nif (-Number.MAX_VALUE % Number.NEGATIVE_INFINITY !== -Number.MAX_VALUE) {\n $ERROR('#12: -Number.MAX_VALUE % -Infinity === -Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE % -Infinity));\n}\n\n//CHECK#13\nif (Number.MIN_VALUE % Number.NEGATIVE_INFINITY !== Number.MIN_VALUE) {\n $ERROR('#13: Number.MIN_VALUE % -Infinity === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE % -Infinity));\n}\n//CHECK#14\nif (Number.MIN_VALUE % Number.POSITIVE_INFINITY !== Number.MIN_VALUE) {\n $ERROR('#14: Number.MIN_VALUE % Infinity === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE % Infinity));\n}\n\n//CHECK#15\nif (-Number.MIN_VALUE % Number.POSITIVE_INFINITY !== -Number.MIN_VALUE) {\n $ERROR('#15: -Number.MIN_VALUE % Infinity === -Number.MIN_VALUE. Actual: ' + (-Number.MIN_VALUE % Infinity));\n}\n\n//CHECK#16\nif (-Number.MIN_VALUE % Number.NEGATIVE_INFINITY !== -Number.MIN_VALUE) {\n $ERROR('#16: -Number.MIN_VALUE % -Infinity === -Number.MIN_VALUE. Actual: ' + (-Number.MIN_VALUE % -Infinity));\n}\n",
"id": "S11.5.3_A4_T5"
},
{
"section": "11.5.3",
"description": "If dividend is a zero and the divisor is nonzero finite, the result equals the dividend",
"test": "//CHECK#1\nif (0 % 1 !== 0) {\n $ERROR('#1.1: 0 % 1 === 0. Actual: ' + (0 % 1));\n} else {\n if (1 / (0 % 1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#1.2: 0 % 1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#2\nif (0 % -1 !== 0) {\n $ERROR('#2.1: 0 % -1 === 0. Actual: ' + (0 % -1));\n} else {\n if (1 / (0 % -1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: 0 % -1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (-0 % 1 !== -0) {\n $ERROR('#3.1: -0 % 1 === 0. Actual: ' + (-0 % 1));\n} else {\n if (1 / (-0 % 1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3.2: -0 % 1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#4\nif (-0 % -1 !== -0) {\n $ERROR('#4.1: -0 % -1 === 0. Actual: ' + (-0 % -1));\n} else {\n if (1 / (-0 % -1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4.2: 0 % -1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#5\nif (0 % Number.MAX_VALUE !== 0) {\n $ERROR('#5.1: 0 % Number.MAX_VALUE === 0. Actual: ' + (0 % Number.MAX_VALUE));\n} else {\n if (1 / (0 % Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#5.2: 0 % Number.MAX_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#6\nif (0 % Number.MIN_VALUE !== 0) {\n $ERROR('#6.1: 0 % Number.MIN_VALUE === 0. Actual: ' + (0 % Number.MIN_VALUE));\n} else {\n if (1 / (0 % Number.MIN_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#6.2: 0 % Number.MIN_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#7\nif (-0 % Number.MAX_VALUE !== -0) {\n $ERROR('#7.1: -0 % Number.MAX_VALUE === 0. Actual: ' + (-0 % Number.MAX_VALUE));\n} else {\n if (1 / (-0 % Number.MAX_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#7.2: -0 % Number.MAX_VALUE === - 0. Actual: +0');\n }\n}\n\n//CHECK#8\nif (-0 % Number.MIN_VALUE !== -0) {\n $ERROR('#8.1: -0 % Number.MIN_VALUE === 0. Actual: ' + (-0 % Number.MIN_VALUE));\n} else {\n if (1 / (-0 % Number.MIN_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#8.2: 0 % Number.MIN_VALUE === - 0. Actual: +0');\n }\n}\n",
"id": "S11.5.3_A4_T6"
},
{
"section": "11.5.3, 15.8.2.9",
"description": "If operands neither an infinity, nor a zero, nor NaN, return x - truncate(x / y) * y",
"test": "function truncate(x) {\n if (x > 0) {\n return Math.floor(x);\n } else {\n return Math.ceil(x);\n }\n}\n\n//CHECK#1\nx = 1.3; \ny = 1.1;\nif (x % y !== 0.19999999999999996) {\n $ERROR('#1: x = 1.3; y = 1.1; x % y === 0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#2\nx = -1.3; \ny = 1.1; \nif (x % y !== -0.19999999999999996) {\n $ERROR('#2: x = -1.3; y = 1.1; x % y === -0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#3\nx = 1.3; \ny = -1.1;\nif (x % y !== 0.19999999999999996) {\n $ERROR('#3: x = 1.3; y = -1.1; x % y === 0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#4\nx = -1.3; \ny = -1.1;\nif (x % y !== -0.19999999999999996) {\n $ERROR('#4: x = -1.3; y = -1.1; x % y === -0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#5\nx = 1.3; \ny = 1.1;\nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#5: x = 1.3; y = 1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n\n//CHECK#6\nx = -1.3; \ny = 1.1; \nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#6: x = -1.3; y = 1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n\n//CHECK#7\nx = 1.3; \ny = -1.1;\nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#7: x = 1.3; y = -1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n\n//CHECK#8\nx = -1.3; \ny = -1.1;\nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#8: x = -1.3; y = -1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n",
"id": "S11.5.3_A4_T7"
}
]
}
}

View File

@ -0,0 +1,212 @@
{
"testCollection": {
"name": "11.6.1_The_Addition_operator",
"numTests": 34,
"tests": [
{
"section": "11.6.1, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009+\\u00091\") !== 2) {\n $ERROR('#1: 1\\\\u0009+\\\\u00091 === 2');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B+\\u000B1\") !== 2) {\n $ERROR('#2: 1\\\\u000B+\\\\u000B1 === 2'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C+\\u000C1\") !== 2) {\n $ERROR('#3: 1\\\\u000C+\\\\u000C1 === 2');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020+\\u00201\") !== 2) {\n $ERROR('#4: 1\\\\u0020+\\\\u00201 === 2');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0+\\u00A01\") !== 2) {\n $ERROR('#5: 1\\\\u00A0+\\\\u00A01 === 2');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A+\\u000A1\") !== 2) {\n $ERROR('#6: 1\\\\u000A+\\\\u000A1 === 2'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D+\\u000D1\") !== 2) {\n $ERROR('#7: 1\\\\u000D+\\\\u000D1 === 2');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028+\\u20281\") !== 2) {\n $ERROR('#8: 1\\\\u2028+\\\\u20281 === 2');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029+\\u20291\") !== 2) {\n $ERROR('#9: 1\\\\u2029+\\\\u20291 === 2');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029+\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== 2) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029+\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === 2');\n}\n",
"id": "S11.6.1_A1"
},
{
"section": "11.6.1",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 + 1 !== 2) {\n $ERROR('#1: 1 + 1 === 2. Actual: ' + (1 + 1));\n}\n\n//CHECK#2\nvar x = 1;\nif (x + 1 !== 2) {\n $ERROR('#2: var x = 1; x + 1 === 2. Actual: ' + (x + 1));\n}\n\n//CHECK#3\nvar y = 1;\nif (1 + y !== 2) {\n $ERROR('#3: var y = 1; 1 + y === 2. Actual: ' + (1 + y));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (x + y !== 2) {\n $ERROR('#4: var x = 1; var y = 1; x + y === 2. Actual: ' + (x + y));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (objectx.prop + objecty.prop !== 2) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop + objecty.prop === 2. Actual: ' + (objectx.prop + objecty.prop));\n}\n",
"id": "S11.6.1_A2.1_T1"
},
{
"section": "11.6.1",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x + 1;\n $ERROR('#1.1: x + 1 throw ReferenceError. Actual: ' + (x + 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x + 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.6.1_A2.1_T2"
},
{
"section": "11.6.1",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 + y;\n $ERROR('#1.1: 1 + y throw ReferenceError. Actual: ' + (1 + y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 + y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.6.1_A2.1_T3"
},
{
"section": "11.6.1, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 1}} + 1 !== 2) {\n $ERROR('#1: {valueOf: function() {return 1}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}} + 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 1}, toString: function() {return 0}} + 1 !== 2) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} + 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 1}, toString: function() {return {}}} + 1 !== 2) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} + 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} + 1 !== 2) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} + 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} + 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} + 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 + {toString: function() {return 1}} !== 2) {\n $ERROR('#5: 1 + {toString: function() {return 1}} === 2. Actual: ' + (1 + {toString: function() {return 1}}));\n}\n\n//CHECK#6\nif (1 + {valueOf: function() {return {}}, toString: function() {return 1}} !== 2) {\n $ERROR('#6: 1 + {valueOf: function() {return {}}, toString: function() {return 1}} === 2. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return 1}}));\n}\n\n//CHECK#7\ntry {\n 1 + {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n $ERROR('#7.1: 1 + {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (1 + {valueOf: function() {throw \"error\"}, toString: function() {return 1}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 + {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 + {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.6.1_A2.2_T1"
},
{
"section": "11.6.1, 8.6.2.6",
"description": "If Type(value) is Date object, evaluate ToPrimitive(value, String)",
"test": "//CHECK#1\nvar date = new Date();\nif (date + date !== date.toString() + date.toString()) {\n $ERROR('#1: var date = new Date(); date + date === date.toString() + date.toString(). Actual: ' + (date + date)); \n}\n\n//CHECK#2\nvar date = new Date();\nif (date + 0 !== date.toString() + \"0\") {\n $ERROR('#2: var date = new Date(); date + 0 === date.toString() + \"0\". Actual: ' + (date + 0)); \n}\n\n//CHECK#3\nvar date = new Date();\nif (date + true !== date.toString() + \"true\") {\n $ERROR('#3: var date = new Date(); date + true === date.toString() + \"true\". Actual: ' + (date + true)); \n}\n\n//CHECK#4\nvar date = new Date();\nif (date + new Object() !== date.toString() + \"[object Object]\") {\n $ERROR('#4: var date = new Date(); date + new Object() === date.toString() + \"[object Object]\". Actual: ' + (date + new Object())); \n}\n\n",
"id": "S11.6.1_A2.2_T2"
},
{
"section": "11.6.1, 8.6.2.6",
"description": "If Type(value) is Function, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nfunction f1(){\n return 0;\n}\nif (f1 + 1 !== f1.toString() + 1) {\n $ERROR('#1: function f1() {return 0;}; f1 + 1 === f1.toString() + 1');\n}\n\n//CHECK#2\nfunction f2(){\n return 0;\n}\nf2.valueOf = function() {return 1;};\nif (1 + f2 !== 1 + 1) {\n $ERROR('#2: f1unction f2() {return 0;} f2.valueOf = function() {return 1;}; 1 + f2 === 1 + 1. Actual: ' + (1 + f2));\n}\n\n//CHECK#3\nfunction f3(){\n return 0;\n}\nf3.toString = function() {return 1;};\nif (1 + f3 !== 1 + 1) {\n $ERROR('#3: f1unction f3() {return 0;} f3.toString() = function() {return 1;}; 1 + f3 === 1 + 1. Actual: ' + (1 + f3));\n}\n\n//CHECK#4\nfunction f4(){\n return 0;\n}\nf4.valueOf = function() {return -1;};\nf4.toString = function() {return 1;};\nif (f4 + 1 !== 1 - 1) {\n $ERROR('#4: f1unction f4() {return 0;}; f2.valueOf = function() {return -1;}; f4.toString() = function() {return 1;}; f4 + 1 === 1 - 1. Actual: ' + (f4 + 1));\n}\n",
"id": "S11.6.1_A2.2_T3"
},
{
"section": "11.6.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x + y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x + y throw \"x\". Actual: ' + (x + y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x + y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.6.1_A2.3_T1"
},
{
"section": "11.6.1",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) + x !== 2) {\n $ERROR('#1: var x = 0; (x = 1) + x === 2. Actual: ' + ((x = 1) + x));\n}\n\n//CHECK#2\nvar x = 0; \nif (x + (x = 1) !== 1) {\n $ERROR('#2: var x = 0; x + (x = 1) === 1. Actual: ' + (x + (x = 1)));\n}\n\n",
"id": "S11.6.1_A2.4_T1"
},
{
"section": "11.6.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() + y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() + y() throw \"x\". Actual: ' + (x() + y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() + y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.6.1_A2.4_T2"
},
{
"section": "11.6.1",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x + (x = 1);\n $ERROR('#1.1: x + (x = 1) throw ReferenceError. Actual: ' + (x + (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x + (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) + y !== 2) {\n $ERROR('#2: (y = 1) + y === 2. Actual: ' + ((y = 1) + y));\n}\n\n",
"id": "S11.6.1_A2.4_T3"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true + true !== 2) {\n $ERROR('#1: true + true === 2. Actual: ' + (true + true));\n}\n\n//CHECK#2\nif (new Boolean(true) + true !== 2) {\n $ERROR('#2: new Boolean(true) + true === 2. Actual: ' + (new Boolean(true) + true));\n}\n\n//CHECK#3\nif (true + new Boolean(true) !== 2) {\n $ERROR('#3: true + new Boolean(true) === 2. Actual: ' + (true + new Boolean(true)));\n}\n\n//CHECK#4\nif (new Boolean(true) + new Boolean(true) !== 2) {\n $ERROR('#4: new Boolean(true) + new Boolean(true) === 2. Actual: ' + (new Boolean(true) + new Boolean(true)));\n}\n",
"id": "S11.6.1_A3.1_T1.1"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 + 1 !== 2) {\n $ERROR('#1: 1 + 1 === 2. Actual: ' + (1 + 1));\n}\n\n//CHECK#2\nif (new Number(1) + 1 !== 2) {\n $ERROR('#2: new Number(1) + 1 === 2. Actual: ' + (new Number(1) + 1));\n}\n\n//CHECK#3\nif (1 + new Number(1) !== 2) {\n $ERROR('#3: 1 + new Number(1) === 2. Actual: ' + (1 + new Number(1)));\n}\n\n//CHECK#4\nif (new Number(1) + new Number(1) !== 2) {\n $ERROR('#4: new Number(1) + new Number(1) === 2. Actual: ' + (new Number(1) + new Number(1)));\n}\n\n",
"id": "S11.6.1_A3.1_T1.2"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined",
"test": "//CHECK#1\nif (isNaN(null + undefined) !== true) {\n $ERROR('#1: null + undefined === Not-a-Number. Actual: ' + (null + undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined + null) !== true) {\n $ERROR('#2: undefined + null === Not-a-Number. Actual: ' + (undefined + null));\n}\n\n//CHECK#3\nif (isNaN(undefined + undefined) !== true) {\n $ERROR('#3: undefined + undefined === Not-a-Number. Actual: ' + (undefined + undefined));\n}\n\n//CHECK#4\nif (null + null !== 0) {\n $ERROR('#4: null + null === 0. Actual: ' + (null + null));\n}\n",
"id": "S11.6.1_A3.1_T1.3"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) or Boolean (primitive and object)",
"test": "//CHECK#1\nif (true + 1 !== 2) {\n $ERROR('#1: true + 1 === 2. Actual: ' + (true + 1));\n}\n\n//CHECK#2\nif (1 + true !== 2) {\n $ERROR('#2: 1 + true === 2. Actual: ' + (1 + true));\n}\n\n//CHECK#3\nif (new Boolean(true) + 1 !== 2) {\n $ERROR('#3: new Boolean(true) + 1 === 2. Actual: ' + (new Boolean(true) + 1));\n}\n\n//CHECK#4\nif (1 + new Boolean(true) !== 2) {\n $ERROR('#4: 1 + new Boolean(true) === 2. Actual: ' + (1 + new Boolean(true)));\n}\n\n//CHECK#5\nif (true + new Number(1) !== 2) {\n $ERROR('#5: true + new Number(1) === 2. Actual: ' + (true + new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) + true !== 2) {\n $ERROR('#6: new Number(1) + true === 2. Actual: ' + (new Number(1) + true));\n}\n\n//CHECK#7\nif (new Boolean(true) + new Number(1) !== 2) {\n $ERROR('#7: new Boolean(true) + new Number(1) === 2. Actual: ' + (new Boolean(true) + new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) + new Boolean(true) !== 2) {\n $ERROR('#8: new Number(1) + new Boolean(true) === 2. Actual: ' + (new Number(1) + new Boolean(true)));\n}\n",
"id": "S11.6.1_A3.1_T2.1"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 + null !== 1) {\n $ERROR('#1: 1 + null === 1. Actual: ' + (1 + null));\n}\n\n//CHECK#2\nif (null + 1 !== 1) {\n $ERROR('#2: null + 1 === 1. Actual: ' + (null + 1));\n}\n\n//CHECK#3\nif (new Number(1) + null !== 1) {\n $ERROR('#3: new Number(1) + null === 1. Actual: ' + (new Number(1) + null));\n}\n\n//CHECK#4\nif (null + new Number(1) !== 1) {\n $ERROR('#4: null + new Number(1) === 1. Actual: ' + (null + new Number(1)));\n}\n",
"id": "S11.6.1_A3.1_T2.2"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(1 + undefined) !== true) {\n $ERROR('#1: 1 + undefined === Not-a-Number. Actual: ' + (1 + undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined + 1) !== true) {\n $ERROR('#2: undefined + 1 === Not-a-Number. Actual: ' + (undefined + 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) + undefined) !== true) {\n $ERROR('#3: new Number(1) + undefined === Not-a-Number. Actual: ' + (new Number(1) + undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined + new Number(1)) !== true) {\n $ERROR('#4: undefined + new Number(1) === Not-a-Number. Actual: ' + (undefined + new Number(1)));\n}\n",
"id": "S11.6.1_A3.1_T2.3"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(true + undefined) !== true) {\n $ERROR('#1: true + undefined === Not-a-Number. Actual: ' + (true + undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined + true) !== true) {\n $ERROR('#2: undefined + true === Not-a-Number. Actual: ' + (undefined + true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) + undefined) !== true) {\n $ERROR('#3: new Boolean(true) + undefined === Not-a-Number. Actual: ' + (new Boolean(true) + undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined + new Boolean(true)) !== true) {\n $ERROR('#4: undefined + new Boolean(true) === Not-a-Number. Actual: ' + (undefined + new Boolean(true)));\n}\n",
"id": "S11.6.1_A3.1_T2.4"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true + null !== 1) {\n $ERROR('#1: true + null === 1. Actual: ' + (true + null));\n}\n\n//CHECK#2\nif (null + true !== 1) {\n $ERROR('#2: null + true === 1. Actual: ' + (null + true));\n}\n\n//CHECK#3\nif (new Boolean(true) + null !== 1) {\n $ERROR('#3: new Boolean(true) + null === 1. Actual: ' + (new Boolean(true) + null));\n}\n\n//CHECK#4\nif (null + new Boolean(true) !== 1) {\n $ERROR('#4: null + new Boolean(true) === 1. Actual: ' + (null + new Boolean(true)));\n}\n",
"id": "S11.6.1_A3.1_T2.5"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" + \"1\" !== \"11\") {\n $ERROR('#1: \"1\" + \"1\" === \"11\". Actual: ' + (\"1\" + \"1\"));\n}\n\n//CHECK#2\nif (new String(\"1\") + \"1\" !== \"11\") {\n $ERROR('#2: new String(\"1\") + \"1\" === \"11\". Actual: ' + (new String(\"1\") + \"1\"));\n}\n\n//CHECK#3\nif (\"1\" + new String(\"1\") !== \"11\") {\n $ERROR('#3: \"1\" + new String(\"1\") === \"11\". Actual: ' + (\"1\" + new String(\"1\")));\n}\n\n//CHECK#4\nif (new String(\"1\") + new String(\"1\") !== \"11\") {\n $ERROR('#4: new String(\"1\") + new String(\"1\") === \"11\". Actual: ' + (new String(\"1\") + new String(\"1\")));\n}\n\n//CHECK#5\nif (\"x\" + \"1\" !==\"x1\") {\n $ERROR('#5: \"x\" + \"1\" === \"x1\". Actual: ' + (\"x\" + \"1\"));\n}\n\n//CHECK#6\nif (\"1\" + \"x\" !== \"1x\") {\n $ERROR('#6: \"1\" + \"x\" === \"1x\". Actual: ' + (\"1\" + \"x\"));\n}\n",
"id": "S11.6.1_A3.2_T1.1"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object",
"test": "//CHECK#1\nif (({} + function(){return 1}) !== ({}.toString() + function(){return 1}.toString())) {\n $ERROR('#1: ({} + function(){return 1}) === ({}.toString() + function(){return 1}.toString()). Actual: ' + (({} + function(){return 1})));\n}\n\n//CHECK#2\nif ((function(){return 1} + {}) !== (function(){return 1}.toString() + {}.toString())) {\n $ERROR('#2: (function(){return 1} + {}) === (function(){return 1}.toString() + {}.toString()). Actual: ' + ((function(){return 1} + {})));\n}\n\n//CHECK#3\nif ((function(){return 1} + function(){return 1}) !== (function(){return 1}.toString() + function(){return 1}.toString())) {\n $ERROR('#3: (function(){return 1} + function(){return 1}) === (function(){return 1}.toString() + function(){return 1}.toString()). Actual: ' + ((function(){return 1} + function(){return 1})));\n}\n\n//CHECK#4\nif (({} + {}) !== ({}.toString() + {}.toString())) {\n $ERROR('#4: ({} + {}) === ({}.toString() + {}.toString()). Actual: ' + (({} + {})));\n}\n\n\n",
"id": "S11.6.1_A3.2_T1.2"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" + 1 !== \"11\") {\n $ERROR('#1: \"1\" + 1 === \"11\". Actual: ' + (\"1\" + 1));\n}\n\n//CHECK#2\nif (1 + \"1\" !== \"11\") {\n $ERROR('#2: 1 + \"1\" === \"11\". Actual: ' + (1 + \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") + 1 !== \"11\") {\n $ERROR('#3: new String(\"1\") + 1 === \"11\". Actual: ' + (new String(\"1\") + 1));\n}\n\n//CHECK#4\nif (1 + new String(\"1\") !== \"11\") {\n $ERROR('#4: 1 + new String(\"1\") === \"11\". Actual: ' + (1 + new String(\"1\")));\n}\n\n//CHECK#5\nif (\"1\" + new Number(1) !== \"11\") {\n $ERROR('#5: \"1\" + new Number(1) === \"11\". Actual: ' + (\"1\" + new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) + \"1\" !== \"11\") {\n $ERROR('#6: new Number(1) + \"1\" === \"11\". Actual: ' + (new Number(1) + \"1\"));\n}\n\n//CHECK#7\nif (new String(\"1\") + new Number(1) !== \"11\") {\n $ERROR('#7: new String(\"1\") + new Number(1) === \"11\". Actual: ' + (new String(\"1\") + new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) + new String(\"1\") !== \"11\") {\n $ERROR('#8: new Number(1) + new String(\"1\") === \"11\". Actual: ' + (new Number(1) + new String(\"1\")));\n}\n\n//CHECK#9\nif (\"x\" + 1 !==\"x1\") {\n $ERROR('#9: \"x\" + 1 === \"x1\". Actual: ' + (\"x\" + 1));\n}\n\n//CHECK#10\nif (1 + \"x\" !== \"1x\") {\n $ERROR('#10: 1 + \"x\" === \"1x\". Actual: ' + (1 + \"x\"));\n}\n",
"id": "S11.6.1_A3.2_T2.1"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true + \"1\" !== \"true1\") {\n $ERROR('#1: true + \"1\" === \"true1\". Actual: ' + (true + \"1\"));\n}\n\n//CHECK#2\nif (\"1\" + true !== \"1true\") {\n $ERROR('#2: \"1\" + true === \"1true\". Actual: ' + (\"1\" + true));\n}\n\n//CHECK#3\nif (new Boolean(true) + \"1\" !== \"true1\") {\n $ERROR('#3: new Boolean(true) + \"1\" === \"true1\". Actual: ' + (new Boolean(true) + \"1\"));\n}\n\n//CHECK#4\nif (\"1\" + new Boolean(true) !== \"1true\") {\n $ERROR('#4: \"1\" + new Boolean(true) === \"1true\". Actual: ' + (\"1\" + new Boolean(true)));\n}\n\n//CHECK#5\nif (true + new String(\"1\") !== \"true1\") {\n $ERROR('#5: true + new String(\"1\") === \"true1\". Actual: ' + (true + new String(\"1\")));\n}\n\n//CHECK#6\nif (new String(\"1\") + true !== \"1true\") {\n $ERROR('#6: new String(\"1\") + true === \"1true\". Actual: ' + (new String(\"1\") + true));\n}\n\n//CHECK#7\nif (new Boolean(true) + new String(\"1\") !== \"true1\") {\n $ERROR('#7: new Boolean(true) + new String(\"1\") === \"true1\". Actual: ' + (new Boolean(true) + new String(\"1\")));\n}\n\n//CHECK#8\nif (new String(\"1\") + new Boolean(true) !== \"1true\") {\n $ERROR('#8: new String(\"1\") + new Boolean(true) === \"1true\". Actual: ' + (new String(\"1\") + new Boolean(true)));\n}\n",
"id": "S11.6.1_A3.2_T2.2"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (\"1\" + undefined !== \"1undefined\") {\n $ERROR('#1: \"1\" + undefined === \"1undefined\". Actual: ' + (\"1\" + undefined));\n}\n\n//CHECK#2\nif (undefined + \"1\" !== \"undefined1\") {\n $ERROR('#2: undefined + \"1\" === \"undefined1\". Actual: ' + (undefined + \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") + undefined !== \"1undefined\") {\n $ERROR('#3: new String(\"1\") + undefined === \"1undefined\". Actual: ' + (new String(\"1\") + undefined));\n}\n\n//CHECK#4\nif (undefined + new String(\"1\") !== \"undefined1\") {\n $ERROR('#4: undefined + new String(\"1\") === \"undefined1\". Actual: ' + (undefined + new String(\"1\")));\n}\n",
"id": "S11.6.1_A3.2_T2.3"
},
{
"section": "11.6.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" + null !== \"1null\") {\n $ERROR('#1: \"1\" + null === \"1null\". Actual: ' + (\"1\" + null));\n}\n\n//CHECK#2\nif (null + \"1\" !== \"null1\") {\n $ERROR('#2: null + \"1\" === \"null1\". Actual: ' + (null + \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") + null !== \"1null\") {\n $ERROR('#3: new String(\"1\") + null === \"1null\". Actual: ' + (new String(\"1\") + null));\n}\n\n//CHECK#4\nif (null + new String(\"1\") !== \"null1\") {\n $ERROR('#4: null + new String(\"1\") === \"null1\". Actual: ' + (null + new String(\"1\")));\n}\n",
"id": "S11.6.1_A3.2_T2.4"
},
{
"section": "11.6.1, 11.6.3",
"description": "If either operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN + 1) !== true ) {\n $ERROR('#1: NaN + 1 === Not-a-Number. Actual: ' + (NaN + 1));\n}\n\n//CHECK#2\nif (isNaN(1 + Number.NaN) !== true ) {\n $ERROR('#2: 1 + NaN === Not-a-Number. Actual: ' + (1 + NaN));\n}\n\n//CHECK#3\nif (isNaN(Number.NaN + Number.POSITIVE_INFINITY) !== true ) {\n $ERROR('#3: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));\n}\n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY + Number.NaN) !== true ) {\n $ERROR('#4: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));\n}\n\n//CHECK#5\nif (isNaN(Number.NaN + Number.NEGATIVE_INFINITY) !== true ) {\n $ERROR('#5: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));\n}\n\n//CHECK#6\nif (isNaN(Number.NEGATIVE_INFINITY + Number.NaN) !== true ) {\n $ERROR('#6: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));\n}\n\n",
"id": "S11.6.1_A4_T1"
},
{
"section": "11.6.1, 11.6.3",
"description": "The sum of two infinities of opposite sign is NaN",
"test": "//CHECK#1\nif (isNaN(Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY) !== true ) {\n $ERROR('#1: Infinity + -Infinity === Not-a-Number. Actual: ' + (Infinity + -Infinity));\n}\n\n//CHECK#2\nif (isNaN(Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY) !== true ) {\n $ERROR('#2: -Infinity + Infinity === Not-a-Number. Actual: ' + (-Infinity + Infinity));\n}\n\n\n\n",
"id": "S11.6.1_A4_T2"
},
{
"section": "11.6.1, 11.6.3",
"description": "The sum of two infinities of the same sign is the infinity of that sign",
"test": "//CHECK#1\nif (Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ) {\n $ERROR('#1: Infinity + Infinity === Infinity. Actual: ' + (Infinity + Infinity));\n}\n\n//CHECK#2\nif (Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#2: -Infinity + -Infinity === -Infinity. Actual: ' + (-Infinity + -Infinity));\n}\n\n\n\n",
"id": "S11.6.1_A4_T3"
},
{
"section": "11.6.1, 11.6.3",
"description": "The sum of an infinity and a finite value is equal to the infinite operand",
"test": "//CHECK#1\nif (Number.POSITIVE_INFINITY + 1 !== Number.POSITIVE_INFINITY ) {\n $ERROR('#1: Infinity + 1 === Infinity. Actual: ' + (Infinity + 1));\n}\n\n//CHECK#2\nif (-1 + Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ) {\n $ERROR('#2: -1 + Infinity === Infinity. Actual: ' + (-1 + Infinity));\n}\n\n//CHECK#3\nif (Number.NEGATIVE_INFINITY + 1 !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#3: -Infinity + 1 === -Infinity. Actual: ' + (-Infinity + 1));\n}\n\n//CHECK#4\nif (-1 + Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#4: -1 + -Infinity === -Infinity. Actual: ' + (-1 + -Infinity));\n}\n\n//CHECK#5\nif (Number.POSITIVE_INFINITY + Number.MAX_VALUE !== Number.POSITIVE_INFINITY ) {\n $ERROR('#5: Infinity + Number.MAX_VALUE === Infinity. Actual: ' + (Infinity + Number.MAX_VALUE));\n}\n\n//CHECK#6\nif (-Number.MAX_VALUE + Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ) {\n $ERROR('#6: -Number.MAX_VALUE + Infinity === Infinity. Actual: ' + (-Number.MAX_VALUE + Infinity));\n}\n\n//CHECK#7\nif (Number.NEGATIVE_INFINITY + Number.MAX_VALUE !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#7: -Infinity + Number.MAX_VALUE === -Infinity. Actual: ' + (-Infinity + Number.MAX_VALUE));\n}\n\n//CHECK#8\nif (-Number.MAX_VALUE + Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#8: -Number.MAX_VALUE + -Infinity === -Infinity. Actual: ' + (-Number.MAX_VALUE + -Infinity));\n}\n\n\n\n",
"id": "S11.6.1_A4_T4"
},
{
"section": "11.6.1, 11.6.3",
"description": "The sum of two negative zeros is -0. The sum of two positive zeros, or of two zeros of opposite sign is +0",
"test": "//CHECK#1\nif (-0 + -0 !== -0 ) { \n $ERROR('#1.1: -0 + -0 === 0. Actual: ' + (-0 + -0));\n} else {\n if (1 / (-0 + -0) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#1.1: -0 + -0 === - 0. Actual: +0');\n }\n}\n\n//CHECK#2\nif (0 + -0 !== 0 ) { \n $ERROR('#2.1: 0 + -0 === 0. Actual: ' + (0 + -0));\n} else {\n if (1 / (0 + -0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: 0 + -0 === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (-0 + 0 !== 0 ) { \n $ERROR('#3.1: -0 + 0 === 0. Actual: ' + (-0 + 0));\n} else {\n if (1 / (-0 + 0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#3.2: -0 + 0 === + 0. Actual: -0');\n }\n}\n\n//CHECK#4\nif (0 + 0 !== 0 ) { \n $ERROR('#4.1: 0 + 0 === 0. Actual: ' + (0 + 0));\n} else {\n if (1 / (0 + 0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#4.2: 0 + 0 === + 0. Actual: -0');\n }\n}\n",
"id": "S11.6.1_A4_T5"
},
{
"section": "11.6.1, 11.6.3",
"description": "The sum of a zero and a nonzero finite value is equal to the nonzero operand",
"test": "//CHECK#1\nif (1 + -0 !== 1 ) { \n $ERROR('#1: 1 + -0 === 1. Actual: ' + (1 + -0));\n}\n\n//CHECK#2\nif (1 + 0 !== 1 ) { \n $ERROR('#2: 1 + 0 === 1. Actual: ' + (1 + 0));\n} \n\n//CHECK#3\nif (-0 + 1 !== 1 ) { \n $ERROR('#3: -0 + 1 === 1. Actual: ' + (-0 + 1));\n}\n\n//CHECK#4\nif (0 + 1 !== 1 ) { \n $ERROR('#4: 0 + 1 === 1. Actual: ' + (0 + 1));\n} \n\n//CHECK#5\nif (Number.MAX_VALUE + -0 !== Number.MAX_VALUE ) { \n $ERROR('#5: Number.MAX_VALUE + -0 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE + -0));\n}\n\n//CHECK#6\nif (Number.MAX_VALUE + 0 !== Number.MAX_VALUE ) { \n $ERROR('#6: Number.MAX_VALUE + 0 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE + 0));\n} \n\n//CHECK#7\nif (-0 + Number.MIN_VALUE !== Number.MIN_VALUE ) { \n $ERROR('#7: -0 + Number.MIN_VALUE === Number.MIN_VALUE. Actual: ' + (-0 + Number.MIN_VALUE));\n}\n\n//CHECK#8\nif (0 + Number.MIN_VALUE !== Number.MIN_VALUE ) { \n $ERROR('#8: 0 + Number.MIN_VALUE === Number.MIN_VALUE. Actual: ' + (0 + Number.MIN_VALUE));\n} \n",
"id": "S11.6.1_A4_T6"
},
{
"section": "11.6.1, 11.6.3",
"description": "The sum of two nonzero finite values of the same magnitude and opposite sign is +0",
"test": "//CHECK#1\nif (-Number.MIN_VALUE + Number.MIN_VALUE !== +0) { \n $ERROR('#1.1: -Number.MIN_VALUE + Number.MIN_VALUE === 0. Actual: ' + (-Number.MIN_VALUE + Number.MIN_VALUE));\n} else {\n if (1 / (-Number.MIN_VALUE + Number.MIN_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#1.2: -Number.MIN_VALUE + Number.MIN_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#2\nif (-Number.MAX_VALUE + Number.MAX_VALUE !== +0) { \n $ERROR('#2.1: -Number.MAX_VALUE + Number.MAX_VALUE === 0. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE));\n} else {\n if (1 / (-Number.MAX_VALUE + Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: -Number.MAX_VALUE + Number.MAX_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE !== +0) { \n $ERROR('#3.1: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === 0. Actual: ' + (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE));\n} else {\n if (1 / (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#3.2: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === + 0. Actual: -0');\n }\n}\n",
"id": "S11.6.1_A4_T7"
},
{
"section": "11.6.1, 11.6.3",
"description": "If the magnitude is too large to represent, the operation overflows and the result is then an infinity of appropriate sign",
"test": "//CHECK#1\nif (Number.MAX_VALUE + Number.MAX_VALUE !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: Number.MAX_VALUE + Number.MAX_VALUE === Number.POSITIVE_INFINITY. Actual: ' + (Number.MAX_VALUE + Number.MAX_VALUE));\n}\n\n//CHECK#2\nif (-Number.MAX_VALUE - Number.MAX_VALUE !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2: -Number.MAX_VALUE - Number.MAX_VALUE === Number.NEGATIVE_INFINITY. Actual: ' + (-Number.MAX_VALUE - Number.MAX_VALUE));\n}\n\n//CHECK#3\nif (1e+308 + 1e+308 !== Number.POSITIVE_INFINITY) {\n $ERROR('#3: 1e+308 + 1e+308 === Number.POSITIVE_INFINITY. Actual: ' + (1e+308 + 1e+308));\n}\n\n//CHECK#4\nif (-8.99e+307 - 8.99e+307 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4: -8.99e+307 - 8.99e+307 === Number.NEGATIVE_INFINITY. Actual: ' + (-8.99e+307 - 8.99e+307));\n}\n",
"id": "S11.6.1_A4_T8"
},
{
"section": "11.6.1, 11.6.3",
"description": "The addition operator is not always associative ( x + y + z is the same (x + y) + z, not x + (y + z))",
"test": "//CHECK#1\nif (-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE !== (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE) {\n $ERROR('#1: -Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE === (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE));\n} \n\n//CHECK#2\nif ((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE === -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE)) {\n $ERROR('#2: (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE === -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE). Actual: ' + ((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE));\n}\n\n//CHECK#3\nif (\"1\" + 1 + 1 !== (\"1\" + 1) + 1) {\n $ERROR('#3: \"1\" + 1 + 1 === (\"1\" + 1) + 1. Actual: ' + (\"1\" + 1 + 1));\n} \n\n//CHECK#4\nif ((\"1\" + 1) + 1 === \"1\" + (1 + 1)) {\n $ERROR('#4: (\"1\" + 1) + 1 !== \"1\" + (1 + 1)');\n}\n",
"id": "S11.6.1_A4_T9"
}
]
}
}

View File

@ -0,0 +1,194 @@
{
"testCollection": {
"name": "11.6.2_The_Subtraction_operator",
"numTests": 31,
"tests": [
{
"section": "11.6.2, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009-\\u00091\") !== 0) {\n $ERROR('#1: 1\\\\u0009-\\\\u00091 === 0');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B-\\u000B1\") !== 0) {\n $ERROR('#2: 1\\\\u000B-\\\\u000B1 === 0'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C-\\u000C1\") !== 0) {\n $ERROR('#3: 1\\\\u000C-\\\\u000C1 === 0');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020-\\u00201\") !== 0) {\n $ERROR('#4: 1\\\\u0020-\\\\u00201 === 0');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0-\\u00A01\") !== 0) {\n $ERROR('#5: 1\\\\u00A0-\\\\u00A01 === 0');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A-\\u000A1\") !== 0) {\n $ERROR('#6: 1\\\\u000A-\\\\u000A1 === 0'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D-\\u000D1\") !== 0) {\n $ERROR('#7: 1\\\\u000D-\\\\u000D1 === 0');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028-\\u20281\") !== 0) {\n $ERROR('#8: 1\\\\u2028-\\\\u20281 === 0');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029-\\u20291\") !== 0) {\n $ERROR('#9: 1\\\\u2029-\\\\u20291 === 0');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029-\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== 0) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029-\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === 0');\n}\n",
"id": "S11.6.2_A1"
},
{
"section": "11.6.2",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 - 1 !== 0) {\n $ERROR('#1: 1 - 1 === 0. Actual: ' + (1 - 1));\n}\n\n//CHECK#2\nvar x = 1;\nif (x - 1 !== 0) {\n $ERROR('#2: var x = 1; x - 1 === 0. Actual: ' + (x - 1));\n}\n\n//CHECK#3\nvar y = 1;\nif (1 - y !== 0) {\n $ERROR('#3: var y = 1; 1 - y === 0. Actual: ' + (1 - y));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (x - y !== 0) {\n $ERROR('#4: var x = 1; var y = 1; x - y === 0. Actual: ' + (x - y));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (objectx.prop - objecty.prop !== 0) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop - objecty.prop === 0. Actual: ' + (objectx.prop - objecty.prop));\n}\n",
"id": "S11.6.2_A2.1_T1"
},
{
"section": "11.6.2",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x - 1;\n $ERROR('#1.1: x - 1 throw ReferenceError. Actual: ' + (x - 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x - 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.6.2_A2.1_T2"
},
{
"section": "11.6.2",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 - y;\n $ERROR('#1.1: 1 - y throw ReferenceError. Actual: ' + (1 - y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 - y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.6.2_A2.1_T3"
},
{
"section": "11.6.2, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 1}} - 1 !== 0) {\n $ERROR('#1: {valueOf: function() {return 1}} - 1 === 0. Actual: ' + ({valueOf: function() {return 1}} - 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 1}, toString: function() {return 0}} - 1 !== 0) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} - 1 === 0. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} - 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 1}, toString: function() {return {}}} - 1 !== 0) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} - 1 === 0. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} - 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} - 1 !== 0) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} - 1 === 0. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} - 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} - 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} - 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 - {toString: function() {return 1}} !== 0) {\n $ERROR('#5: 1 - {toString: function() {return 1}} === 0. Actual: ' + (1 - {toString: function() {return 1}}));\n}\n\n//CHECK#6\nif (1 - {valueOf: function() {return {}}, toString: function() {return 1}} !== 0) {\n $ERROR('#6: 1 - {valueOf: function() {return {}}, toString: function() {return 1}} === 0. Actual: ' + (1 - {valueOf: function() {return {}}, toString: function() {return 1}}));\n}\n\n//CHECK#7\ntry {\n 1 - {valueOf: function() {throw \"error\"}, toString: function() {return 1}};\n $ERROR('#7.1: 1 - {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (1 - {valueOf: function() {throw \"error\"}, toString: function() {return 1}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 - {valueOf: function() {throw \"error\"}, toString: function() {return 1}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 - {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 - {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 - {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 - {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.6.2_A2.2_T1"
},
{
"section": "11.6.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x - y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x - y throw \"x\". Actual: ' + (x - y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x - y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.6.2_A2.3_T1"
},
{
"section": "11.6.2",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) - x !== 0) {\n $ERROR('#1: var x = 0; (x = 1) - x === 0. Actual: ' + ((x = 1) - x));\n}\n\n//CHECK#2\nvar x = 0; \nif (x - (x = 1) !== -1) {\n $ERROR('#2: var x = 0; x - (x = 1) === -1. Actual: ' + (x - (x = 1)));\n}\n\n",
"id": "S11.6.2_A2.4_T1"
},
{
"section": "11.6.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() - y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() - y() throw \"x\". Actual: ' + (x() - y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() - y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.6.2_A2.4_T2"
},
{
"section": "11.6.2",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x - (x = 1);\n $ERROR('#1.1: x - (x = 1) throw ReferenceError. Actual: ' + (x - (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x - (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) - y !== 0) {\n $ERROR('#2: (y = 1) - y === 0. Actual: ' + ((y = 1) - y));\n}\n\n",
"id": "S11.6.2_A2.4_T3"
},
{
"section": "11.6.2",
"description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true - true !== 0) {\n $ERROR('#1: true - true === 0. Actual: ' + (true - true));\n}\n\n//CHECK#2\nif (new Boolean(true) - true !== 0) {\n $ERROR('#2: new Boolean(true) - true === 0. Actual: ' + (new Boolean(true) - true));\n}\n\n//CHECK#3\nif (true - new Boolean(true) !== 0) {\n $ERROR('#3: true - new Boolean(true) === 0. Actual: ' + (true - new Boolean(true)));\n}\n\n//CHECK#4\nif (new Boolean(true) - new Boolean(true) !== 0) {\n $ERROR('#4: new Boolean(true) - new Boolean(true) === 0. Actual: ' + (new Boolean(true) - new Boolean(true)));\n}\n",
"id": "S11.6.2_A3_T1.1"
},
{
"section": "11.6.2",
"description": "Type(x) and Type(y) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 - 1 !== 0) {\n $ERROR('#1: 1 - 1 === 0. Actual: ' + (1 - 1));\n}\n\n//CHECK#2\nif (new Number(1) - 1 !== 0) {\n $ERROR('#2: new Number(1) - 1 === 0. Actual: ' + (new Number(1) - 1));\n}\n\n//CHECK#3\nif (1 - new Number(1) !== 0) {\n $ERROR('#3: 1 - new Number(1) === 0. Actual: ' + (1 - new Number(1)));\n}\n\n//CHECK#4\nif (new Number(1) - new Number(1) !== 0) {\n $ERROR('#4: new Number(1) - new Number(1) === 0. Actual: ' + (new Number(1) - new Number(1)));\n}\n\n",
"id": "S11.6.2_A3_T1.2"
},
{
"section": "11.6.2",
"description": "Type(x) and Type(y) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" - \"1\" !== 0) {\n $ERROR('#1: \"1\" - \"1\" === 0. Actual: ' + (\"1\" - \"1\"));\n}\n\n//CHECK#2\nif (new String(\"1\") - \"1\" !== 0) {\n $ERROR('#2: new String(\"1\") - \"1\" === 0. Actual: ' + (new String(\"1\") - \"1\"));\n}\n\n//CHECK#3\nif (\"1\" - new String(\"1\") !== 0) {\n $ERROR('#3: \"1\" - new String(\"1\") === 0. Actual: ' + (\"1\" - new String(\"1\")));\n}\n\n//CHECK#4\nif (new String(\"1\") - new String(\"1\") !== 0) {\n $ERROR('#4: new String(\"1\") - new String(\"1\") === 0. Actual: ' + (new String(\"1\") - new String(\"1\")));\n}\n\n//CHECK#5\nif (isNaN(\"x\" - \"1\") !== true) {\n $ERROR('#5: \"x\" - \"1\" === Not-a-Number. Actual: ' + (\"x\" - \"1\"));\n}\n\n//CHECK#6\nif (isNaN(\"1\" - \"x\") !== true) {\n $ERROR('#6: \"1\" - \"x\" === Not-a-Number. Actual: ' + (\"1\" - \"x\"));\n}\n",
"id": "S11.6.2_A3_T1.3"
},
{
"section": "11.6.2",
"description": "Type(x) and Type(y) vary between Null and Undefined",
"test": "//CHECK#1\nif (isNaN(null - undefined) !== true) {\n $ERROR('#1: null - undefined === Not-a-Number. Actual: ' + (null - undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined - null) !== true) {\n $ERROR('#2: undefined - null === Not-a-Number. Actual: ' + (undefined - null));\n}\n\n//CHECK#3\nif (isNaN(undefined - undefined) !== true) {\n $ERROR('#3: undefined - undefined === Not-a-Number. Actual: ' + (undefined - undefined));\n}\n\n//CHECK#4\nif (null - null !== 0) {\n $ERROR('#4: null - null === 0. Actual: ' + (null - null));\n}\n",
"id": "S11.6.2_A3_T1.4"
},
{
"section": "11.6.2",
"description": "Type(x) and Type(y) vary between Object object and Function object",
"test": "//CHECK#1\nif (isNaN({} - function(){return 1}) !== true) {\n $ERROR('#1: {} - function(){return 1} === Not-a-Number. Actual: ' + ({} - function(){return 1}));\n}\n\n//CHECK#2\nif (isNaN(function(){return 1} - {}) !== true) {\n $ERROR('#2: function(){return 1} - {} === Not-a-Number. Actual: ' + (function(){return 1} - {}));\n}\n\n//CHECK#3\nif (isNaN(function(){return 1} - function(){return 1}) !== true) {\n $ERROR('#3: function(){return 1} - function(){return 1} === Not-a-Number. Actual: ' + (function(){return 1} - function(){return 1}));\n}\n\n//CHECK#4\nif (isNaN({} - {}) !== true) {\n $ERROR('#4: {} - {} === Not-a-Number. Actual: ' + ({} - {}));\n}\n",
"id": "S11.6.2_A3_T1.5"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true - 1 !== 0) {\n $ERROR('#1: true - 1 === 0. Actual: ' + (true - 1));\n}\n\n//CHECK#2\nif (1 - true !== 0) {\n $ERROR('#2: 1 - true === 0. Actual: ' + (1 - true));\n}\n\n//CHECK#3\nif (new Boolean(true) - 1 !== 0) {\n $ERROR('#3: new Boolean(true) - 1 === 0. Actual: ' + (new Boolean(true) - 1));\n}\n\n//CHECK#4\nif (1 - new Boolean(true) !== 0) {\n $ERROR('#4: 1 - new Boolean(true) === 0. Actual: ' + (1 - new Boolean(true)));\n}\n\n//CHECK#5\nif (true - new Number(1) !== 0) {\n $ERROR('#5: true - new Number(1) === 0. Actual: ' + (true - new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) - true !== 0) {\n $ERROR('#6: new Number(1) - true === 0. Actual: ' + (new Number(1) - true));\n}\n\n//CHECK#7\nif (new Boolean(true) - new Number(1) !== 0) {\n $ERROR('#7: new Boolean(true) - new Number(1) === 0. Actual: ' + (new Boolean(true) - new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) - new Boolean(true) !== 0) {\n $ERROR('#8: new Number(1) - new Boolean(true) === 0. Actual: ' + (new Number(1) - new Boolean(true)));\n}\n",
"id": "S11.6.2_A3_T2.1"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" - 1 !== 0) {\n $ERROR('#1: \"1\" - 1 === 0. Actual: ' + (\"1\" - 1));\n}\n\n//CHECK#2\nif (1 - \"1\" !== 0) {\n $ERROR('#2: 1 - \"1\" === 0. Actual: ' + (1 - \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") - 1 !== 0) {\n $ERROR('#3: new String(\"1\") - 1 === 0. Actual: ' + (new String(\"1\") - 1));\n}\n\n//CHECK#4\nif (1 - new String(\"1\") !== 0) {\n $ERROR('#4: 1 - new String(\"1\") === 0. Actual: ' + (1 - new String(\"1\")));\n}\n\n//CHECK#5\nif (\"1\" - new Number(1) !== 0) {\n $ERROR('#5: \"1\" - new Number(1) === 0. Actual: ' + (\"1\" - new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) - \"1\" !== 0) {\n $ERROR('#6: new Number(1) - \"1\" === 0. Actual: ' + (new Number(1) - \"1\"));\n}\n\n//CHECK#7\nif (new String(\"1\") - new Number(1) !== 0) {\n $ERROR('#7: new String(\"1\") - new Number(1) === 0. Actual: ' + (new String(\"1\") - new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) - new String(\"1\") !== 0) {\n $ERROR('#8: new Number(1) - new String(\"1\") === 0. Actual: ' + (new Number(1) - new String(\"1\")));\n}\n\n//CHECK#9\nif (isNaN(\"x\" - 1) !== true) {\n $ERROR('#9: \"x\" - 1 === Not-a-Number. Actual: ' + (\"x\" - 1));\n}\n\n//CHECK#10\nif (isNaN(1 - \"x\") !== true) {\n $ERROR('#10: 1 - \"x\" === Not-a-Number. Actual: ' + (1 - \"x\"));\n}\n",
"id": "S11.6.2_A3_T2.2"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 - null !== 1) {\n $ERROR('#1: 1 - null === 1. Actual: ' + (1 - null));\n}\n\n//CHECK#2\nif (null - 1 !== -1) {\n $ERROR('#2: null - 1 === -1. Actual: ' + (null - 1));\n}\n\n//CHECK#3\nif (new Number(1) - null !== 1) {\n $ERROR('#3: new Number(1) - null === 1. Actual: ' + (new Number(1) - null));\n}\n\n//CHECK#4\nif (null - new Number(1) !== -1) {\n $ERROR('#4: null - new Number(1) === -1. Actual: ' + (null - new Number(1)));\n}\n",
"id": "S11.6.2_A3_T2.3"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(1 - undefined) !== true) {\n $ERROR('#1: 1 - undefined === Not-a-Number. Actual: ' + (1 - undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined - 1) !== true) {\n $ERROR('#2: undefined - 1 === Not-a-Number. Actual: ' + (undefined - 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) - undefined) !== true) {\n $ERROR('#3: new Number(1) - undefined === Not-a-Number. Actual: ' + (new Number(1) - undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined - new Number(1)) !== true) {\n $ERROR('#4: undefined - new Number(1) === Not-a-Number. Actual: ' + (undefined - new Number(1)));\n}\n",
"id": "S11.6.2_A3_T2.4"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true - \"1\" !== 0) {\n $ERROR('#1: true - \"1\" === 0. Actual: ' + (true - \"1\"));\n}\n\n//CHECK#2\nif (\"1\" - true !== 0) {\n $ERROR('#2: \"1\" - true === 0. Actual: ' + (\"1\" - true));\n}\n\n//CHECK#3\nif (new Boolean(true) - \"1\" !== 0) {\n $ERROR('#3: new Boolean(true) - \"1\" === 0. Actual: ' + (new Boolean(true) - \"1\"));\n}\n\n//CHECK#4\nif (\"1\" - new Boolean(true) !== 0) {\n $ERROR('#4: \"1\" - new Boolean(true) === 0. Actual: ' + (\"1\" - new Boolean(true)));\n}\n\n//CHECK#5\nif (true - new String(\"1\") !== 0) {\n $ERROR('#5: true - new String(\"1\") === 0. Actual: ' + (true - new String(\"1\")));\n}\n\n//CHECK#6\nif (new String(\"1\") - true !== 0) {\n $ERROR('#6: new String(\"1\") - true === 0. Actual: ' + (new String(\"1\") - true));\n}\n\n//CHECK#7\nif (new Boolean(true) - new String(\"1\") !== 0) {\n $ERROR('#7: new Boolean(true) - new String(\"1\") === 0. Actual: ' + (new Boolean(true) - new String(\"1\")));\n}\n\n//CHECK#8\nif (new String(\"1\") - new Boolean(true) !== 0) {\n $ERROR('#8: new String(\"1\") - new Boolean(true) === 0. Actual: ' + (new String(\"1\") - new Boolean(true)));\n}\n",
"id": "S11.6.2_A3_T2.5"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(\"1\" - undefined) !== true) {\n $ERROR('#1: \"1\" - undefined === Not-a-Number. Actual: ' + (\"1\" - undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined - \"1\") !== true) {\n $ERROR('#2: undefined - \"1\" === Not-a-Number. Actual: ' + (undefined - \"1\"));\n}\n\n//CHECK#3\nif (isNaN(new String(\"1\") - undefined) !== true) {\n $ERROR('#3: new String(\"1\") - undefined === Not-a-Number. Actual: ' + (new String(\"1\") - undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined - new String(\"1\")) !== true) {\n $ERROR('#4: undefined - new String(\"1\") === Not-a-Number. Actual: ' + (undefined - new String(\"1\")));\n}\n",
"id": "S11.6.2_A3_T2.6"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" - null !== 1) {\n $ERROR('#1: \"1\" - null === 1. Actual: ' + (\"1\" - null));\n}\n\n//CHECK#2\nif (null - \"1\" !== -1) {\n $ERROR('#2: null - \"1\" === -1. Actual: ' + (null - \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") - null !== 1) {\n $ERROR('#3: new String(\"1\") - null === 1. Actual: ' + (new String(\"1\") - null));\n}\n\n//CHECK#4\nif (null - new String(\"1\") !== -1) {\n $ERROR('#4: null - new String(\"1\") === -1. Actual: ' + (null - new String(\"1\")));\n}\n",
"id": "S11.6.2_A3_T2.7"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (isNaN(true - undefined) !== true) {\n $ERROR('#1: true - undefined === Not-a-Number. Actual: ' + (true - undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined - true) !== true) {\n $ERROR('#2: undefined - true === Not-a-Number. Actual: ' + (undefined - true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) - undefined) !== true) {\n $ERROR('#3: new Boolean(true) - undefined === Not-a-Number. Actual: ' + (new Boolean(true) - undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined - new Boolean(true)) !== true) {\n $ERROR('#4: undefined - new Boolean(true) === Not-a-Number. Actual: ' + (undefined - new Boolean(true)));\n}\n",
"id": "S11.6.2_A3_T2.8"
},
{
"section": "11.6.2",
"description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true - null !== 1) {\n $ERROR('#1: true - null === 1. Actual: ' + (true - null));\n}\n\n//CHECK#2\nif (null - true !== -1) {\n $ERROR('#2: null - true === -1. Actual: ' + (null - true));\n}\n\n//CHECK#3\nif (new Boolean(true) - null !== 1) {\n $ERROR('#3: new Boolean(true) - null === 1. Actual: ' + (new Boolean(true) - null));\n}\n\n//CHECK#4\nif (null - new Boolean(true) !== -1) {\n $ERROR('#4: null - new Boolean(true) === -1. Actual: ' + (null - new Boolean(true)));\n}\n",
"id": "S11.6.2_A3_T2.9"
},
{
"section": "11.6.2, 11.6.3",
"description": "If either operand is NaN, the result is NaN",
"test": "//CHECK#1\nif (isNaN(Number.NaN - 1) !== true ) {\n $ERROR('#1: NaN - 1 === Not-a-Number. Actual: ' + (NaN - 1));\n}\n\n//CHECK#2\nif (isNaN(1 - Number.NaN) !== true ) {\n $ERROR('#2: 1 - NaN === Not-a-Number. Actual: ' + (1 - NaN));\n}\n\n//CHECK#3\nif (isNaN(Number.NaN - Number.POSITIVE_INFINITY) !== true ) {\n $ERROR('#3: NaN - Infinity === Not-a-Number. Actual: ' + (NaN - Infinity));\n}\n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY - Number.NaN) !== true ) {\n $ERROR('#4: Infinity - NaN === Not-a-Number. Actual: ' + (Infinity - NaN));\n}\n\n//CHECK#5\nif (isNaN(Number.NaN - Number.NEGATIVE_INFINITY) !== true ) {\n $ERROR('#5: NaN - Infinity === Not-a-Number. Actual: ' + (NaN - Infinity));\n}\n\n//CHECK#6\nif (isNaN(Number.NEGATIVE_INFINITY - Number.NaN) !== true ) {\n $ERROR('#6: Infinity - NaN === Not-a-Number. Actual: ' + (Infinity - NaN));\n}\n",
"id": "S11.6.2_A4_T1"
},
{
"section": "11.6.2, 11.6.3",
"description": "The difference of two infinities of opposite sign is the infinity of minuend sign",
"test": "//CHECK#1\nif (Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY !== Number.POSITIVE_INFINITY ) {\n $ERROR('#1: Infinity - -Infinity === Infinity. Actual: ' + (Infinity - -Infinity));\n}\n\n//CHECK#2\nif (Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#2: -Infinity - Infinity === -Infinity. Actual: ' + (-Infinity - Infinity));\n}\n\n\n\n",
"id": "S11.6.2_A4_T2"
},
{
"section": "11.6.2, 11.6.3",
"description": "The difference of two infinities of the same sign is NaN",
"test": "//CHECK#1\nif (isNaN(Number.POSITIVE_INFINITY - Number.POSITIVE_INFINITY) !== true ) {\n $ERROR('#1: Infinity - Infinity === Not-a-Number. Actual: ' + (Infinity - Infinity));\n}\n\n//CHECK#2\nif (isNaN(Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY) !== true ) {\n $ERROR('#2: -Infinity - -Infinity === Not-a-Number. Actual: ' + (-Infinity - -Infinity));\n}\n\n\n\n",
"id": "S11.6.2_A4_T3"
},
{
"section": "11.6.2, 11.6.3",
"description": "The difference of an infinity and a finite value is equal to infinity of appropriate sign",
"test": "//CHECK#1\nif (Number.POSITIVE_INFINITY - 1 !== Number.POSITIVE_INFINITY ) {\n $ERROR('#1: Infinity - 1 === Infinity. Actual: ' + (Infinity - 1));\n}\n\n//CHECK#2\nif (-1 - Number.POSITIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#2: -1 - Infinity === -Infinity. Actual: ' + (-1 - Infinity));\n}\n\n//CHECK#3\nif (Number.NEGATIVE_INFINITY - 1 !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#3: -Infinity - 1 === -Infinity. Actual: ' + (-Infinity - 1));\n}\n\n//CHECK#4\nif (-1 - Number.NEGATIVE_INFINITY !== Number.POSITIVE_INFINITY ) {\n $ERROR('#4: -1 - -Infinity === Infinity. Actual: ' + (-1 - -Infinity));\n}\n\n//CHECK#5\nif (Number.POSITIVE_INFINITY - Number.MAX_VALUE !== Number.POSITIVE_INFINITY ) {\n $ERROR('#5: Infinity - Number.MAX_VALUE === Infinity. Actual: ' + (Infinity - Number.MAX_VALUE));\n}\n\n//CHECK#6\nif (-Number.MAX_VALUE - Number.POSITIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#6: -Number.MAX_VALUE - Infinity === I-nfinity. Actual: ' + (-Number.MAX_VALUE - Infinity));\n}\n\n//CHECK#7\nif (Number.NEGATIVE_INFINITY - Number.MAX_VALUE !== Number.NEGATIVE_INFINITY ) {\n $ERROR('#7: -Infinity - Number.MAX_VALUE === -Infinity. Actual: ' + (-Infinity - Number.MAX_VALUE));\n}\n\n//CHECK#8\nif (-Number.MAX_VALUE - Number.NEGATIVE_INFINITY !== Number.POSITIVE_INFINITY ) {\n $ERROR('#8: -Number.MAX_VALUE - -Infinity === Infinity. Actual: ' + (-Number.MAX_VALUE - -Infinity));\n}\n\n\n\n",
"id": "S11.6.2_A4_T4"
},
{
"section": "11.6.2, 11.6.3",
"description": "Using the rule of sum of two zeroes and the fact that a - b = a + (-b)",
"test": "//CHECK#1\nif (-0 - -0 !== 0 ) { \n $ERROR('#1.1: -0 - -0 === 0. Actual: ' + (-0 - -0));\n} else {\n if (1 / (-0 - -0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#1.2: -0 - -0 === + 0. Actual: -0');\n }\n}\n\n//CHECK#2\nif (0 - -0 !== 0 ) { \n $ERROR('#2.1: 0 - -0 === 0. Actual: ' + (0 - -0));\n} else {\n if (1 / (0 - -0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: 0 - -0 === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (-0 - 0 !== -0 ) { \n $ERROR('#3.1: -0 - 0 === 0. Actual: ' + (-0 - 0));\n} else {\n if (1 / (-0 - 0) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3.2: -0 - 0 === - 0. Actual: +0');\n }\n}\n\n//CHECK#4\nif (0 - 0 !== 0 ) { \n $ERROR('#4.1: 0 - 0 === 0. Actual: ' + (0 - 0));\n} else {\n if (1 / (0 - 0) !== Number.POSITIVE_INFINITY) {\n $ERROR('#4.2: 0 - 0 === + 0. Actual: -0');\n }\n}\n",
"id": "S11.6.2_A4_T5"
},
{
"section": "11.6.2, 11.6.3",
"description": "Using the rule of sum of a zero and a nonzero finite value and the fact that a - b = a + (-b)",
"test": "//CHECK#1\nif (1 - -0 !== 1 ) { \n $ERROR('#1: 1 - -0 === 1. Actual: ' + (1 - -0));\n}\n\n//CHECK#2\nif (1 - 0 !== 1 ) { \n $ERROR('#2: 1 - 0 === 1. Actual: ' + (1 - 0));\n} \n\n//CHECK#3\nif (-0 - 1 !== -1 ) { \n $ERROR('#3: -0 - 1 === -1. Actual: ' + (-0 - 1));\n}\n\n//CHECK#4\nif (0 - 1 !== -1 ) { \n $ERROR('#4: 0 - 1 === -1. Actual: ' + (0 - 1));\n} \n\n//CHECK#5\nif (Number.MAX_VALUE - -0 !== Number.MAX_VALUE ) { \n $ERROR('#5: Number.MAX_VALUE - -0 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE - -0));\n}\n\n//CHECK#6\nif (Number.MAX_VALUE - 0 !== Number.MAX_VALUE ) { \n $ERROR('#6: Number.MAX_VALUE - 0 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE - 0));\n} \n\n//CHECK#7\nif (-0 - Number.MIN_VALUE !== -Number.MIN_VALUE ) { \n $ERROR('#7: -0 - Number.MIN_VALUE === -Number.MIN_VALUE. Actual: ' + (-0 - Number.MIN_VALUE));\n}\n\n//CHECK#8\nif (0 - Number.MIN_VALUE !== -Number.MIN_VALUE ) { \n $ERROR('#8: 0 - Number.MIN_VALUE === -Number.MIN_VALUE. Actual: ' + (0 - Number.MIN_VALUE));\n} \n",
"id": "S11.6.2_A4_T6"
},
{
"section": "11.6.2, 11.6.3",
"description": "The mathematical difference of two nonzero finite values of the same magnitude and same sign is +0",
"test": "//CHECK#1\nif (Number.MIN_VALUE - Number.MIN_VALUE !== +0) { \n $ERROR('#1.1: Number.MIN_VALUE - Number.MIN_VALUE === 0. Actual: ' + (Number.MIN_VALUE - Number.MIN_VALUE));\n} else {\n if (1 / (Number.MIN_VALUE - Number.MIN_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#1.2: Number.MIN_VALUE - Number.MIN_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#2\nif (-Number.MAX_VALUE - -Number.MAX_VALUE !== +0) { \n $ERROR('#2.2: -Number.MAX_VALUE - -Number.MAX_VALUE === 0. Actual: ' + (-Number.MAX_VALUE - -Number.MAX_VALUE));\n} else {\n if (1 / (-Number.MAX_VALUE - -Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.1: -Number.MAX_VALUE - -Number.MAX_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (1 / Number.MAX_VALUE - 1 / Number.MAX_VALUE !== +0) { \n $ERROR('#3.1: 1 / Number.MAX_VALUE - 1 / Number.MAX_VALUE === 0. Actual: ' + (1 / Number.MAX_VALUE - 1 / Number.MAX_VALUE));\n} else {\n if (1 / (1 / Number.MAX_VALUE - 1 / Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#3.2: 1 / Number.MAX_VALUE - 1 / Number.MAX_VALUE === + 0. Actual: -0');\n }\n}\n",
"id": "S11.6.2_A4_T7"
},
{
"section": "11.6.2, 11.6.3",
"description": "If the magnitude is too large to represent, the operation overflows and the result is then an infinity of appropriate sign",
"test": "//CHECK#1\nif (Number.MAX_VALUE - -Number.MAX_VALUE !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: Number.MAX_VALUE - -Number.MAX_VALUE === Number.POSITIVE_INFINITY. Actual: ' + (Number.MAX_VALUE - -Number.MAX_VALUE));\n}\n\n//CHECK#2\nif (-Number.MAX_VALUE - Number.MAX_VALUE !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2: -Number.MAX_VALUE - umber.MAX_VALUE === Number.NEGATIVE_INFINITY. Actual: ' + (-Number.MAX_VALUE - umber.MAX_VALUE));\n}\n\n//CHECK#3\nif (1e+308 - -1e+308 !== Number.POSITIVE_INFINITY) {\n $ERROR('#3: 1e+308 - -1e+308 === Number.POSITIVE_INFINITY. Actual: ' + (1e+308 - -1e+308));\n}\n\n//CHECK#4\nif (-8.99e+307 - 8.99e+307 !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4: -8.99e+307 - 8.99e+307 === Number.NEGATIVE_INFINITY. Actual: ' + (-8.99e+307 - 8.99e+307));\n}\n",
"id": "S11.6.2_A4_T8"
}
]
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,224 @@
{
"testCollection": {
"name": "11.8.1_The_Less_than_Operator",
"numTests": 36,
"tests": [
{
"section": "11.8.1, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"0\\u0009<\\u00091\") !== true) {\n $ERROR('#1: (0\\\\u0009<\\\\u00091) === true');\n}\n\n//CHECK#2\nif (eval(\"0\\u000B<\\u000B1\") !== true) {\n $ERROR('#2: (0\\\\u000B<\\\\u000B1) === true'); \n}\n\n//CHECK#3\nif (eval(\"0\\u000C<\\u000C1\") !== true) {\n $ERROR('#3: (0\\\\u000C<\\\\u000C1) === true');\n}\n\n//CHECK#4\nif (eval(\"0\\u0020<\\u00201\") !== true) {\n $ERROR('#4: (0\\\\u0020<\\\\u00201) === true');\n}\n\n//CHECK#5\nif (eval(\"0\\u00A0<\\u00A01\") !== true) {\n $ERROR('#5: (0\\\\u00A0<\\\\u00A01) === true');\n}\n\n//CHECK#6\nif (eval(\"0\\u000A<\\u000A1\") !== true) {\n $ERROR('#6: (0\\\\u000A<\\\\u000A1) === true'); \n}\n\n//CHECK#7\nif (eval(\"0\\u000D<\\u000D1\") !== true) {\n $ERROR('#7: (0\\\\u000D<\\\\u000D1) === true');\n}\n\n//CHECK#8\nif (eval(\"0\\u2028<\\u20281\") !== true) {\n $ERROR('#8: (0\\\\u2028<\\\\u20281) === true');\n}\n\n//CHECK#9\nif (eval(\"0\\u2029<\\u20291\") !== true) {\n $ERROR('#9: (0\\\\u2029<\\\\u20291) === true');\n}\n\n//CHECK#10\nif (eval(\"0\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029<\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== true) {\n $ERROR('#10: (0\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029<\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === true');\n}\n",
"id": "S11.8.1_A1"
},
{
"section": "11.8.1, 11.8.5",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 < 2 !== true) {\n $ERROR('#1: 1 < 2 === true');\n}\n\n//CHECK#2\nvar x = 1;\nif (x < 2 !== true) {\n $ERROR('#2: var x = 1; x < 2 === true');\n}\n\n//CHECK#3\nvar y = 2;\nif (1 < y !== true) {\n $ERROR('#3: var y = 2; 1 < y === true');\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 2;\nif (x < y !== true) {\n $ERROR('#4: var x = 1; var y = 2; x < y === true');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 2;\nif (objectx.prop < objecty.prop !== true) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 2; objectx.prop < objecty.prop === true');\n}\n",
"id": "S11.8.1_A2.1_T1"
},
{
"section": "11.8.1, 11.8.5",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x < 1;\n $ERROR('#1.1: x < 1 throw ReferenceError. Actual: ' + (x < 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x < 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.8.1_A2.1_T2"
},
{
"section": "11.8.1, 11.8.5",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 < y;\n $ERROR('#1.1: 1 < y throw ReferenceError. Actual: ' + (1 < y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 < y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.8.1_A2.1_T3"
},
{
"section": "11.8.1, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 0}} < 1 !== true) {\n $ERROR('#1: {valueOf: function() {return 1}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}} < 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 0}, toString: function() {return 2}} < 1 !== true) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} < 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 0}, toString: function() {return {}}} < 1 !== true) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} < 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 0}, toString: function() {throw \"error\"}} < 1 !== true) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} < 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 0}, toString: function() {throw \"error\"}} < 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 0}, toString: function() {throw \"error\"}} < 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 < {toString: function() {return 2}} !== true) {\n $ERROR('#5: 1 < {toString: function() {return 2}} === true. Actual: ' + (1 < {toString: function() {return 2}}));\n}\n\n//CHECK#6\nif (1 < {valueOf: function() {return {}}, toString: function() {return 2}} !== true) {\n $ERROR('#6: 1 < {valueOf: function() {return {}}, toString: function() {return 2}} === true. Actual: ' + (1 < {valueOf: function() {return {}}, toString: function() {return 2}}));\n}\n\n//CHECK#7\ntry {\n 1 < {valueOf: function() {throw \"error\"}, toString: function() {return 2}};\n $ERROR('#7.1: 1 < {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (1 < {valueOf: function() {throw \"error\"}, toString: function() {return 2}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 < {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 < {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 < {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 < {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 < {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.8.1_A2.2_T1"
},
{
"section": "11.8.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x < y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x < y throw \"x\". Actual: ' + (x < y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x < y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.1_A2.3_T1"
},
{
"section": "11.8.1",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 1; \nif ((x = 0) < x !== false) {\n $ERROR('#1: var x = 1; (x = 0) < x === false');\n}\n\n//CHECK#2\nvar x = 0; \nif (x < (x = 1) !== true) {\n $ERROR('#2: var x = 0; x < (x = 1) === true');\n}\n\n",
"id": "S11.8.1_A2.4_T1"
},
{
"section": "11.8.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() < y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() < y() throw \"x\". Actual: ' + (x() < y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() < y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.1_A2.4_T2"
},
{
"section": "11.8.1",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x < (x = 1);\n $ERROR('#1.1: x < (x = 1) throw ReferenceError. Actual: ' + (x < (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x < (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) < y !== false) {\n $ERROR('#2: (y = 1) < y === false');\n}\n\n",
"id": "S11.8.1_A2.4_T3"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true < true !== false) {\n $ERROR('#1: true < true === false');\n}\n\n//CHECK#2\nif (new Boolean(true) < true !== false) {\n $ERROR('#2: new Boolean(true) < true === false');\n}\n\n//CHECK#3\nif (true < new Boolean(true) !== false) {\n $ERROR('#3: true < new Boolean(true) === false');\n}\n\n//CHECK#4\nif (new Boolean(true) < new Boolean(true) !== false) {\n $ERROR('#4: new Boolean(true) < new Boolean(true) === false');\n}\n",
"id": "S11.8.1_A3.1_T1.1"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 < 1 !== false) {\n $ERROR('#1: 1 < 1 === false');\n}\n\n//CHECK#2\nif (new Number(1) < 1 !== false) {\n $ERROR('#2: new Number(1) < 1 === false');\n}\n\n//CHECK#3\nif (1 < new Number(1) !== false) {\n $ERROR('#3: 1 < new Number(1) === false');\n}\n\n//CHECK#4\nif (new Number(1) < new Number(1) !== false) {\n $ERROR('#4: new Number(1) < new Number(1) === false');\n}\n\n",
"id": "S11.8.1_A3.1_T1.2"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined",
"test": "//CHECK#1\nif (null < undefined !== false) {\n $ERROR('#1: null < undefined === false');\n}\n\n//CHECK#2\nif (undefined < null !== false) {\n $ERROR('#2: undefined < null === false');\n}\n\n//CHECK#3\nif (undefined < undefined !== false) {\n $ERROR('#3: undefined < undefined === false');\n}\n\n//CHECK#4\nif (null < null !== false) {\n $ERROR('#4: null < null === false');\n}\n",
"id": "S11.8.1_A3.1_T1.3"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types are Number (primitive or object) or Boolean (primitive and object)",
"test": "//CHECK#1\nif (true < 1 !== false) {\n $ERROR('#1: true < 1 === false');\n}\n\n//CHECK#2\nif (1 < true !== false) {\n $ERROR('#2: 1 < true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) < 1 !== false) {\n $ERROR('#3: new Boolean(true) < 1 === false');\n}\n\n//CHECK#4\nif (1 < new Boolean(true) !== false) {\n $ERROR('#4: 1 < new Boolean(true) === false');\n}\n\n//CHECK#5\nif (true < new Number(1) !== false) {\n $ERROR('#5: true < new Number(1) === false');\n}\n\n//CHECK#6\nif (new Number(1) < true !== false) {\n $ERROR('#6: new Number(1) < true === false');\n}\n\n//CHECK#7\nif (new Boolean(true) < new Number(1) !== false) {\n $ERROR('#7: new Boolean(true) < new Number(1) === false');\n}\n\n//CHECK#8\nif (new Number(1) < new Boolean(true) !== false) {\n $ERROR('#8: new Number(1) < new Boolean(true) === false');\n}\n",
"id": "S11.8.1_A3.1_T2.1"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" < 1 !== false) {\n $ERROR('#1: \"1\" < 1 === false');\n}\n\n//CHECK#2\nif (1 < \"1\" !== false) {\n $ERROR('#2: 1 < \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") < 1 !== false) {\n $ERROR('#3: new String(\"1\") < 1 === false');\n}\n\n//CHECK#4\nif (1 < new String(\"1\") !== false) {\n $ERROR('#4: 1 < new String(\"1\") === false');\n}\n\n//CHECK#5\nif (\"1\" < new Number(1) !== false) {\n $ERROR('#5: \"1\" < new Number(1) === false');\n}\n\n//CHECK#6\nif (new Number(1) < \"1\" !== false) {\n $ERROR('#6: new Number(1) < \"1\" === false');\n}\n\n//CHECK#7\nif (new String(\"1\") < new Number(1) !== false) {\n $ERROR('#7: new String(\"1\") < new Number(1) === false');\n}\n\n//CHECK#8\nif (new Number(1) < new String(\"1\") !== false) {\n $ERROR('#8: new Number(1) < new String(\"1\") === false');\n}\n\n//CHECK#9\nif (\"x\" < 1 !== false) {\n $ERROR('#9: \"x\" < 1 === false');\n}\n\n//CHECK#10\nif (1 < \"x\" !== false) {\n $ERROR('#10: 1 < \"x\" === false');\n}\n",
"id": "S11.8.1_A3.1_T2.2"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 < null !== false) {\n $ERROR('#1: 1 < null === false');\n}\n\n//CHECK#2\nif (null < 1 !== true) {\n $ERROR('#2: null < 1 === true');\n}\n\n//CHECK#3\nif (new Number(1) < null !== false) {\n $ERROR('#3: new Number(1) < null === false');\n}\n\n//CHECK#4\nif (null < new Number(1) !== true) {\n $ERROR('#4: null < new Number(1) === true');\n}\n",
"id": "S11.8.1_A3.1_T2.3"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (1 < undefined !== false) {\n $ERROR('#1: 1 < undefined === false');\n}\n\n//CHECK#2\nif (undefined < 1 !== false) {\n $ERROR('#2: undefined < 1 === false');\n}\n\n//CHECK#3\nif (new Number(1) < undefined !== false) {\n $ERROR('#3: new Number(1) < undefined === false');\n}\n\n//CHECK#4\nif (undefined < new Number(1) !== false) {\n $ERROR('#4: undefined < new Number(1) === false');\n}\n",
"id": "S11.8.1_A3.1_T2.4"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true < \"1\" !== false) {\n $ERROR('#1: true < \"1\" === false');\n}\n\n//CHECK#2\nif (\"1\" < true !== false) {\n $ERROR('#2: \"1\" < true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) < \"1\" !== false) {\n $ERROR('#3: new Boolean(true) < \"1\" === false');\n}\n\n//CHECK#4\nif (\"1\" < new Boolean(true) !== false) {\n $ERROR('#4: \"1\" < new Boolean(true) === false');\n}\n\n//CHECK#5\nif (true < new String(\"1\") !== false) {\n $ERROR('#5: true < new String(\"1\") === false');\n}\n\n//CHECK#6\nif (new String(\"1\") < true !== false) {\n $ERROR('#6: new String(\"1\") < true === false');\n}\n\n//CHECK#7\nif (new Boolean(true) < new String(\"1\") !== false) {\n $ERROR('#7: new Boolean(true) < new String(\"1\") === false');\n}\n\n//CHECK#8\nif (new String(\"1\") < new Boolean(true) !== false) {\n $ERROR('#8: new String(\"1\") < new Boolean(true) === false');\n}\n",
"id": "S11.8.1_A3.1_T2.5"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (\"1\" < undefined !== false) {\n $ERROR('#1: \"1\" < undefined === false');\n}\n\n//CHECK#2\nif (undefined < \"1\" !== false) {\n $ERROR('#2: undefined < \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") < undefined !== false) {\n $ERROR('#3: new String(\"1\") < undefined === false');\n}\n\n//CHECK#4\nif (undefined < new String(\"1\") !== false) {\n $ERROR('#4: undefined < new String(\"1\") === false');\n}\n",
"id": "S11.8.1_A3.1_T2.6"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" < null !== false) {\n $ERROR('#1: \"1\" < null === false');\n}\n\n//CHECK#2\nif (null < \"1\" !== true) {\n $ERROR('#2: null < \"1\" === true');\n}\n\n//CHECK#3\nif (new String(\"1\") < null !== false) {\n $ERROR('#3: new String(\"1\") < null === false');\n}\n\n//CHECK#4\nif (null < new String(\"1\") !== true) {\n $ERROR('#4: null < new String(\"1\") === true');\n}\n",
"id": "S11.8.1_A3.1_T2.7"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (true < undefined !== false) {\n $ERROR('#1: true < undefined === false');\n}\n\n//CHECK#2\nif (undefined < true !== false) {\n $ERROR('#2: undefined < true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) < undefined !== false) {\n $ERROR('#3: new Boolean(true) < undefined === false');\n}\n\n//CHECK#4\nif (undefined < new Boolean(true) !== false) {\n $ERROR('#4: undefined < new Boolean(true) === false');\n}\n",
"id": "S11.8.1_A3.1_T2.8"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true < null !== false) {\n $ERROR('#1: true < null === false');\n}\n\n//CHECK#2\nif (null < true !== true) {\n $ERROR('#2: null < true === true');\n}\n\n//CHECK#3\nif (new Boolean(true) < null !== false) {\n $ERROR('#3: new Boolean(true) < null === false');\n}\n\n//CHECK#4\nif (null < new Boolean(true) !== true) {\n $ERROR('#4: null < new Boolean(true) === true');\n}\n",
"id": "S11.8.1_A3.1_T2.9"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" < \"1\" !== false) {\n $ERROR('#1: \"1\" < \"1\" === false');\n}\n\n//CHECK#2\nif (new String(\"1\") < \"1\" !== false) {\n $ERROR('#2: new String(\"1\") < \"1\" === false');\n}\n\n//CHECK#3\nif (\"1\" < new String(\"1\") !== false) {\n $ERROR('#3: \"1\" < new String(\"1\") === false');\n}\n\n//CHECK#4\nif (new String(\"1\") < new String(\"1\") !== false) {\n $ERROR('#4: new String(\"1\") < new String(\"1\") === false');\n}\n\n//CHECK#5\nif (\"x\" < \"1\" !== false) {\n $ERROR('#5: \"x\" < \"1\" === false');\n}\n\n//CHECK#6\nif (\"1\" < \"x\" !== true) {\n $ERROR('#6: \"1\" < \"x\" === true');\n}\n",
"id": "S11.8.1_A3.2_T1.1"
},
{
"section": "11.8.1",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object",
"test": "//CHECK#1\nif (({} < function(){return 1}) !== ({}.toString() < function(){return 1}.toString())) {\n $ERROR('#1: ({} < function(){return 1}) === ({}.toString() < function(){return 1}.toString())');\n}\n\n//CHECK#2\nif ((function(){return 1} < {}) !== (function(){return 1}.toString() < {}.toString())) {\n $ERROR('#2: (function(){return 1} < {}) === (function(){return 1}.toString() < {}.toString())');\n}\n\n//CHECK#3\nif ((function(){return 1} < function(){return 1}) !== (function(){return 1}.toString() < function(){return 1}.toString())) {\n $ERROR('#3: (function(){return 1} < function(){return 1}) === (function(){return 1}.toString() < function(){return 1}.toString())');\n}\n\n//CHECK#4\nif (({} < {}) !== ({}.toString() < {}.toString())) {\n $ERROR('#4: ({} < {}) === ({}.toString() < {}.toString())');\n}\n",
"id": "S11.8.1_A3.2_T1.2"
},
{
"section": "11.8.1, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NaN < 0) !== false) {\n $ERROR('#1: (NaN < 0) === false');\n}\n\n//CHECK#2\nif ((Number.NaN < 1.1) !== false) {\n $ERROR('#2: (NaN < 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.NaN < -1.1) !== false) {\n $ERROR('#3: (NaN < -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NaN < Number.NaN) !== false) {\n $ERROR('#4: (NaN < NaN) === false');\n}\n\n//CHECK#5\nif ((Number.NaN < Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (NaN < +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.NaN < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#6: (NaN < -Infinity) === false');\n}\n\n//CHECK#7\nif ((Number.NaN < Number.MAX_VALUE) !== false) {\n $ERROR('#7: (NaN < Number.MAX_VALUE) === false');\n}\n\n//CHECK#8\nif ((Number.NaN < Number.MIN_VALUE) !== false) {\n $ERROR('#8: (NaN < Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.1_A4.1"
},
{
"section": "11.8.1, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" < \"x\") !== false) {\n $ERROR('#1: (\"x\" < \"x\") === false');\n}\n\n//CHECK#2\nif ((\"x\" < \"\") !== false) {\n $ERROR('#2: (\"x\" < \"\") === false');\n}\n\n//CHECK#3\nif ((\"abcd\" < \"ab\") !== false) {\n $ERROR('#3: (\"abcd\" < ab\") === false');\n}\n\n//CHECK#4\nif ((\"abc\\u0064\" < \"abcd\") !== false) {\n $ERROR('#4: (\"abc\\\\u0064\" < abcd\") === false');\n}\n\n//CHECK#5\nif ((\"x\" + \"y\" < \"x\") !== false) {\n $ERROR('#5: (\"x\" + \"y\" < \"x\") === false');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x + \"y\" < x) !== false) {\n $ERROR('#6: var x = \"x\"; (x + \"y\" < x) === false');\n}\n\n",
"id": "S11.8.1_A4.10"
},
{
"section": "11.8.1, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" < \"x \") !== true) {\n $ERROR('#1: (\"x\" < \"x \") === true');\n}\n\n//CHECK#2\nif ((\"\" < \"x\") !== true) {\n $ERROR('#2: (\"\" < \"x\") === true');\n}\n\n//CHECK#3\nif ((\"ab\" < \"abcd\") !== true) {\n $ERROR('#3: (\"ab\" < abcd\") === true');\n}\n\n//CHECK#4\nif ((\"abcd\" < \"abc\\u0064\") !== false) {\n $ERROR('#4: (\"abcd\" < abc\\\\u0064\") === false');\n}\n\n//CHECK#5\nif ((\"x\" < \"x\" + \"y\") !== true) {\n $ERROR('#5: (\"x\" < \"x\" + \"y\") === true');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x < x + \"y\") !== true) {\n $ERROR('#6: var x = \"x\"; (x < x + \"y\") === true');\n}\n\n//CHECK#7\nif ((\"a\\u0000\" < \"a\\u0000a\") !== true) {\n $ERROR('#7: (\"a\\\\u0000\" < \"a\\\\u0000a\") === true');\n}\n\n//CHECK#8\nif ((\"x\" < \" x\") !== false) {\n $ERROR('#8: (\"x\" < \" x\") === false');\n}\n\n\n",
"id": "S11.8.1_A4.11"
},
{
"section": "11.8.1, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"xx\" < \"xy\") !== true) {\n $ERROR('#1: (\"xx\" < \"xy\") === true');\n}\n\n//CHECK#2\nif ((\"xy\" < \"xx\") !== false) {\n $ERROR('#2: (\"xy\" < \"xx\") === false');\n}\n\n//CHECK#3\nif ((\"x\" < \"y\") !== true) {\n $ERROR('#3: (\"x\" < y\") === true');\n}\n\n//CHECK#4\nif ((\"aab\" < \"aba\") !== true) {\n $ERROR('#4: (\"aab\" < aba\") === true');\n}\n\n//CHECK#5\nif ((\"\\u0061\\u0061\\u0061\\u0062\" < \"\\u0061\\u0061\\u0061\\u0061\") !== false) {\n $ERROR('#5: (\"\\\\u0061\\\\u0061\\\\u0061\\\\u0062\" < \\\\u0061\\\\u0061\\\\u0061\\\\u0061\") === false');\n}\n\n//CHECK#6\nif ((\"a\\u0000a\" < \"a\\u0000b\") !== true) {\n $ERROR('#6: (\"a\\\\u0000a\" < \"a\\\\u0000b\") === true');\n}\n\n//CHECK#7\nif ((\"aB\" < \"aa\") !== true) {\n $ERROR('#7: (\"aB\" < aa\") === true');\n}\n",
"id": "S11.8.1_A4.12_T1"
},
{
"section": "11.8.1, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"0\" < \"x\") !== true) {\n $ERROR('#1: (\"0\" < \"x\") !== true');\n}\n\n//CHECK#2\nif ((\"-\" < \"0\") !== true) {\n $ERROR('#2: (\"-\" < \"0\") !== true');\n}\n\n//CHECK#3\nif ((\".\" < \"0\") !== true) {\n $ERROR('#3: (\".\" < \"0\") !== true');\n}\n\n//CHECK#4\nif ((\"+\" < \"-\") !== true) {\n $ERROR('#4: (\"+\" < \"-\") !== true');\n}\n\n//CHECK#5\nif ((\"-0\" < \"-1\") !== true) {\n $ERROR('#5: (\"-0\" < \"-1\") !== true');\n}\n\n//CHECK#6\nif ((\"+1\" < \"-1\") !== true) {\n $ERROR('#6: (\"+1\" < \"-1\") !== true');\n}\n\n//CHECK#7\nif ((\"1\" < \"1e-10\") !== true) {\n$ERROR('#7: (\"1\" < \"1e-10\") !== true');\n}\n",
"id": "S11.8.1_A4.12_T2"
},
{
"section": "11.8.1, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 < Number.NaN) !== false) {\n $ERROR('#1: (0 < NaN) === false');\n}\n\n//CHECK#2\nif ((1.1 < Number.NaN) !== false) {\n $ERROR('#2: (1.1 < NaN) === false');\n}\n\n//CHECK#3\nif ((-1.1 < Number.NaN) !== false) {\n $ERROR('#3: (-1.1 < NaN) === false');\n}\n\n//CHECK#4\nif ((Number.NaN < Number.NaN) !== false) {\n $ERROR('#4: (NaN < NaN) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY < Number.NaN) !== false) {\n $ERROR('#5: (+Infinity < NaN) === false');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY < Number.NaN) !== false) {\n $ERROR('#6: (-Infinity < NaN) === false');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE < Number.NaN) !== false) {\n $ERROR('#7: (Number.MAX_VALUE < NaN) === false');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE < Number.NaN) !== false) {\n $ERROR('#8: (Number.MIN_VALUE < NaN) === false');\n}\n\n",
"id": "S11.8.1_A4.2"
},
{
"section": "11.8.1, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1 < 1) !== false) {\n $ERROR('#1: (1 < 1) === false');\n}\n\n//CHECK#2\nif ((1.1 < 1.1) !== false) {\n $ERROR('#2: (1.1 < 1.1) === false');\n}\n\n//CHECK#3\nif ((-1.1 < -1.1) !== false) {\n $ERROR('#3: (-1.1 < -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#4: (-Infinity < -Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY < Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (+Infinity < +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.MAX_VALUE < Number.MAX_VALUE) !== false) {\n $ERROR('#6: (Number.MAX_VALUE < Number.MAX_VALUE) === false');\n}\n\n//CHECK#7\nif ((Number.MIN_VALUE < Number.MIN_VALUE) !== false) {\n $ERROR('#7: (Number.MIN_VALUE < Number.MIN_VALUE) === false');\n}\n\n\n",
"id": "S11.8.1_A4.3"
},
{
"section": "11.8.1, 11.8.5",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((0 < 0) !== false) {\n $ERROR('#1: (0 < 0) === false');\n}\n\n//CHECK#2\nif ((-0 < -0) !== false) {\n $ERROR('#2: (-0 < -0) === false');\n}\n\n//CHECK#3\nif ((+0 < -0) !== false) {\n $ERROR('#3: (+0 < -0) === false');\n}\n\n//CHECK#4\nif ((-0 < +0) !== false) {\n $ERROR('#4: (-0 < +0) === false');\n}\n\n",
"id": "S11.8.1_A4.4"
},
{
"section": "11.8.1, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.POSITIVE_INFINITY < 0) !== false) {\n $ERROR('#1: (+Infinity < 0) === false');\n}\n\n//CHECK#2\nif ((Number.POSITIVE_INFINITY < 1.1) !== false) {\n $ERROR('#2: (+Infinity < 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.POSITIVE_INFINITY < -1.1) !== false) {\n $ERROR('#3: (+Infinity < -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#4: (+Infinity < -Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY < Number.MAX_VALUE) !== false) {\n $ERROR('#5: (+Infinity < Number.MAX_VALUE) === false');\n}\n\n//CHECK#6\nif ((Number.POSITIVE_INFINITY < Number.MIN_VALUE) !== false) {\n $ERROR('#6: (+Infinity < Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.1_A4.5"
},
{
"section": "11.8.1, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 < Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#1: (0 < +Infinity) === true');\n}\n\n//CHECK#2\nif ((1.1 < Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#2: (1.1 < +Infinity) === true');\n}\n\n//CHECK#3\nif ((-1.1 < Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#3: (-1.1 < +Infinity) === true');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY < Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: (-Infinity < +Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE < Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#5: (Number.MAX_VALUE < +Infinity) === true');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE < Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#6: (Number.MIN_VALUE < +Infinity) === true');\n}\n\n",
"id": "S11.8.1_A4.6"
},
{
"section": "11.8.1, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NEGATIVE_INFINITY < 0) !== true) {\n $ERROR('#1: (-Infinity < 0) === true');\n}\n\n//CHECK#2\nif ((Number.NEGATIVE_INFINITY < 1.1) !== true) {\n $ERROR('#2: (-Infinity < 1.1) === true');\n}\n\n//CHECK#3\nif ((Number.NEGATIVE_INFINITY < -1.1) !== true) {\n $ERROR('#3: (-Infinity < -1.1) === true');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY < Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: (-Infinity < +Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.NEGATIVE_INFINITY < Number.MAX_VALUE) !== true) {\n $ERROR('#5: (-Infinity < Number.MAX_VALUE) === true');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY < Number.MIN_VALUE) !== true) {\n $ERROR('#6: (-Infinity < Number.MIN_VALUE) === true');\n}\n\n",
"id": "S11.8.1_A4.7"
},
{
"section": "11.8.1, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#1: (0 < -Infinity) === false');\n}\n\n//CHECK#2\nif ((1.1 < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#2: (1.1 < -Infinity) === false');\n}\n\n//CHECK#3\nif ((-1.1 < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#3: (-1.1 < -Infinity) === false');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#4: (+Infinity < -Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#5: (Number.MAX_VALUE < -Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE < Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#6: (Number.MIN_VALUE < -Infinity) === false');\n}\n\n",
"id": "S11.8.1_A4.8"
},
{
"section": "11.8.1, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1.1 < 1) !== false) {\n $ERROR('#1: (1.1 < 1) === false');\n}\n\n//CHECK#2\nif ((1 < 1.1) !== true) {\n $ERROR('#2: (1 < 1.1) === true');\n}\n\n//CHECK#3\nif ((-1.1 < -1) !== true) {\n $ERROR('#3: (-1.1 < -1) === true');\n}\n\n//CHECK#4\nif ((-1 < -1.1) !== false) {\n $ERROR('#4: (-1 < -1.1) === false');\n}\n\n//CHECK#5\nif ((0 < 0.1) !== true) {\n $ERROR('#5: (0 < 0.1) === true');\n}\n\n//CHECK#6\nif ((-0.1 < 0) !== true) {\n $ERROR('#6: (-0.1 < 0) === true');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE/2 < Number.MAX_VALUE) !== true) {\n $ERROR('#7: (Number.MAX_VALUE/2 < Number.MAX_VALUE) === true');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE < Number.MIN_VALUE*2) !== true) {\n $ERROR('#8: (Number.MIN_VALUE < Number.MIN_VALUE*2) === true');\n}\n\n\n",
"id": "S11.8.1_A4.9"
}
]
}
}

View File

@ -0,0 +1,32 @@
{
"testCollection": {
"name": "11.8.2",
"numTests": 4,
"tests": [
{
"id": "11.8.2-1",
"path": "TestCases/chapter11/11.8/11.8.2/11.8.2-1.js",
"description": "11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: valueOf > valueOf",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n valueOf: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n valueOf: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return !(obj1 > obj2);\n }).call(this));\n"
},
{
"id": "11.8.2-2",
"path": "TestCases/chapter11/11.8/11.8.2/11.8.2-2.js",
"description": "11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: valueOf > toString",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n valueOf: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n toString: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return !(obj1 > obj2);\n }).call(this));\n"
},
{
"id": "11.8.2-3",
"path": "TestCases/chapter11/11.8/11.8.2/11.8.2-3.js",
"description": "11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: toString > valueOf",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n toString: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n valueOf: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return !(obj1 > obj2);\n }).call(this));\n"
},
{
"id": "11.8.2-4",
"path": "TestCases/chapter11/11.8/11.8.2/11.8.2-4.js",
"description": "11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: toString > toString",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n toString: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n toString: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return !(obj1 > obj2);\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,224 @@
{
"testCollection": {
"name": "11.8.2_The_Greater_than_Operator",
"numTests": 36,
"tests": [
{
"section": "11.8.2, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"0\\u0009>\\u00091\") !== false) {\n $ERROR('#1: 0\\\\u0009>\\\\u00091) === false');\n}\n\n//CHECK#2\nif (eval(\"0\\u000B>\\u000B1\") !== false) {\n $ERROR('#2: 0\\\\u000B>\\\\u000B1) === false'); \n}\n\n//CHECK#3\nif (eval(\"0\\u000C>\\u000C1\") !== false) {\n $ERROR('#3: (0\\\\u000C>\\\\u000C1) === false');\n}\n\n//CHECK#4\nif (eval(\"0\\u0020>\\u00201\") !== false) {\n $ERROR('#4: (0\\\\u0020>\\\\u00201) === false');\n}\n\n//CHECK#5\nif (eval(\"0\\u00A0>\\u00A01\") !== false) {\n $ERROR('#5: (0\\\\u00A0>\\\\u00A01) === false');\n}\n\n//CHECK#6\nif (eval(\"0\\u000A>\\u000A1\") !== false) {\n $ERROR('#6: (0\\\\u000A>\\\\u000A1) === false'); \n}\n\n//CHECK#7\nif (eval(\"0\\u000D>\\u000D1\") !== false) {\n $ERROR('#7: (0\\\\u000D>\\\\u000D1) === false');\n}\n\n//CHECK#8\nif (eval(\"0\\u2028>\\u20281\") !== false) {\n $ERROR('#8: (0\\\\u2028>\\\\u20281) === false');\n}\n\n//CHECK#9\nif (eval(\"0\\u2029>\\u20291\") !== false) {\n $ERROR('#9: (0\\\\u2029>\\\\u20291) === false');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029>=\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== true) {\n $ERROR('#10: (1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029>=\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === true');\n}\n",
"id": "S11.8.2_A1"
},
{
"section": "11.8.2, 11.8.5",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (2 > 1 !== true) {\n $ERROR('#1: 2 > 1 === true');\n}\n\n//CHECK#2\nvar x = 2;\nif (x > 1 !== true) {\n $ERROR('#2: var x = 2; x > 1 === true');\n}\n\n//CHECK#3\nvar y = 1;\nif (2 > y !== true) {\n $ERROR('#3: var y = 1; 2 > y === true');\n}\n\n//CHECK#4\nvar x = 2;\nvar y = 1;\nif (x > y !== true) {\n $ERROR('#4: var x = 2; var y = 1; x > y === true');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 2;\nobjecty.prop = 1;\nif (objectx.prop > objecty.prop !== true) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 2; objecty.prop = 1; objectx.prop > objecty.prop === true');\n}\n",
"id": "S11.8.2_A2.1_T1"
},
{
"section": "11.8.2, 11.8.5",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x > 1;\n $ERROR('#1.1: x > 1 throw ReferenceError. Actual: ' + (x > 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x > 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.8.2_A2.1_T2"
},
{
"section": "11.8.2, 11.8.5",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 > y;\n $ERROR('#1.1: 1 > y throw ReferenceError. Actual: ' + (1 > y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 > y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.8.2_A2.1_T3"
},
{
"section": "11.8.2, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 2}} > 1 !== true) {\n $ERROR('#1: {valueOf: function() {return 1}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}} > 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 2}, toString: function() {return 0}} > 1 !== true) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 2}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 2}} > 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 2}, toString: function() {return {}}} > 1 !== true) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} > 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 2}, toString: function() {throw \"error\"}} > 1 !== true) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} > 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 2}, toString: function() {throw \"error\"}} > 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 2}, toString: function() {throw \"error\"}} > 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 > {toString: function() {return 0}} !== true) {\n $ERROR('#5: 1 > {toString: function() {return 0}} === true. Actual: ' + (1 > {toString: function() {return 0}}));\n}\n\n//CHECK#6\nif (1 > {valueOf: function() {return {}}, toString: function() {return 0}} !== true) {\n $ERROR('#6: 1 > {valueOf: function() {return {}}, toString: function() {return 0}} === true. Actual: ' + (1 > {valueOf: function() {return {}}, toString: function() {return 0}}));\n}\n\n//CHECK#7\ntry {\n 1 > {valueOf: function() {throw \"error\"}, toString: function() {return 0}};\n $ERROR('#7.1: 1 > {valueOf: function() {throw \"error\"}, toString: function() {return 0}} throw \"error\". Actual: ' + (1 > {valueOf: function() {throw \"error\"}, toString: function() {return 0}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 > {valueOf: function() {throw \"error\"}, toString: function() {return 0}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 > {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 > {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 > {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 > {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.8.2_A2.2_T1"
},
{
"section": "11.8.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x > y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x > y throw \"y\". Actual: ' + (x > y));\n} catch (e) {\n if (e === \"x\") {\n $ERROR('#1.2: ToNumber(second expression) is called first, and then ToNumber(first expression)');\n } else {\n if (e !== \"y\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x > y throw \"y\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.2_A2.3_T1"
},
{
"section": "11.8.2",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) > x !== false) {\n $ERROR('#1: var x = 0; (x = 1) > x === false');\n}\n\n//CHECK#2\nvar x = 1; \nif (x > (x = 0) !== true) {\n $ERROR('#2: var x = 1; x > (x = 0) === true');\n}\n\n",
"id": "S11.8.2_A2.4_T1"
},
{
"section": "11.8.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() > y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() > y() throw \"x\". Actual: ' + (x() > y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() > y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.2_A2.4_T2"
},
{
"section": "11.8.2",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x > (x = 1);\n $ERROR('#1.1: x > (x = 1) throw ReferenceError. Actual: ' + (x > (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x > (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) > y !== false) {\n $ERROR('#2: (y = 1) > y === false');\n}\n\n",
"id": "S11.8.2_A2.4_T3"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true > true !== false) {\n $ERROR('#1: true > true === false');\n}\n\n//CHECK#2\nif (new Boolean(true) > true !== false) {\n $ERROR('#2: new Boolean(true) > true === false');\n}\n\n//CHECK#3\nif (true > new Boolean(true) !== false) {\n $ERROR('#3: true > new Boolean(true) === false');\n}\n\n//CHECK#4\nif (new Boolean(true) > new Boolean(true) !== false) {\n $ERROR('#4: new Boolean(true) > new Boolean(true) === false');\n}\n",
"id": "S11.8.2_A3.1_T1.1"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 > 1 !== false) {\n $ERROR('#1: 1 > 1 === false');\n}\n\n//CHECK#2\nif (new Number(1) > 1 !== false) {\n $ERROR('#2: new Number(1) > 1 === false');\n}\n\n//CHECK#3\nif (1 > new Number(1) !== false) {\n $ERROR('#3: 1 > new Number(1) === false');\n}\n\n//CHECK#4\nif (new Number(1) > new Number(1) !== false) {\n $ERROR('#4: new Number(1) > new Number(1) === false');\n}\n\n",
"id": "S11.8.2_A3.1_T1.2"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined",
"test": "//CHECK#1\nif (null > undefined !== false) {\n $ERROR('#1: null > undefined === false');\n}\n\n//CHECK#2\nif (undefined > null !== false) {\n $ERROR('#2: undefined > null === false');\n}\n\n//CHECK#3\nif (undefined > undefined !== false) {\n $ERROR('#3: undefined > undefined === false');\n}\n\n//CHECK#4\nif (null > null !== false) {\n $ERROR('#4: null > null === false');\n}\n",
"id": "S11.8.2_A3.1_T1.3"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true > 1 !== false) {\n $ERROR('#1: true > 1 === false');\n}\n\n//CHECK#2\nif (1 > true !== false) {\n $ERROR('#2: 1 > true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) > 1 !== false) {\n $ERROR('#3: new Boolean(true) > 1 === false');\n}\n\n//CHECK#4\nif (1 > new Boolean(true) !== false) {\n $ERROR('#4: 1 > new Boolean(true) === false');\n}\n\n//CHECK#5\nif (true > new Number(1) !== false) {\n $ERROR('#5: true > new Number(1) === false');\n}\n\n//CHECK#6\nif (new Number(1) > true !== false) {\n $ERROR('#6: new Number(1) > true === false');\n}\n\n//CHECK#7\nif (new Boolean(true) > new Number(1) !== false) {\n $ERROR('#7: new Boolean(true) > new Number(1) === false');\n}\n\n//CHECK#8\nif (new Number(1) > new Boolean(true) !== false) {\n $ERROR('#8: new Number(1) > new Boolean(true) === false');\n}\n",
"id": "S11.8.2_A3.1_T2.1"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" > 1 !== false) {\n $ERROR('#1: \"1\" > 1 === false');\n}\n\n//CHECK#2\nif (1 > \"1\" !== false) {\n $ERROR('#2: 1 > \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") > 1 !== false) {\n $ERROR('#3: new String(\"1\") > 1 === false');\n}\n\n//CHECK#4\nif (1 > new String(\"1\") !== false) {\n $ERROR('#4: 1 > new String(\"1\") === false');\n}\n\n//CHECK#5\nif (\"1\" > new Number(1) !== false) {\n $ERROR('#5: \"1\" > new Number(1) === false');\n}\n\n//CHECK#6\nif (new Number(1) > \"1\" !== false) {\n $ERROR('#6: new Number(1) > \"1\" === false');\n}\n\n//CHECK#7\nif (new String(\"1\") > new Number(1) !== false) {\n $ERROR('#7: new String(\"1\") > new Number(1) === false');\n}\n\n//CHECK#8\nif (new Number(1) > new String(\"1\") !== false) {\n $ERROR('#8: new Number(1) > new String(\"1\") === false');\n}\n\n//CHECK#9\nif (\"x\" > 1 !== false) {\n $ERROR('#9: \"x\" > 1 === false');\n}\n\n//CHECK#10\nif (1 > \"x\" !== false) {\n $ERROR('#10: 1 > \"x\" === false');\n}\n",
"id": "S11.8.2_A3.1_T2.2"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 > null !== true) {\n $ERROR('#1: 1 > null === true');\n}\n\n//CHECK#2\nif (null > 1 !== false) {\n $ERROR('#2: null > 1 === false');\n}\n\n//CHECK#3\nif (new Number(1) > null !== true) {\n $ERROR('#3: new Number(1) > null === true');\n}\n\n//CHECK#4\nif (null > new Number(1) !== false) {\n $ERROR('#4: null > new Number(1) === false');\n}\n",
"id": "S11.8.2_A3.1_T2.3"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (1 > undefined !== false) {\n $ERROR('#1: 1 > undefined === false');\n}\n\n//CHECK#2\nif (undefined > 1 !== false) {\n $ERROR('#2: undefined > 1 === false');\n}\n\n//CHECK#3\nif (new Number(1) > undefined !== false) {\n $ERROR('#3: new Number(1) > undefined === false');\n}\n\n//CHECK#4\nif (undefined > new Number(1) !== false) {\n $ERROR('#4: undefined > new Number(1) === false');\n}\n",
"id": "S11.8.2_A3.1_T2.4"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true > \"1\" !== false) {\n $ERROR('#1: true > \"1\" === false');\n}\n\n//CHECK#2\nif (\"1\" > true !== false) {\n $ERROR('#2: \"1\" > true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) > \"1\" !== false) {\n $ERROR('#3: new Boolean(true) > \"1\" === false');\n}\n\n//CHECK#4\nif (\"1\" > new Boolean(true) !== false) {\n $ERROR('#4: \"1\" > new Boolean(true) === false');\n}\n\n//CHECK#5\nif (true > new String(\"1\") !== false) {\n $ERROR('#5: true > new String(\"1\") === false');\n}\n\n//CHECK#6\nif (new String(\"1\") > true !== false) {\n $ERROR('#6: new String(\"1\") > true === false');\n}\n\n//CHECK#7\nif (new Boolean(true) > new String(\"1\") !== false) {\n $ERROR('#7: new Boolean(true) > new String(\"1\") === false');\n}\n\n//CHECK#8\nif (new String(\"1\") > new Boolean(true) !== false) {\n $ERROR('#8: new String(\"1\") > new Boolean(true) === false');\n}\n",
"id": "S11.8.2_A3.1_T2.5"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (\"1\" > undefined !== false) {\n $ERROR('#1: \"1\" > undefined === false');\n}\n\n//CHECK#2\nif (undefined > \"1\" !== false) {\n $ERROR('#2: undefined > \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") > undefined !== false) {\n $ERROR('#3: new String(\"1\") > undefined === false');\n}\n\n//CHECK#4\nif (undefined > new String(\"1\") !== false) {\n $ERROR('#4: undefined > new String(\"1\") === false');\n}\n",
"id": "S11.8.2_A3.1_T2.6"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" > null !== true) {\n $ERROR('#1: \"1\" > null === true');\n}\n\n//CHECK#2\nif (null > \"1\" !== false) {\n $ERROR('#2: null > \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") > null !== true) {\n $ERROR('#3: new String(\"1\") > null === true');\n}\n\n//CHECK#4\nif (null > new String(\"1\") !== false) {\n $ERROR('#4: null > new String(\"1\") === false');\n}\n",
"id": "S11.8.2_A3.1_T2.7"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (true > undefined !== false) {\n $ERROR('#1: true > undefined === false');\n}\n\n//CHECK#2\nif (undefined > true !== false) {\n $ERROR('#2: undefined > true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) > undefined !== false) {\n $ERROR('#3: new Boolean(true) > undefined === false');\n}\n\n//CHECK#4\nif (undefined > new Boolean(true) !== false) {\n $ERROR('#4: undefined > new Boolean(true) === false');\n}\n",
"id": "S11.8.2_A3.1_T2.8"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true > null !== true) {\n $ERROR('#1: true > null === true');\n}\n\n//CHECK#2\nif (null > true !== false) {\n $ERROR('#2: null > true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) > null !== true) {\n $ERROR('#3: new Boolean(true) > null === true');\n}\n\n//CHECK#4\nif (null > new Boolean(true) !== false) {\n $ERROR('#4: null > new Boolean(true) === false');\n}\n",
"id": "S11.8.2_A3.1_T2.9"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" > \"1\" !== false) {\n $ERROR('#1: \"1\" > \"1\" === false');\n}\n\n//CHECK#2\nif (new String(\"1\") > \"1\" !== false) {\n $ERROR('#2: new String(\"1\") > \"1\" === false');\n}\n\n//CHECK#3\nif (\"1\" > new String(\"1\") !== false) {\n $ERROR('#3: \"1\" > new String(\"1\") === false');\n}\n\n//CHECK#4\nif (new String(\"1\") > new String(\"1\") !== false) {\n $ERROR('#4: new String(\"1\") > new String(\"1\") === false');\n}\n\n//CHECK#5\nif (\"x\" > \"1\" !== true) {\n $ERROR('#5: \"x\" > \"1\" === true');\n}\n\n//CHECK#6\nif (\"1\" > \"x\" !== false) {\n $ERROR('#6: \"1\" > \"x\" === false');\n}\n",
"id": "S11.8.2_A3.2_T1.1"
},
{
"section": "11.8.2",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object",
"test": "//CHECK#1\nif (({} > function(){return 1}) !== ({}.toString() > function(){return 1}.toString())) {\n $ERROR('#1: ({} > function(){return 1}) === ({}.toString() > function(){return 1}.toString())');\n}\n\n//CHECK#2\nif ((function(){return 1} > {}) !== (function(){return 1}.toString() > {}.toString())) {\n $ERROR('#2: (function(){return 1} > {}) === (function(){return 1}.toString() > {}.toString())');\n}\n\n//CHECK#3\nif ((function(){return 1} > function(){return 1}) !== (function(){return 1}.toString() > function(){return 1}.toString())) {\n $ERROR('#3: (function(){return 1} > function(){return 1}) === (function(){return 1}.toString() > function(){return 1}.toString())');\n}\n\n//CHECK#4\nif (({} > {}) !== ({}.toString() > {}.toString())) {\n $ERROR('#4: ({} > {}) === ({}.toString() > {}.toString())');\n}\n",
"id": "S11.8.2_A3.2_T1.2"
},
{
"section": "11.8.2, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NaN > 0) !== false) {\n $ERROR('#1: (NaN > 0) === false');\n}\n\n//CHECK#2\nif ((Number.NaN > 1.1) !== false) {\n $ERROR('#2: (NaN > 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.NaN > -1.1) !== false) {\n $ERROR('#3: (NaN > -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NaN > Number.NaN) !== false) {\n $ERROR('#4: (NaN > NaN) === false');\n}\n\n//CHECK#5\nif ((Number.NaN > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (NaN > +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.NaN > Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#6: (NaN > -Infinity) === false');\n}\n\n//CHECK#7\nif ((Number.NaN > Number.MAX_VALUE) !== false) {\n $ERROR('#7: (NaN > Number.MAX_VALUE) === false');\n}\n\n//CHECK#8\nif ((Number.NaN > Number.MIN_VALUE) !== false) {\n $ERROR('#8: (NaN > Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.2_A4.1"
},
{
"section": "11.8.2, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" > \"x\") !== false) {\n $ERROR('#1: (\"x\" > \"x\") === false');\n}\n\n//CHECK#2\nif ((\"\" > \"x\") !== false) {\n $ERROR('#2: (\"\" > \"x\") === false');\n}\n\n//CHECK#3\nif ((\"ab\" > \"abcd\") !== false) {\n $ERROR('#3: (\"ab\" > abcd\") === false');\n}\n\n//CHECK#4\nif ((\"abcd\" > \"abc\\u0064\") !== false) {\n $ERROR('#4: (\"abcd\" > abc\\\\u0064\") === false');\n}\n\n//CHECK#5\nif ((\"x\" > \"x\" + \"y\") !== false) {\n $ERROR('#5: (\"x\" > \"x\" + \"y\") === false');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x > x + \"y\") !== false) {\n $ERROR('#6: var x = \"x\"; (x > x + \"y\") === false');\n}\n",
"id": "S11.8.2_A4.10"
},
{
"section": "11.8.2, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x \" > \"x\") !== true) {\n $ERROR('#1: (\"x \" > \"x\") === true');\n}\n\n//CHECK#2\nif ((\"x\" > \"\") !== true) {\n $ERROR('#2: (\"x\" > \"\") === true');\n}\n\n//CHECK#3\nif ((\"abcd\" > \"ab\") !== true) {\n $ERROR('#3: (\"abcd\" > ab\") === true');\n}\n\n//CHECK#4\nif ((\"abc\\u0064\" > \"abcd\") !== false) {\n $ERROR('#4: (\"abc\\\\u0064\" > abc\") === false');\n}\n\n//CHECK#5\nif ((\"x\" + \"y\" > \"x\") !== true) {\n $ERROR('#5: (\"x\" + \"y\" > \"x\") === true');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x + 'y' > x) !== true) {\n $ERROR('#6: var x = \"x\"; (x + \"y\" > x) === true');\n}\n\n//CHECK#7\nif ((\"a\\u0000a\" > \"a\\u0000\") !== true) {\n $ERROR('#7: (\"a\\\\u0000a\" > \"a\\\\u0000\") === true');\n}\n\n//CHECK#8\nif ((\" x\" > \"x\") !== false) {\n $ERROR('#8: (\" x\" > \"x\") === false');\n}\n\n",
"id": "S11.8.2_A4.11"
},
{
"section": "11.8.2, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"xy\" > \"xx\") !== true) {\n $ERROR('#1: (\"xy\" > \"xx\") === true');\n}\n\n//CHECK#2\nif ((\"xx\" > \"xy\") !== false) {\n $ERROR('#2: (\"xx\" > \"xy\") === false');\n}\n\n//CHECK#3\nif ((\"y\" > \"x\") !== true) {\n $ERROR('#3: (\"y\" > \"x\") === true');\n}\n\n//CHECK#4\nif ((\"aba\" > \"aab\") !== true) {\n $ERROR('#4: (\"aba\" > aab\") === true');\n}\n\n//CHECK#5\nif ((\"\\u0061\\u0061\\u0061\\u0061\" > \"\\u0061\\u0061\\u0061\\u0062\") !== false) {\n $ERROR('#5: (\"\\\\u0061\\\\u0061\\\\u0061\\\\u0061\" > \\\\u0061\\\\u0061\\\\u0061\\\\u0062\") === false');\n}\n\n//CHECK#6\nif ((\"a\\u0000b\" > \"a\\u0000a\") !== true) {\n $ERROR('#6: (\"a\\\\u0000b\" > \"a\\\\u0000a\") === true');\n}\n\n//CHECK#7\nif ((\"aa\" > \"aB\") !== true) {\n $ERROR('#7: (\"aa\" > aB\") === true');\n}\n",
"id": "S11.8.2_A4.12_T1"
},
{
"section": "11.8.2, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" > \"0\") !== true) {\n $ERROR('#1: (\"x\" > \"0\") !== true');\n}\n\n//CHECK#2\nif ((\"0\" > \"-\") !== true) {\n $ERROR('#2: (\"0\" > \"-\") !== true');\n}\n\n//CHECK#3\nif ((\"0\" > \".\") !== true) {\n $ERROR('#3: (\"0\" > \".\") !== true');\n}\n\n//CHECK#4\nif ((\"-\" > \"+\") !== true) {\n $ERROR('#4: (\"-\" > \"+\") !== true');\n}\n\n//CHECK#5\nif ((\"-1\" > \"-0\") !== true) {\n $ERROR('#5: (\"-1\" > \"-0\") !== true');\n}\n\n//CHECK#6\nif ((\"-1\" > \"+1\") !== true) {\n $ERROR('#6: (\"-1\" > \"+1\") !== true');\n}\n\n//CHECK#7\nif ((\"1e-10\" > \"1\") !== true) {\n$ERROR('#7: (\"1e-10\" > \"1\") !== true');\n}\n",
"id": "S11.8.2_A4.12_T2"
},
{
"section": "11.8.2, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 > Number.NaN) !== false) {\n $ERROR('#1: (0 > NaN) === false');\n}\n\n//CHECK#2\nif ((1.1 > Number.NaN) !== false) {\n $ERROR('#2: (1.1 > NaN) === false');\n}\n\n//CHECK#3\nif ((-1.1 > Number.NaN) !== false) {\n $ERROR('#3: (-1.1 > NaN) === false');\n}\n\n//CHECK#4\nif ((Number.NaN > Number.NaN) !== false) {\n $ERROR('#4: (NaN > NaN) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY > Number.NaN) !== false) {\n $ERROR('#5: (+Infinity > NaN) === false');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY > Number.NaN) !== false) {\n $ERROR('#6: (-Infinity > NaN) === false');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE > Number.NaN) !== false) {\n $ERROR('#7: (Number.MAX_VALUE > NaN) === false');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE > Number.NaN) !== false) {\n $ERROR('#8: (Number.MIN_VALUE > NaN) === false');\n}\n\n",
"id": "S11.8.2_A4.2"
},
{
"section": "11.8.2, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1 > 1) !== false) {\n $ERROR('#1: (1 > 1) === false');\n}\n\n//CHECK#2\nif ((1.1 > 1.1) !== false) {\n $ERROR('#2: (1.1 > 1.1) === false');\n}\n\n//CHECK#3\nif ((-1.1 > -1.1) !== false) {\n $ERROR('#3: (-1.1 > -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY > Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#4: (-Infinity > -Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (+Infinity > +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.MAX_VALUE > Number.MAX_VALUE) !== false) {\n $ERROR('#6: (Number.MAX_VALUE > Number.MAX_VALUE) === false');\n}\n\n//CHECK#7\nif ((Number.MIN_VALUE > Number.MIN_VALUE) !== false) {\n $ERROR('#7: (Number.MIN_VALUE > Number.MIN_VALUE) === false');\n}\n\n\n",
"id": "S11.8.2_A4.3"
},
{
"section": "11.8.2, 11.8.5",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((0 > 0) !== false) {\n $ERROR('#1: (0 > 0) === false');\n}\n\n//CHECK#2\nif ((-0 > -0) !== false) {\n $ERROR('#2: (-0 > -0) === false');\n}\n\n//CHECK#3\nif ((+0 > -0) !== false) {\n $ERROR('#3: (+0 > -0) === false');\n}\n\n//CHECK#4\nif ((-0 > +0) !== false) {\n $ERROR('#4: (-0 > +0) === false');\n}\n\n",
"id": "S11.8.2_A4.4"
},
{
"section": "11.8.2, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.POSITIVE_INFINITY > 0) !== true) {\n $ERROR('#1: (+Infinity > 0) === true');\n}\n\n//CHECK#2\nif ((Number.POSITIVE_INFINITY > 1.1) !== true) {\n $ERROR('#2: (+Infinity > 1.1) === true');\n}\n\n//CHECK#3\nif ((Number.POSITIVE_INFINITY > -1.1) !== true) {\n $ERROR('#3: (+Infinity > -1.1) === true');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY > Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: (+Infinity > -Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY > Number.MAX_VALUE) !== true) {\n $ERROR('#5: (+Infinity > Number.MAX_VALUE) === true');\n}\n\n//CHECK#6\nif ((Number.POSITIVE_INFINITY > Number.MIN_VALUE) !== true) {\n $ERROR('#6: (+Infinity > Number.MIN_VALUE) === true');\n}\n\n",
"id": "S11.8.2_A4.5"
},
{
"section": "11.8.2, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#1: (0 > +Infinity) === false');\n}\n\n//CHECK#2\nif ((1.1 > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#2: (1.1 > +Infinity) === false');\n}\n\n//CHECK#3\nif ((-1.1 > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#3: (-1.1 > +Infinity) === false');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#4: (-Infinity > +Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (Number.MAX_VALUE > +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#6: (Number.MIN_VALUE > +Infinity) === false');\n}\n\n",
"id": "S11.8.2_A4.6"
},
{
"section": "11.8.2, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NEGATIVE_INFINITY > 0) !== false) {\n $ERROR('#1: (-Infinity > 0) === false');\n}\n\n//CHECK#2\nif ((Number.NEGATIVE_INFINITY > 1.1) !== false) {\n $ERROR('#2: (-Infinity > 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.NEGATIVE_INFINITY > -1.1) !== false) {\n $ERROR('#3: (-Infinity > -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY > Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#4: (-Infinity > +Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.NEGATIVE_INFINITY > Number.MAX_VALUE) !== false) {\n $ERROR('#5: (-Infinity > Number.MAX_VALUE) === false');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY > Number.MIN_VALUE) !== false) {\n $ERROR('#6: (-Infinity > Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.2_A4.7"
},
{
"section": "11.8.2, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 > Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#1: (0 > -Infinity) === true');\n}\n\n//CHECK#2\nif ((1.1 > Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#2: (1.1 > -Infinity) === true');\n}\n\n//CHECK#3\nif ((-1.1 > Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#3: (-1.1 > -Infinity) === true');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY > Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: (+Infinity > -Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE > Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#5: (Number.MAX_VALUE > -Infinity) === true');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE > Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#6: (Number.MIN_VALUE > -Infinity) === true');\n}\n\n",
"id": "S11.8.2_A4.8"
},
{
"section": "11.8.2, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1 > 1.1) !== false) {\n $ERROR('#1: (1 > 1.1) === false');\n}\n\n//CHECK#2\nif ((1.1 > 1) !== true) {\n $ERROR('#2: (1.1 > 1) === true');\n}\n\n//CHECK#3\nif ((-1 > -1.1) !== true) {\n $ERROR('#3: (-1 > -1.1) === true');\n}\n\n//CHECK#4\nif ((-1.1 > -1) !== false) {\n $ERROR('#4: (-1.1 > -1) === false');\n}\n\n//CHECK#5\nif ((0.1 > 0) !== true) {\n $ERROR('#5: (0.1 > 0) === true');\n}\n\n//CHECK#6\nif ((0 > -0.1) !== true) {\n $ERROR('#6: (0 > -0.1) === true');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE > Number.MAX_VALUE/2) !== true) {\n $ERROR('#7: (Number.MAX_VALUE > Number.MAX_VALUE/2) === true');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE*2 > Number.MIN_VALUE) !== true) {\n $ERROR('#8: (Number.MIN_VALUE*2 > Number.MIN_VALUE) === true');\n}\n\n\n",
"id": "S11.8.2_A4.9"
}
]
}
}

View File

@ -0,0 +1,38 @@
{
"testCollection": {
"name": "11.8.3",
"numTests": 5,
"tests": [
{
"id": "11.8.3-1",
"path": "TestCases/chapter11/11.8/11.8.3/11.8.3-1.js",
"description": "11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: valueOf <= valueOf",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n valueOf: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n valueOf: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return (obj1 <= obj2);\n }).call(this));\n"
},
{
"id": "11.8.3-2",
"path": "TestCases/chapter11/11.8/11.8.3/11.8.3-2.js",
"description": "11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: valueOf <= toString",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n valueOf: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n toString: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return (obj1 <= obj2);\n }).call(this));\n"
},
{
"id": "11.8.3-3",
"path": "TestCases/chapter11/11.8/11.8.3/11.8.3-3.js",
"description": "11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: toString <= valueOf",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n toString: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n valueOf: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return (obj1 <= obj2);\n }).call(this));\n"
},
{
"id": "11.8.3-4",
"path": "TestCases/chapter11/11.8/11.8.3/11.8.3-4.js",
"description": "11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: toString <= toString",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n toString: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n toString: function () {\n if (accessed === true) {\n return 4;\n } else {\n return 2;\n }\n }\n };\n return (obj1 <= obj2);\n }).call(this));\n"
},
{
"id": "11.8.3-5",
"path": "TestCases/chapter11/11.8/11.8.3/11.8.3-5.js",
"description": "11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: valueOf <= valueOf",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj1 = {\n valueOf: function () {\n accessed = true;\n return 3;\n }\n };\n var obj2 = {\n valueOf: function () {\n if (accessed === true) {\n return 3;\n } else {\n return 2;\n }\n }\n };\n return (obj1 <= obj2);\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,224 @@
{
"testCollection": {
"name": "11.8.3_The_Less_than_or_equal_Operator",
"numTests": 36,
"tests": [
{
"section": "11.8.3, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009<=\\u00091\") !== true) {\n $ERROR('#1: (1\\\\u0009<=\\\\u00091) === true');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B<=\\u000B1\") !== true) {\n $ERROR('#2: (1\\\\u000B<=\\\\u000B1) === true'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C<=\\u000C1\") !== true) {\n $ERROR('#3: (1\\\\u000C<=\\\\u000C1) === true');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020<=\\u00201\") !== true) {\n $ERROR('#4: (1\\\\u0020<=\\\\u00201) === true');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0<=\\u00A01\") !== true) {\n $ERROR('#5: (1\\\\u00A0<=\\\\u00A01) === true');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A<=\\u000A1\") !== true) {\n $ERROR('#6: (1\\\\u000A<=\\\\u000A1) === true'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D<=\\u000D1\") !== true) {\n $ERROR('#7: (1\\\\u000D<=\\\\u000D1) === true');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028<=\\u20281\") !== true) {\n $ERROR('#8: (1\\\\u2028<=\\\\u20281) === true');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029<=\\u20291\") !== true) {\n $ERROR('#9: (1\\\\u2029<=\\\\u20291) === true');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029>\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290\") !== true) {\n $ERROR('#10: (1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029>\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20290) === true');\n}\n",
"id": "S11.8.3_A1"
},
{
"section": "11.8.3, 11.8.5",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 <= 1 !== true) {\n $ERROR('#1: 1 <= 1 === true');\n}\n\n//CHECK#2\nvar x = 1;\nif (x <= 1 !== true) {\n $ERROR('#2: var x = 1; x <= 1 === true');\n}\n\n//CHECK#3\nvar y = 1;\nif (1 <= y !== true) {\n $ERROR('#3: var y = 1; 1 <= y === true');\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (x <= y !== true) {\n $ERROR('#4: var x = 1; var y = 1; x <= y === true');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (objectx.prop <= objecty.prop !== true) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop <= objecty.prop === true');\n}\n",
"id": "S11.8.3_A2.1_T1"
},
{
"section": "11.8.3, 11.8.5",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x <= 1;\n $ERROR('#1.1: x <= 1 throw ReferenceError. Actual: ' + (x <= 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x <= 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.8.3_A2.1_T2"
},
{
"section": "11.8.3, 11.8.5",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 <= y;\n $ERROR('#1.1: 1 <= y throw ReferenceError. Actual: ' + (1 <= y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 <= y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.8.3_A2.1_T3"
},
{
"section": "11.8.3, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 0}} <= 1 !== true) {\n $ERROR('#1: {valueOf: function() {return 1}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}} <= 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 0}, toString: function() {return 2}} <= 1 !== true) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} <= 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 0}, toString: function() {return {}}} <= 1 !== true) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} <= 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 0}, toString: function() {throw \"error\"}} <= 1 !== true) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} <= 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 0}, toString: function() {throw \"error\"}} <= 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 0}, toString: function() {throw \"error\"}} <= 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 <= {toString: function() {return 2}} !== true) {\n $ERROR('#5: 1 <= {toString: function() {return 2}} === true. Actual: ' + (1 <= {toString: function() {return 2}}));\n}\n\n//CHECK#6\nif (1 <= {valueOf: function() {return {}}, toString: function() {return 2}} !== true) {\n $ERROR('#6: 1 <= {valueOf: function() {return {}}, toString: function() {return 2}} === true. Actual: ' + (1 <= {valueOf: function() {return {}}, toString: function() {return 2}}));\n}\n\n//CHECK#7\ntry {\n 1 <= {valueOf: function() {throw \"error\"}, toString: function() {return 2}};\n $ERROR('#7.1: 1 <= {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (1 <= {valueOf: function() {throw \"error\"}, toString: function() {return 2}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 <= {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 <= {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 <= {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 <= {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 <= {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.8.3_A2.2_T1"
},
{
"section": "11.8.3",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x <= y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x <= y throw \"y\". Actual: ' + (x <= y));\n} catch (e) {\n if (e === \"x\") {\n $ERROR('#1.2: ToNumber(second expression) is called first, and then ToNumber(first expression)');\n } else {\n if (e !== \"y\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x <= y throw \"y\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.3_A2.3_T1"
},
{
"section": "11.8.3",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) <= x !== true) {\n $ERROR('#1: var x = 0; (x = 1) <= x === true');\n}\n\n//CHECK#2\nvar x = 1; \nif (x <= (x = 0) !== false) {\n $ERROR('#2: var x = 1; x <= (x = 0) === false');\n}\n\n",
"id": "S11.8.3_A2.4_T1"
},
{
"section": "11.8.3",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() <= y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() <= y() throw \"x\". Actual: ' + (x() <= y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() <= y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.3_A2.4_T2"
},
{
"section": "11.8.3",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x <= (x = 1);\n $ERROR('#1.1: x <= (x = 1) throw ReferenceError. Actual: ' + (x <= (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x <= (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) <= y !== true) {\n $ERROR('#2: (y = 1) <= y === true');\n}\n\n",
"id": "S11.8.3_A2.4_T3"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true <= true !== true) {\n $ERROR('#1: true <= true === true');\n}\n\n//CHECK#2\nif (new Boolean(true) <= true !== true) {\n $ERROR('#2: new Boolean(true) <= true === true');\n}\n\n//CHECK#3\nif (true <= new Boolean(true) !== true) {\n $ERROR('#3: true <= new Boolean(true) === true');\n}\n\n//CHECK#4\nif (new Boolean(true) <= new Boolean(true) !== true) {\n $ERROR('#4: new Boolean(true) <= new Boolean(true) === true');\n}\n",
"id": "S11.8.3_A3.1_T1.1"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 <= 1 !== true) {\n $ERROR('#1: 1 <= 1 === true');\n}\n\n//CHECK#2\nif (new Number(1) <= 1 !== true) {\n $ERROR('#2: new Number(1) <= 1 === true');\n}\n\n//CHECK#3\nif (1 <= new Number(1) !== true) {\n $ERROR('#3: 1 <= new Number(1) === true');\n}\n\n//CHECK#4\nif (new Number(1) <= new Number(1) !== true) {\n $ERROR('#4: new Number(1) <= new Number(1) === true');\n}\n\n",
"id": "S11.8.3_A3.1_T1.2"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined",
"test": "//CHECK#1\nif (null <= undefined !== false) {\n $ERROR('#1: null <= undefined === false');\n}\n\n//CHECK#2\nif (undefined <= null !== false) {\n $ERROR('#2: undefined <= null === false');\n}\n\n//CHECK#3\nif (undefined <= undefined !== false) {\n $ERROR('#3: undefined <= undefined === false');\n}\n\n//CHECK#4\nif (null <= null !== true) {\n $ERROR('#4: null <= null === true');\n}\n",
"id": "S11.8.3_A3.1_T1.3"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true <= 1 !== true) {\n $ERROR('#1: true <= 1 === true');\n}\n\n//CHECK#2\nif (1 <= true !== true) {\n $ERROR('#2: 1 <= true === true');\n}\n\n//CHECK#3\nif (new Boolean(true) <= 1 !== true) {\n $ERROR('#3: new Boolean(true) <= 1 === true');\n}\n\n//CHECK#4\nif (1 <= new Boolean(true) !== true) {\n $ERROR('#4: 1 <= new Boolean(true) === true');\n}\n\n//CHECK#5\nif (true <= new Number(1) !== true) {\n $ERROR('#5: true <= new Number(1) === true');\n}\n\n//CHECK#6\nif (new Number(1) <= true !== true) {\n $ERROR('#6: new Number(1) <= true === true');\n}\n\n//CHECK#7\nif (new Boolean(true) <= new Number(1) !== true) {\n $ERROR('#7: new Boolean(true) <= new Number(1) === true');\n}\n\n//CHECK#8\nif (new Number(1) <= new Boolean(true) !== true) {\n $ERROR('#8: new Number(1) <= new Boolean(true) === true');\n}\n",
"id": "S11.8.3_A3.1_T2.1"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" <= 1 !== true) {\n $ERROR('#1: \"1\" <= 1 === true');\n}\n\n//CHECK#2\nif (1 <= \"1\" !== true) {\n $ERROR('#2: 1 <= \"1\" === true');\n}\n\n//CHECK#3\nif (new String(\"1\") <= 1 !== true) {\n $ERROR('#3: new String(\"1\") <= 1 === true');\n}\n\n//CHECK#4\nif (1 <= new String(\"1\") !== true) {\n $ERROR('#4: 1 <= new String(\"1\") === true');\n}\n\n//CHECK#5\nif (\"1\" <= new Number(1) !== true) {\n $ERROR('#5: \"1\" <= new Number(1) === true');\n}\n\n//CHECK#6\nif (new Number(1) <= \"1\" !== true) {\n $ERROR('#6: new Number(1) <= \"1\" === true');\n}\n\n//CHECK#7\nif (new String(\"1\") <= new Number(1) !== true) {\n $ERROR('#7: new String(\"1\") <= new Number(1) === true');\n}\n\n//CHECK#8\nif (new Number(1) <= new String(\"1\") !== true) {\n $ERROR('#8: new Number(1) <= new String(\"1\") === true');\n}\n\n//CHECK#9\nif (\"x\" <= 1 !== false) {\n $ERROR('#9: \"x\" <= 1 === false');\n}\n\n//CHECK#10\nif (1 <= \"x\" !== false) {\n $ERROR('#10: 1 <= \"x\" === false');\n}\n",
"id": "S11.8.3_A3.1_T2.2"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 <= null !== false) {\n $ERROR('#1: 1 <= null === false');\n}\n\n//CHECK#2\nif (null <= 1 !== true) {\n $ERROR('#2: null <= 1 === true');\n}\n\n//CHECK#3\nif (new Number(1) <= null !== false) {\n $ERROR('#3: new Number(1) <= null === false');\n}\n\n//CHECK#4\nif (null <= new Number(1) !== true) {\n $ERROR('#4: null <= new Number(1) === true');\n}\n",
"id": "S11.8.3_A3.1_T2.3"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (1 <= undefined !== false) {\n $ERROR('#1: 1 <= undefined === false');\n}\n\n//CHECK#2\nif (undefined <= 1 !== false) {\n $ERROR('#2: undefined <= 1 === false');\n}\n\n//CHECK#3\nif (new Number(1) <= undefined !== false) {\n $ERROR('#3: new Number(1) <= undefined === false');\n}\n\n//CHECK#4\nif (undefined <= new Number(1) !== false) {\n $ERROR('#4: undefined <= new Number(1) === false');\n}\n",
"id": "S11.8.3_A3.1_T2.4"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true <= \"1\" !== true) {\n $ERROR('#1: true <= \"1\" === true');\n}\n\n//CHECK#2\nif (\"1\" <= true !== true) {\n $ERROR('#2: \"1\" <= true === true');\n}\n\n//CHECK#3\nif (new Boolean(true) <= \"1\" !== true) {\n $ERROR('#3: new Boolean(true) <= \"1\" === true');\n}\n\n//CHECK#4\nif (\"1\" <= new Boolean(true) !== true) {\n $ERROR('#4: \"1\" <= new Boolean(true) === true');\n}\n\n//CHECK#5\nif (true <= new String(\"1\") !== true) {\n $ERROR('#5: true <= new String(\"1\") === true');\n}\n\n//CHECK#6\nif (new String(\"1\") <= true !== true) {\n $ERROR('#6: new String(\"1\") <= true === true');\n}\n\n//CHECK#7\nif (new Boolean(true) <= new String(\"1\") !== true) {\n $ERROR('#7: new Boolean(true) <= new String(\"1\") === true');\n}\n\n//CHECK#8\nif (new String(\"1\") <= new Boolean(true) !== true) {\n $ERROR('#8: new String(\"1\") <= new Boolean(true) === true');\n}\n",
"id": "S11.8.3_A3.1_T2.5"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (\"1\" <= undefined !== false) {\n $ERROR('#1: \"1\" <= undefined === false');\n}\n\n//CHECK#2\nif (undefined <= \"1\" !== false) {\n $ERROR('#2: undefined <= \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") <= undefined !== false) {\n $ERROR('#3: new String(\"1\") <= undefined === false');\n}\n\n//CHECK#4\nif (undefined <= new String(\"1\") !== false) {\n $ERROR('#4: undefined <= new String(\"1\") === false');\n}\n",
"id": "S11.8.3_A3.1_T2.6"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" <= null !== false) {\n $ERROR('#1: \"1\" <= null === false');\n}\n\n//CHECK#2\nif (null <= \"1\" !== true) {\n $ERROR('#2: null <= \"1\" === true');\n}\n\n//CHECK#3\nif (new String(\"1\") <= null !== false) {\n $ERROR('#3: new String(\"1\") <= null === false');\n}\n\n//CHECK#4\nif (null <= new String(\"1\") !== true) {\n $ERROR('#4: null <= new String(\"1\") === true');\n}\n",
"id": "S11.8.3_A3.1_T2.7"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (true <= undefined !== false) {\n $ERROR('#1: true <= undefined === false');\n}\n\n//CHECK#2\nif (undefined <= true !== false) {\n $ERROR('#2: undefined <= true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) <= undefined !== false) {\n $ERROR('#3: new Boolean(true) <= undefined === false');\n}\n\n//CHECK#4\nif (undefined <= new Boolean(true) !== false) {\n $ERROR('#4: undefined <= new Boolean(true) === false');\n}\n",
"id": "S11.8.3_A3.1_T2.8"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true <= null !== false) {\n $ERROR('#1: true <= null === false');\n}\n\n//CHECK#2\nif (null <= true !== true) {\n $ERROR('#2: null <= true === true');\n}\n\n//CHECK#3\nif (new Boolean(true) <= null !== false) {\n $ERROR('#3: new Boolean(true) <= null === false');\n}\n\n//CHECK#4\nif (null <= new Boolean(true) !== true) {\n $ERROR('#4: null <= new Boolean(true) === true');\n}\n",
"id": "S11.8.3_A3.1_T2.9"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" <= \"1\" !== true) {\n $ERROR('#1: \"1\" <= \"1\" === true');\n}\n\n//CHECK#2\nif (new String(\"1\") <= \"1\" !== true) {\n $ERROR('#2: new String(\"1\") <= \"1\" === true');\n}\n\n//CHECK#3\nif (\"1\" <= new String(\"1\") !== true) {\n $ERROR('#3: \"1\" <= new String(\"1\") === true');\n}\n\n//CHECK#4\nif (new String(\"1\") <= new String(\"1\") !== true) {\n $ERROR('#4: new String(\"1\") <= new String(\"1\") === true');\n}\n\n//CHECK#5\nif (\"x\" <= \"1\" !== false) {\n $ERROR('#5: \"x\" <= \"1\" === false');\n}\n\n//CHECK#6\nif (\"1\" <= \"x\" !== true) {\n $ERROR('#6: \"1\" <= \"x\" === true');\n}\n",
"id": "S11.8.3_A3.2_T1.1"
},
{
"section": "11.8.3",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object",
"test": "//CHECK#1\nif (({} <= function(){return 1}) !== ({}.toString() <= function(){return 1}.toString())) {\n $ERROR('#1: ({} <= function(){return 1}) === ({}.toString() <= function(){return 1}.toString())');\n}\n\n//CHECK#2\nif ((function(){return 1} <= {}) !== (function(){return 1}.toString() <= {}.toString())) {\n $ERROR('#2: (function(){return 1} <= {}) === (function(){return 1}.toString() <= {}.toString())');\n}\n\n//CHECK#3\nif ((function(){return 1} <= function(){return 1}) !== (function(){return 1}.toString() <= function(){return 1}.toString())) {\n $ERROR('#3: (function(){return 1} <= function(){return 1}) === (function(){return 1}.toString() <= function(){return 1}.toString())');\n}\n\n//CHECK#4\nif (({} <= {}) !== ({}.toString() <= {}.toString())) {\n $ERROR('#4: ({} <= {}) === ({}.toString() <= {}.toString())');\n}\n",
"id": "S11.8.3_A3.2_T1.2"
},
{
"section": "11.8.3, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NaN <= 0) !== false) {\n $ERROR('#1: (NaN <= 0) === false');\n}\n\n//CHECK#2\nif ((Number.NaN <= 1.1) !== false) {\n $ERROR('#2: (NaN <= 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.NaN <= -1.1) !== false) {\n $ERROR('#3: (NaN <= -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NaN <= Number.NaN) !== false) {\n $ERROR('#4: (NaN <= NaN) === false');\n}\n\n//CHECK#5\nif ((Number.NaN <= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (NaN <= +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.NaN <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#6: (NaN <= -Infinity) === false');\n}\n\n//CHECK#7\nif ((Number.NaN <= Number.MAX_VALUE) !== false) {\n $ERROR('#7: (NaN <= Number.MAX_VALUE) === false');\n}\n\n//CHECK#8\nif ((Number.NaN <= Number.MIN_VALUE) !== false) {\n $ERROR('#8: (NaN <= Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.3_A4.1"
},
{
"section": "11.8.3, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x \" <= \"x\") !== false) {\n $ERROR('#1: (\"x \" <= \"x\") === false');\n}\n\n//CHECK#2\nif ((\"x\" <= \"\") !== false) {\n $ERROR('#2: (\"x\" <= \"\") === false');\n}\n\n//CHECK#3\nif ((\"abcd\" <= \"ab\") !== false) {\n $ERROR('#3: (\"abcd\" <= ab\") === false');\n}\n\n//CHECK#4\nif ((\"abc\\u0064\" <= \"abcd\") !== true) {\n $ERROR('#4: (\"abc\\\\u0064\" <= abcd\") === true');\n}\n\n//CHECK#5\nif ((\"x\" + \"y\" <= \"x\") !== false) {\n $ERROR('#5: (\"x\" + \"y\" <= \"x\") === false');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x + 'y' <= x) !== false) {\n $ERROR('#6: var x = \"x\"; (x + \"y\" <= x) === false');\n}\n\n",
"id": "S11.8.3_A4.10"
},
{
"section": "11.8.3, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" <= \"x\") !== true) {\n $ERROR('#1: (\"x\" <= \"x\") === true');\n}\n\n//CHECK#2\nif ((\"\" <= \"x\") !== true) {\n $ERROR('#2: (\"\" <= \"x\") === true');\n}\n\n//CHECK#3\nif ((\"ab\" <= \"abcd\") !== true) {\n $ERROR('#3: (\"ab\" <= abcd\") === true');\n}\n\n//CHECK#4\nif ((\"abcd\" <= \"abc\\u0064\") !== true) {\n $ERROR('#4: (\"abcd\" <= abc\\\\u0064\") === true');\n}\n\n//CHECK#5\nif ((\"x\" <= \"x\" + \"y\") !== true) {\n $ERROR('#5: (\"x\" <= \"x\" + \"y\") === true');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x <= x + \"y\") !== true) {\n $ERROR('#6: var x = \"x\"; (x <= x + \"y\") === true');\n}\n\n//CHECK#7\nif ((\"a\\u0000\" <= \"a\\u0000a\") !== true) {\n $ERROR('#7: (\"a\\\\u0000\" <= \"a\\\\u0000a\") === true');\n}\n\n//CHECK#8\nif ((\"x\" <= \" x\") !== false) {\n $ERROR('#8: (\"x\" <= \" x\") === false');\n}\n\n\n",
"id": "S11.8.3_A4.11"
},
{
"section": "11.8.3, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"xx\" <= \"xy\") !== true) {\n $ERROR('#1: (\"xx\" <= \"xy\") === true');\n}\n\n//CHECK#2\nif ((\"xy\" <= \"xx\") !== false) {\n $ERROR('#2: (\"xy\" <= \"xx\") === false');\n}\n\n//CHECK#3\nif ((\"x\" <= \"y\") !== true) {\n $ERROR('#3: (\"x\" <= y\") === true');\n}\n\n//CHECK#4\nif ((\"aab\" <= \"aba\") !== true) {\n $ERROR('#4: (\"aab\" <= aba\") === true');\n}\n\n//CHECK#5\nif ((\"\\u0061\\u0061\\u0061\\u0062\" <= \"\\u0061\\u0061\\u0061\\u0061\") !== false) {\n $ERROR('#5: (\"\\\\u0061\\\\u0061\\\\u0061\\\\u0062\" <= \\\\u0061\\\\u0061\\\\u0061\\\\u0061\") === false');\n}\n\n//CHECK#6\nif ((\"a\\u0000a\" <= \"a\\u0000b\") !== true) {\n $ERROR('#6: (\"a\\\\u0000a\" <= \"a\\\\u0000b\") === true');\n}\n\n//CHECK#7\nif ((\"aB\" <= \"aa\") !== true) {\n $ERROR('#7: (\"aB\" <= aa\") === true');\n}\n",
"id": "S11.8.3_A4.12_T1"
},
{
"section": "11.8.3, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"0\" <= \"x\") !== true) {\n $ERROR('#1: (\"0\" <= \"x\") !== true');\n}\n\n//CHECK#2\nif ((\"-\" <= \"0\") !== true) {\n $ERROR('#2: (\"-\" <= \"0\") !== true');\n}\n\n//CHECK#3\nif ((\".\" <= \"0\") !== true) {\n $ERROR('#3: (\".\" <= \"0\") !== true');\n}\n\n//CHECK#4\nif ((\"+\" <= \"-\") !== true) {\n $ERROR('#4: (\"+\" <= \"-\") !== true');\n}\n\n//CHECK#5\nif ((\"-0\" <= \"-1\") !== true) {\n $ERROR('#5: (\"-0\" <= \"-1\") !== true');\n}\n\n//CHECK#6\nif ((\"+1\" <= \"-1\") !== true) {\n $ERROR('#6: (\"+1\" <= \"-1\") !== true');\n}\n\n//CHECK#7\nif ((\"1\" <= \"1e-10\") !== true) {\n$ERROR('#7: (\"1\" <= \"1e-10\") !== true');\n}\n",
"id": "S11.8.3_A4.12_T2"
},
{
"section": "11.8.3, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 <= Number.NaN) !== false) {\n $ERROR('#1: (0 <= NaN) === false');\n}\n\n//CHECK#2\nif ((1.1 <= Number.NaN) !== false) {\n $ERROR('#2: (1.1 <= NaN) === false');\n}\n\n//CHECK#3\nif ((-1.1 <= Number.NaN) !== false) {\n $ERROR('#3: (-1.1 <= NaN) === false');\n}\n\n//CHECK#4\nif ((Number.NaN <= Number.NaN) !== false) {\n $ERROR('#4: (NaN <= NaN) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY <= Number.NaN) !== false) {\n $ERROR('#5: (+Infinity <= NaN) === false');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY <= Number.NaN) !== false) {\n $ERROR('#6: (-Infinity <= NaN) === false');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE <= Number.NaN) !== false) {\n $ERROR('#7: (Number.MAX_VALUE <= NaN) === false');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE <= Number.NaN) !== false) {\n $ERROR('#8: (Number.MIN_VALUE <= NaN) === false');\n}\n\n",
"id": "S11.8.3_A4.2"
},
{
"section": "11.8.3, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1 <= 1) !== true) {\n $ERROR('#1: (1 <= 1) === true');\n}\n\n//CHECK#2\nif ((1.1 <= 1.1) !== true) {\n $ERROR('#2: (1.1 <= 1.1) === true');\n}\n\n//CHECK#3\nif ((-1.1 <= -1.1) !== true) {\n $ERROR('#3: (-1.1 <= -1.1) === true');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY <= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: (-Infinity <= -Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#5: (+Infinity <= +Infinity) === true');\n}\n\n//CHECK#6\nif ((Number.MAX_VALUE <= Number.MAX_VALUE) !== true) {\n $ERROR('#6: (Number.MAX_VALUE <= Number.MAX_VALUE) === true');\n}\n\n//CHECK#7\nif ((Number.MIN_VALUE <= Number.MIN_VALUE) !== true) {\n $ERROR('#7: (Number.MIN_VALUE <= Number.MIN_VALUE) === true');\n}\n\n\n",
"id": "S11.8.3_A4.3"
},
{
"section": "11.8.3, 11.8.5",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((0 <= 0) !== true) {\n $ERROR('#1: (0 <= 0) === true');\n}\n\n//CHECK#2\nif ((-0 <= -0) !== true) {\n $ERROR('#2: (-0 <= -0) === true');\n}\n\n//CHECK#3\nif ((+0 <= -0) !== true) {\n $ERROR('#3: (+0 <= -0) === true');\n}\n\n//CHECK#4\nif ((-0 <= +0) !== true) {\n $ERROR('#4: (-0 <= +0) === true');\n}\n\n",
"id": "S11.8.3_A4.4"
},
{
"section": "11.8.3, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.POSITIVE_INFINITY <= 0) !== false) {\n $ERROR('#1: (+Infinity <= 0) === false');\n}\n\n//CHECK#2\nif ((Number.POSITIVE_INFINITY <= 1.1) !== false) {\n $ERROR('#2: (+Infinity <= 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.POSITIVE_INFINITY <= -1.1) !== false) {\n $ERROR('#3: (+Infinity <= -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#4: (+Infinity <= -Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY <= Number.MAX_VALUE) !== false) {\n $ERROR('#5: (+Infinity <= Number.MAX_VALUE) === false');\n}\n\n//CHECK#6\nif ((Number.POSITIVE_INFINITY <= Number.MIN_VALUE) !== false) {\n $ERROR('#6: (+Infinity <= Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.3_A4.5"
},
{
"section": "11.8.3, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#1: (0 <= +Infinity) === true');\n}\n\n//CHECK#2\nif ((1.1 <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#2: (1.1 <= +Infinity) === true');\n}\n\n//CHECK#3\nif ((-1.1 <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#3: (-1.1 <= +Infinity) === true');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: (-Infinity <= +Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#5: (Number.MAX_VALUE <= +Infinity) === true');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#6: (Number.MIN_VALUE <= +Infinity) === true');\n}\n\n",
"id": "S11.8.3_A4.6"
},
{
"section": "11.8.3, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NEGATIVE_INFINITY <= 0) !== true) {\n $ERROR('#1: (-Infinity <= 0) === true');\n}\n\n//CHECK#2\nif ((Number.NEGATIVE_INFINITY <= 1.1) !== true) {\n $ERROR('#2: (-Infinity <= 1.1) === true');\n}\n\n//CHECK#3\nif ((Number.NEGATIVE_INFINITY <= -1.1) !== true) {\n $ERROR('#3: (-Infinity <= -1.1) === true');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY <= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: (-Infinity <= +Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.NEGATIVE_INFINITY <= Number.MAX_VALUE) !== true) {\n $ERROR('#5: (-Infinity <= Number.MAX_VALUE) === true');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY <= Number.MIN_VALUE) !== true) {\n $ERROR('#6: (-Infinity <= Number.MIN_VALUE) === true');\n}\n\n",
"id": "S11.8.3_A4.7"
},
{
"section": "11.8.3, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#1: (0 <= -Infinity) === false');\n}\n\n//CHECK#2\nif ((1.1 <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#2: (1.1 <= -Infinity) === false');\n}\n\n//CHECK#3\nif ((-1.1 <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#3: (-1.1 <= -Infinity) === false');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#4: (+Infinity <= -Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#5: (Number.MAX_VALUE <= -Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE <= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#6: (Number.MIN_VALUE <= -Infinity) === false');\n}\n\n",
"id": "S11.8.3_A4.8"
},
{
"section": "11.8.3, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1.1 <= 1) !== false) {\n $ERROR('#1: (1.1 <= 1) === false');\n}\n\n//CHECK#2\nif ((1 <= 1.1) !== true) {\n $ERROR('#2: (1 <= 1.1) === true');\n}\n\n//CHECK#3\nif ((-1.1 <= -1) !== true) {\n $ERROR('#3: (-1.1 <= -1) === true');\n}\n\n//CHECK#4\nif ((-1 <= -1.1) !== false) {\n $ERROR('#4: (-1 <= -1.1) === false');\n}\n\n//CHECK#5\nif ((0 <= 0.1) !== true) {\n $ERROR('#5: (0 <= 0.1) === true');\n}\n\n//CHECK#6\nif ((-0.1 <= 0) !== true) {\n $ERROR('#6: (-0.1 <= 0) === true');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE/2 <= Number.MAX_VALUE) !== true) {\n $ERROR('#7: (Number.MAX_VALUE/2 <= Number.MAX_VALUE) === true');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE <= Number.MIN_VALUE*2) !== true) {\n $ERROR('#8: (Number.MIN_VALUE <= Number.MIN_VALUE*2) === true');\n}\n\n\n",
"id": "S11.8.3_A4.9"
}
]
}
}

View File

@ -0,0 +1,224 @@
{
"testCollection": {
"name": "11.8.4_The_Grater_than_or_equal_Operator",
"numTests": 36,
"tests": [
{
"section": "11.8.4, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009>=\\u00091\") !== true) {\n $ERROR('#1: (1\\\\u0009>=\\\\u00091) === true');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B>=\\u000B1\") !== true) {\n $ERROR('#2: (1\\\\u000B>=\\\\u000B1) === true'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C>=\\u000C1\") !== true) {\n $ERROR('#3: (1\\\\u000C>=\\\\u000C1) === true');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020>=\\u00201\") !== true) {\n $ERROR('#4: (1\\\\u0020>=\\\\u00201) === true');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0>=\\u00A01\") !== true) {\n $ERROR('#5: (1\\\\u00A0>=\\\\u00A01) === true');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A>=\\u000A1\") !== true) {\n $ERROR('#6: (1\\\\u000A>=\\\\u000A1) === true'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D>=\\u000D1\") !== true) {\n $ERROR('#7: (1\\\\u000D>=\\\\u000D1) === true');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028>=\\u20281\") !== true) {\n $ERROR('#8: (1\\\\u2028>=\\\\u20281) === true');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029>=\\u20291\") !== true) {\n $ERROR('#9: (1\\\\u2029>=\\\\u20291) === true');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029>=\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== true) {\n $ERROR('#10: (1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029>=\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === true');\n}\n",
"id": "S11.8.4_A1"
},
{
"section": "11.8.4, 11.8.5",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 >= 1 !== true) {\n $ERROR('#1: 1 >= 1 === true');\n}\n\n//CHECK#2\nvar x = 1;\nif (x >= 1 !== true) {\n $ERROR('#2: var x = 1; x >= 1 === true');\n}\n\n//CHECK#3\nvar y = 1;\nif (1 >= y !== true) {\n $ERROR('#3: var y = 1; 1 >= y === true');\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (x >= y !== true) {\n $ERROR('#4: var x = 1; var y = 1; x >= y === true');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (objectx.prop >= objecty.prop !== true) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop >= objecty.prop === true');\n}\n",
"id": "S11.8.4_A2.1_T1"
},
{
"section": "11.8.4, 11.8.5",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x >= 1;\n $ERROR('#1.1: x >= 1 throw ReferenceError. Actual: ' + (x >= 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x >= 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.8.4_A2.1_T2"
},
{
"section": "11.8.4, 11.8.5",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 >= y;\n $ERROR('#1.1: 1 >= y throw ReferenceError. Actual: ' + (1 >= y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 >= y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.8.4_A2.1_T3"
},
{
"section": "11.8.4, 8.6.2.6",
"description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
"test": "//CHECK#1\nif ({valueOf: function() {return 2}} >= 1 !== true) {\n $ERROR('#1: {valueOf: function() {return 1}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}} >= 1));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 2}, toString: function() {return 0}} >= 1 !== true) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 2}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 2}} >= 1));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 2}, toString: function() {return {}}} >= 1 !== true) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} >= 1));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 2}, toString: function() {throw \"error\"}} >= 1 !== true) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} >= 1));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 2}, toString: function() {throw \"error\"}} >= 1 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 2}, toString: function() {throw \"error\"}} >= 1 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 >= {toString: function() {return 0}} !== true) {\n $ERROR('#5: 1 >= {toString: function() {return 0}} === true. Actual: ' + (1 >= {toString: function() {return 0}}));\n}\n\n//CHECK#6\nif (1 >= {valueOf: function() {return {}}, toString: function() {return 0}} !== true) {\n $ERROR('#6: 1 >= {valueOf: function() {return {}}, toString: function() {return 0}} === true. Actual: ' + (1 >= {valueOf: function() {return {}}, toString: function() {return 0}}));\n}\n\n//CHECK#7\ntry {\n 1 >= {valueOf: function() {throw \"error\"}, toString: function() {return 0}};\n $ERROR('#7.1: 1 >= {valueOf: function() {throw \"error\"}, toString: function() {return 0}} throw \"error\". Actual: ' + (1 >= {valueOf: function() {throw \"error\"}, toString: function() {return 0}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 >= {valueOf: function() {throw \"error\"}, toString: function() {return 0}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 >= {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 >= {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 >= {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 >= {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.8.4_A2.2_T1"
},
{
"section": "11.8.4",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x >= y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x >= y throw \"x\". Actual: ' + (x >= y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x >= y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.4_A2.3_T1"
},
{
"section": "11.8.4",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 1; \nif ((x = 0) >= x !== true) {\n $ERROR('#1: var x = 1; (x = 0) >= x === true');\n}\n\n//CHECK#2\nvar x = 0; \nif (x >= (x = 1) !== false) {\n $ERROR('#2: var x = 0; x >= (x = 1) === false');\n}\n\n",
"id": "S11.8.4_A2.4_T1"
},
{
"section": "11.8.4",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() >= y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() >= y() throw \"x\". Actual: ' + (x() >= y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() >= y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.4_A2.4_T2"
},
{
"section": "11.8.4",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x >= (x = 1);\n $ERROR('#1.1: x >= (x = 1) throw ReferenceError. Actual: ' + (x >= (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x >= (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) >= y !== true) {\n $ERROR('#2: (y = 1) >= y === true');\n}\n\n",
"id": "S11.8.4_A2.4_T3"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object",
"test": "//CHECK#1\nif (true >= true !== true) {\n $ERROR('#1: true >= true === true');\n}\n\n//CHECK#2\nif (new Boolean(true) >= true !== true) {\n $ERROR('#2: new Boolean(true) >= true === true');\n}\n\n//CHECK#3\nif (true >= new Boolean(true) !== true) {\n $ERROR('#3: true >= new Boolean(true) === true');\n}\n\n//CHECK#4\nif (new Boolean(true) >= new Boolean(true) !== true) {\n $ERROR('#4: new Boolean(true) >= new Boolean(true) === true');\n}\n",
"id": "S11.8.4_A3.1_T1.1"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object",
"test": "//CHECK#1\nif (1 >= 1 !== true) {\n $ERROR('#1: 1 >= 1 === true');\n}\n\n//CHECK#2\nif (new Number(1) >= 1 !== true) {\n $ERROR('#2: new Number(1) >= 1 === true');\n}\n\n//CHECK#3\nif (1 >= new Number(1) !== true) {\n $ERROR('#3: 1 >= new Number(1) === true');\n}\n\n//CHECK#4\nif (new Number(1) >= new Number(1) !== true) {\n $ERROR('#4: new Number(1) >= new Number(1) === true');\n}\n\n",
"id": "S11.8.4_A3.1_T1.2"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined",
"test": "//CHECK#1\nif (null >= undefined !== false) {\n $ERROR('#1: null >= undefined === false');\n}\n\n//CHECK#2\nif (undefined >= null !== false) {\n $ERROR('#2: undefined >= null === false');\n}\n\n//CHECK#3\nif (undefined >= undefined !== false) {\n $ERROR('#3: undefined >= undefined === false');\n}\n\n//CHECK#4\nif (null >= null !== true) {\n $ERROR('#4: null >= null === true');\n}\n",
"id": "S11.8.4_A3.1_T1.3"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true >= 1 !== true) {\n $ERROR('#1: true >= 1 === true');\n}\n\n//CHECK#2\nif (1 >= true !== true) {\n $ERROR('#2: 1 >= true === true');\n}\n\n//CHECK#3\nif (new Boolean(true) >= 1 !== true) {\n $ERROR('#3: new Boolean(true) >= 1 === true');\n}\n\n//CHECK#4\nif (1 >= new Boolean(true) !== true) {\n $ERROR('#4: 1 >= new Boolean(true) === true');\n}\n\n//CHECK#5\nif (true >= new Number(1) !== true) {\n $ERROR('#5: true >= new Number(1) === true');\n}\n\n//CHECK#6\nif (new Number(1) >= true !== true) {\n $ERROR('#6: new Number(1) >= true === true');\n}\n\n//CHECK#7\nif (new Boolean(true) >= new Number(1) !== true) {\n $ERROR('#7: new Boolean(true) >= new Number(1) === true');\n}\n\n//CHECK#8\nif (new Number(1) >= new Boolean(true) !== true) {\n $ERROR('#8: new Number(1) >= new Boolean(true) === true');\n}\n",
"id": "S11.8.4_A3.1_T2.1"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object)",
"test": "//CHECK#1\nif (\"1\" >= 1 !== true) {\n $ERROR('#1: \"1\" >= 1 === true');\n}\n\n//CHECK#2\nif (1 >= \"1\" !== true) {\n $ERROR('#2: 1 >= \"1\" === true');\n}\n\n//CHECK#3\nif (new String(\"1\") >= 1 !== true) {\n $ERROR('#3: new String(\"1\") >= 1 === true');\n}\n\n//CHECK#4\nif (1 >= new String(\"1\") !== true) {\n $ERROR('#4: 1 >= new String(\"1\") === true');\n}\n\n//CHECK#5\nif (\"1\" >= new Number(1) !== true) {\n $ERROR('#5: \"1\" >= new Number(1) === true');\n}\n\n//CHECK#6\nif (new Number(1) >= \"1\" !== true) {\n $ERROR('#6: new Number(1) >= \"1\" === true');\n}\n\n//CHECK#7\nif (new String(\"1\") >= new Number(1) !== true) {\n $ERROR('#7: new String(\"1\") >= new Number(1) === true');\n}\n\n//CHECK#8\nif (new Number(1) >= new String(\"1\") !== true) {\n $ERROR('#8: new Number(1) >= new String(\"1\") === true');\n}\n\n//CHECK#9\nif (\"x\" >= 1 !== false) {\n $ERROR('#9: \"x\" >= 1 === false');\n}\n\n//CHECK#10\nif (1 >= \"x\" !== false) {\n $ERROR('#10: 1 >= \"x\" === false');\n}\n",
"id": "S11.8.4_A3.1_T2.2"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null",
"test": "//CHECK#1\nif (1 >= null !== true) {\n $ERROR('#1: 1 >= null === true');\n}\n\n//CHECK#2\nif (null >= 1 !== false) {\n $ERROR('#2: null >= 1 === false');\n}\n\n//CHECK#3\nif (new Number(1) >= null !== true) {\n $ERROR('#3: new Number(1) >= null === true');\n}\n\n//CHECK#4\nif (null >= new Number(1) !== false) {\n $ERROR('#4: null >= new Number(1) === false');\n}\n",
"id": "S11.8.4_A3.1_T2.3"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined",
"test": "//CHECK#1\nif (1 >= undefined !== false) {\n $ERROR('#1: 1 >= undefined === false');\n}\n\n//CHECK#2\nif (undefined >= 1 !== false) {\n $ERROR('#2: undefined >= 1 === false');\n}\n\n//CHECK#3\nif (new Number(1) >= undefined !== false) {\n $ERROR('#3: new Number(1) >= undefined === false');\n}\n\n//CHECK#4\nif (undefined >= new Number(1) !== false) {\n $ERROR('#4: undefined >= new Number(1) === false');\n}\n",
"id": "S11.8.4_A3.1_T2.4"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object)",
"test": "//CHECK#1\nif (true >= \"1\" !== true) {\n $ERROR('#1: true >= \"1\" === true');\n}\n\n//CHECK#2\nif (\"1\" >= true !== true) {\n $ERROR('#2: \"1\" >= true === true');\n}\n\n//CHECK#3\nif (new Boolean(true) >= \"1\" !== true) {\n $ERROR('#3: new Boolean(true) >= \"1\" === true');\n}\n\n//CHECK#4\nif (\"1\" >= new Boolean(true) !== true) {\n $ERROR('#4: \"1\" >= new Boolean(true) === true');\n}\n\n//CHECK#5\nif (true >= new String(\"1\") !== true) {\n $ERROR('#5: true >= new String(\"1\") === true');\n}\n\n//CHECK#6\nif (new String(\"1\") >= true !== true) {\n $ERROR('#6: new String(\"1\") >= true === true');\n}\n\n//CHECK#7\nif (new Boolean(true) >= new String(\"1\") !== true) {\n $ERROR('#7: new Boolean(true) >= new String(\"1\") === true');\n}\n\n//CHECK#8\nif (new String(\"1\") >= new Boolean(true) !== true) {\n $ERROR('#8: new String(\"1\") >= new Boolean(true) === true');\n}\n",
"id": "S11.8.4_A3.1_T2.5"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined",
"test": "//CHECK#1\nif (\"1\" >= undefined !== false) {\n $ERROR('#1: \"1\" >= undefined === false');\n}\n\n//CHECK#2\nif (undefined >= \"1\" !== false) {\n $ERROR('#2: undefined >= \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") >= undefined !== false) {\n $ERROR('#3: new String(\"1\") >= undefined === false');\n}\n\n//CHECK#4\nif (undefined >= new String(\"1\") !== false) {\n $ERROR('#4: undefined >= new String(\"1\") === false');\n}\n",
"id": "S11.8.4_A3.1_T2.6"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null",
"test": "//CHECK#1\nif (\"1\" >= null !== true) {\n $ERROR('#1: \"1\" >= null === true');\n}\n\n//CHECK#2\nif (null >= \"1\" !== false) {\n $ERROR('#2: null >= \"1\" === false');\n}\n\n//CHECK#3\nif (new String(\"1\") >= null !== true) {\n $ERROR('#3: new String(\"1\") >= null === true');\n}\n\n//CHECK#4\nif (null >= new String(\"1\") !== false) {\n $ERROR('#4: null >= new String(\"1\") === false');\n}\n",
"id": "S11.8.4_A3.1_T2.7"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined",
"test": "//CHECK#1\nif (true >= undefined !== false) {\n $ERROR('#1: true >= undefined === false');\n}\n\n//CHECK#2\nif (undefined >= true !== false) {\n $ERROR('#2: undefined >= true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) >= undefined !== false) {\n $ERROR('#3: new Boolean(true) >= undefined === false');\n}\n\n//CHECK#4\nif (undefined >= new Boolean(true) !== false) {\n $ERROR('#4: undefined >= new Boolean(true) === false');\n}\n",
"id": "S11.8.4_A3.1_T2.8"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null",
"test": "//CHECK#1\nif (true >= null !== true) {\n $ERROR('#1: true >= null === true');\n}\n\n//CHECK#2\nif (null >= true !== false) {\n $ERROR('#2: null >= true === false');\n}\n\n//CHECK#3\nif (new Boolean(true) >= null !== true) {\n $ERROR('#3: new Boolean(true) >= null === true');\n}\n\n//CHECK#4\nif (null >= new Boolean(true) !== false) {\n $ERROR('#4: null >= new Boolean(true) === false');\n}\n",
"id": "S11.8.4_A3.1_T2.9"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object",
"test": "//CHECK#1\nif (\"1\" >= \"1\" !== true) {\n $ERROR('#1: \"1\" >= \"1\" === true');\n}\n\n//CHECK#2\nif (new String(\"1\") >= \"1\" !== true) {\n $ERROR('#2: new String(\"1\") >= \"1\" === true');\n}\n\n//CHECK#3\nif (\"1\" >= new String(\"1\") !== true) {\n $ERROR('#3: \"1\" >= new String(\"1\") === true');\n}\n\n//CHECK#4\nif (new String(\"1\") >= new String(\"1\") !== true) {\n $ERROR('#4: new String(\"1\") >= new String(\"1\") === true');\n}\n\n//CHECK#5\nif (\"x\" >= \"1\" !== true) {\n $ERROR('#5: \"x\" >= \"1\" === true');\n}\n\n//CHECK#6\nif (\"1\" >= \"x\" !== false) {\n $ERROR('#6: \"1\" >= \"x\" === false');\n}\n",
"id": "S11.8.4_A3.2_T1.1"
},
{
"section": "11.8.4",
"description": "Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object",
"test": "//CHECK#1\nif (({} >= function(){return 1}) !== ({}.toString() >= function(){return 1}.toString())) {\n $ERROR('#1: ({} >= function(){return 1}) === ({}.toString() >= function(){return 1}.toString())');\n}\n\n//CHECK#2\nif ((function(){return 1} >= {}) !== (function(){return 1}.toString() >= {}.toString())) {\n $ERROR('#2: (function(){return 1} >= {}) === (function(){return 1}.toString() >= {}.toString())');\n}\n\n//CHECK#3\nif ((function(){return 1} >= function(){return 1}) !== (function(){return 1}.toString() >= function(){return 1}.toString())) {\n $ERROR('#3: (function(){return 1} >= function(){return 1}) === (function(){return 1}.toString() >= function(){return 1}.toString())');\n}\n\n//CHECK#4\nif (({} >= {}) !== ({}.toString() >= {}.toString())) {\n $ERROR('#4: ({} >= {}) === ({}.toString() >= {}.toString())');\n}\n",
"id": "S11.8.4_A3.2_T1.2"
},
{
"section": "11.8.4, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NaN >= 0) !== false) {\n $ERROR('#1: (NaN >= 0) === false');\n}\n\n//CHECK#2\nif ((Number.NaN >= 1.1) !== false) {\n $ERROR('#2: (NaN >= 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.NaN >= -1.1) !== false) {\n $ERROR('#3: (NaN >= -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NaN >= Number.NaN) !== false) {\n $ERROR('#4: (NaN >= NaN) === false');\n}\n\n//CHECK#5\nif ((Number.NaN >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (NaN >= +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.NaN >= Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#6: (NaN >= -Infinity) === false');\n}\n\n//CHECK#7\nif ((Number.NaN >= Number.MAX_VALUE) !== false) {\n $ERROR('#7: (NaN >= Number.MAX_VALUE) === false');\n}\n\n//CHECK#8\nif ((Number.NaN >= Number.MIN_VALUE) !== false) {\n $ERROR('#8: (NaN >= Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.4_A4.1"
},
{
"section": "11.8.4, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" >= \"x \") !== false) {\n $ERROR('#1: (\"x\" >= \"x \") === false');\n}\n\n//CHECK#2\nif ((\"\" >= \"x\") !== false) {\n $ERROR('#2: (\"\" >= \"x\") === false');\n}\n\n//CHECK#3\nif ((\"ab\" >= \"abcd\") !== false) {\n $ERROR('#3: (\"ab\" >= abcd\") === false');\n}\n\n//CHECK#4\nif ((\"abcd\" >= \"abc\\u0064\") !== true) {\n $ERROR('#4: (\"abcd\" >= abc\\\\u0064\") === true');\n}\n\n//CHECK#5\nif ((\"x\" >= \"x\" + \"y\") !== false) {\n $ERROR('#5: (\"x\" >= \"x\" + \"y\") === false');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x >= x + \"y\") !== false) {\n $ERROR('#6: var x = \"x\"; (x >= x + \"y\") === false');\n}\n",
"id": "S11.8.4_A4.10"
},
{
"section": "11.8.4, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" >= \"x\") !== true) {\n $ERROR('#1: (\"x\" >= \"x\") === true');\n}\n\n//CHECK#2\nif ((\"x\" >= \"\") !== true) {\n $ERROR('#2: (\"x\" >= \"\") === true');\n}\n\n//CHECK#3\nif ((\"abcd\" >= \"ab\") !== true) {\n $ERROR('#3: (\"abcd\" >= ab\") === true');\n}\n\n//CHECK#4\nif ((\"abc\\u0064\" >= \"abcd\") !== true) {\n $ERROR('#4: (\"abc\\\\u0064\" >= abc\") === true');\n}\n\n//CHECK#5\nif ((\"x\" + \"y\" >= \"x\") !== true) {\n $ERROR('#5: (\"x\" + \"y\" >= \"x\") === true');\n}\n\n//CHECK#6\nvar x = \"x\";\nif ((x + 'y' >= x) !== true) {\n $ERROR('#6: var x = \"x\"; (x + \"y\" >= x) === true');\n}\n\n//CHECK#7\nif ((\"a\\u0000a\" >= \"a\\u0000\") !== true) {\n $ERROR('#7: (\"a\\\\u0000a\" >= \"a\\\\u0000\") === true');\n}\n\n//CHECK#8\nif ((\" x\" >= \"x\") !== false) {\n $ERROR('#8: (\" x\" >= \"x\") === false');\n}\n\n",
"id": "S11.8.4_A4.11"
},
{
"section": "11.8.4, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"xy\" >= \"xx\") !== true) {\n $ERROR('#1: (\"xy\" >= \"xx\") === true');\n}\n\n//CHECK#2\nif ((\"xx\" >= \"xy\") !== false) {\n $ERROR('#2: (\"xx\" >= \"xy\") === false');\n}\n\n//CHECK#3\nif ((\"y\" >= \"x\") !== true) {\n $ERROR('#3: (\"y\" >= \"x\") === true');\n}\n\n//CHECK#4\nif ((\"aba\" >= \"aab\") !== true) {\n $ERROR('#4: (\"aba\" >= aab\") === true');\n}\n\n//CHECK#5\nif ((\"\\u0061\\u0061\\u0061\\u0061\" >= \"\\u0061\\u0061\\u0061\\u0062\") !== false) {\n $ERROR('#5: (\"\\\\u0061\\\\u0061\\\\u0061\\\\u0061\" >= \\\\u0061\\\\u0061\\\\u0061\\\\u0062\") === false');\n}\n\n//CHECK#6\nif ((\"a\\u0000b\" >= \"a\\u0000a\") !== true) {\n $ERROR('#6: (\"a\\\\u0000b\" >= \"a\\\\u0000a\") === true');\n}\n\n//CHECK#7\nif ((\"aa\" >= \"aB\") !== true) {\n $ERROR('#7: (\"aa\" >= aB\") === true');\n}\n",
"id": "S11.8.4_A4.12_T1"
},
{
"section": "11.8.4, 11.8.5",
"description": "x and y are string primitives",
"test": "//CHECK#1\nif ((\"x\" >= \"0\") !== true) {\n $ERROR('#1: (\"x\" >= \"0\") !== true');\n}\n\n//CHECK#2\nif ((\"0\" >= \"-\") !== true) {\n $ERROR('#2: (\"0\" >= \"-\") !== true');\n}\n\n//CHECK#3\nif ((\"0\" >= \".\") !== true) {\n $ERROR('#3: (\"0\" >= \".\") !== true');\n}\n\n//CHECK#4\nif ((\"-\" >= \"+\") !== true) {\n $ERROR('#4: (\"-\" >= \"+\") !== true');\n}\n\n//CHECK#5\nif ((\"-1\" >= \"-0\") !== true) {\n $ERROR('#5: (\"-1\" >= \"-0\") !== true');\n}\n\n//CHECK#6\nif ((\"-1\" >= \"+1\") !== true) {\n $ERROR('#6: (\"-1\" >= \"+1\") !== true');\n}\n\n//CHECK#7\nif ((\"1e-10\" >= \"1\") !== true) {\n$ERROR('#7: (\"1e-10\" >= \"1\") !== true');\n}\n",
"id": "S11.8.4_A4.12_T2"
},
{
"section": "11.8.4, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 >= Number.NaN) !== false) {\n $ERROR('#1: (0 >= NaN) === false');\n}\n\n//CHECK#2\nif ((1.1 >= Number.NaN) !== false) {\n $ERROR('#2: (1.1 >= NaN) === false');\n}\n\n//CHECK#3\nif ((-1.1 >= Number.NaN) !== false) {\n $ERROR('#3: (-1.1 >= NaN) === false');\n}\n\n//CHECK#4\nif ((Number.NaN >= Number.NaN) !== false) {\n $ERROR('#4: (NaN >= NaN) === false');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY >= Number.NaN) !== false) {\n $ERROR('#5: (+Infinity >= NaN) === false');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY >= Number.NaN) !== false) {\n $ERROR('#6: (-Infinity >= NaN) === false');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE >= Number.NaN) !== false) {\n $ERROR('#7: (Number.MAX_VALUE >= NaN) === false');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE >= Number.NaN) !== false) {\n $ERROR('#8: (Number.MIN_VALUE >= NaN) === false');\n}\n\n",
"id": "S11.8.4_A4.2"
},
{
"section": "11.8.4, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1 >= 1) !== true) {\n $ERROR('#1: (1 >= 1) === true');\n}\n\n//CHECK#2\nif ((1.1 >= 1.1) !== true) {\n $ERROR('#2: (1.1 >= 1.1) === true');\n}\n\n//CHECK#3\nif ((-1.1 >= -1.1) !== true) {\n $ERROR('#3: (-1.1 >= -1.1) === true');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: (-Infinity >= -Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY >= Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#5: (+Infinity >= +Infinity) === true');\n}\n\n//CHECK#6\nif ((Number.MAX_VALUE >= Number.MAX_VALUE) !== true) {\n $ERROR('#6: (Number.MAX_VALUE >= Number.MAX_VALUE) === true');\n}\n\n//CHECK#7\nif ((Number.MIN_VALUE >= Number.MIN_VALUE) !== true) {\n $ERROR('#7: (Number.MIN_VALUE >= Number.MIN_VALUE) === true');\n}\n\n\n",
"id": "S11.8.4_A4.3"
},
{
"section": "11.8.4, 11.8.5",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((0 >= 0) !== true) {\n $ERROR('#1: (0 >= 0) === true');\n}\n\n//CHECK#2\nif ((-0 >= -0) !== true) {\n $ERROR('#2: (-0 >= -0) === true');\n}\n\n//CHECK#3\nif ((+0 >= -0) !== true) {\n $ERROR('#3: (+0 >= -0) === true');\n}\n\n//CHECK#4\nif ((-0 >= +0) !== true) {\n $ERROR('#4: (-0 >= +0) === true');\n}\n\n",
"id": "S11.8.4_A4.4"
},
{
"section": "11.8.4, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.POSITIVE_INFINITY >= 0) !== true) {\n $ERROR('#1: (+Infinity >= 0) === true');\n}\n\n//CHECK#2\nif ((Number.POSITIVE_INFINITY >= 1.1) !== true) {\n $ERROR('#2: (+Infinity >= 1.1) === true');\n}\n\n//CHECK#3\nif ((Number.POSITIVE_INFINITY >= -1.1) !== true) {\n $ERROR('#3: (+Infinity >= -1.1) === true');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: (+Infinity >= -Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.POSITIVE_INFINITY >= Number.MAX_VALUE) !== true) {\n $ERROR('#5: (+Infinity >= Number.MAX_VALUE) === true');\n}\n\n//CHECK#6\nif ((Number.POSITIVE_INFINITY >= Number.MIN_VALUE) !== true) {\n $ERROR('#6: (+Infinity >= Number.MIN_VALUE) === true');\n}\n\n",
"id": "S11.8.4_A4.5"
},
{
"section": "11.8.4, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#1: (0 >= +Infinity) === false');\n}\n\n//CHECK#2\nif ((1.1 >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#2: (1.1 >= +Infinity) === false');\n}\n\n//CHECK#3\nif ((-1.1 >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#3: (-1.1 >= +Infinity) === false');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#4: (-Infinity >= +Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#5: (Number.MAX_VALUE >= +Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#6: (Number.MIN_VALUE >= +Infinity) === false');\n}\n\n",
"id": "S11.8.4_A4.6"
},
{
"section": "11.8.4, 11.8.5",
"description": "y is number primitive",
"test": "//CHECK#1\nif ((Number.NEGATIVE_INFINITY >= 0) !== false) {\n $ERROR('#1: (-Infinity >= 0) === false');\n}\n\n//CHECK#2\nif ((Number.NEGATIVE_INFINITY >= 1.1) !== false) {\n $ERROR('#2: (-Infinity >= 1.1) === false');\n}\n\n//CHECK#3\nif ((Number.NEGATIVE_INFINITY >= -1.1) !== false) {\n $ERROR('#3: (-Infinity >= -1.1) === false');\n}\n\n//CHECK#4\nif ((Number.NEGATIVE_INFINITY >= Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#4: (-Infinity >= +Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.NEGATIVE_INFINITY >= Number.MAX_VALUE) !== false) {\n $ERROR('#5: (-Infinity >= Number.MAX_VALUE) === false');\n}\n\n//CHECK#6\nif ((Number.NEGATIVE_INFINITY >= Number.MIN_VALUE) !== false) {\n $ERROR('#6: (-Infinity >= Number.MIN_VALUE) === false');\n}\n\n",
"id": "S11.8.4_A4.7"
},
{
"section": "11.8.4, 11.8.5",
"description": "x is number primitive",
"test": "//CHECK#1\nif ((0 >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#1: (0 >= -Infinity) === true');\n}\n\n//CHECK#2\nif ((1.1 >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#2: (1.1 >= -Infinity) === true');\n}\n\n//CHECK#3\nif ((-1.1 >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#3: (-1.1 >= -Infinity) === true');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: (+Infinity >= -Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.MAX_VALUE >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#5: (Number.MAX_VALUE >= -Infinity) === true');\n}\n\n//CHECK#6\nif ((Number.MIN_VALUE >= Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#6: (Number.MIN_VALUE >= -Infinity) === true');\n}\n\n",
"id": "S11.8.4_A4.8"
},
{
"section": "11.8.4, 11.8.5",
"description": "x and y are number primitives",
"test": "//CHECK#1\nif ((1 >= 1.1) !== false) {\n $ERROR('#1: (1 >= 1.1) === false');\n}\n\n//CHECK#2\nif ((1.1 >= 1) !== true) {\n $ERROR('#2: (1.1 >= 1) === true');\n}\n\n//CHECK#3\nif ((-1 >= -1.1) !== true) {\n $ERROR('#3: (-1 >= -1.1) === true');\n}\n\n//CHECK#4\nif ((-1.1 >= -1) !== false) {\n $ERROR('#4: (-1.1 >= -1) === false');\n}\n\n//CHECK#5\nif ((0.1 >= 0) !== true) {\n $ERROR('#5: (0.1 >= 0) === true');\n}\n\n//CHECK#6\nif ((0 >= -0.1) !== true) {\n $ERROR('#6: (0 >= -0.1) === true');\n}\n\n//CHECK#7\nif ((Number.MAX_VALUE >= Number.MAX_VALUE/2) !== true) {\n $ERROR('#7: (Number.MAX_VALUE >= Number.MAX_VALUE/2) === true');\n}\n\n//CHECK#8\nif ((Number.MIN_VALUE*2 >= Number.MIN_VALUE) !== true) {\n $ERROR('#8: (Number.MIN_VALUE*2 >= Number.MIN_VALUE) === true');\n}\n\n\n",
"id": "S11.8.4_A4.9"
}
]
}
}

View File

@ -0,0 +1,128 @@
{
"testCollection": {
"name": "11.8.6_The_instanceof_operator",
"numTests": 20,
"tests": [
{
"section": "11.8.6, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"({})\\u0009instanceof\\u0009Object\") !== true) {\n $ERROR('#1: ({})\\\\u0009instanceof\\\\u0009Object === true');\n}\n\n//CHECK#2\nif (eval(\"({})\\u000Binstanceof\\u000BObject\") !== true) {\n $ERROR('#2: ({})\\\\u000Binstanceof\\\\u000BObject === true'); \n}\n\n//CHECK#3\nif (eval(\"({})\\u000Cinstanceof\\u000CObject\") !== true) {\n $ERROR('#3: ({})\\\\u000Cinstanceof\\\\u000CObject === true');\n}\n\n//CHECK#4\nif (eval(\"({})\\u0020instanceof\\u0020Object\") !== true) {\n $ERROR('#4: ({})\\\\u0020instanceof\\\\u0020Object === true');\n}\n\n//CHECK#5\nif (eval(\"({})\\u00A0instanceof\\u00A0Object\") !== true) {\n $ERROR('#5: ({})\\\\u00A0instanceof\\\\u00A0Object === true');\n}\n\n//CHECK#6\nif (eval(\"({})\\u000Ainstanceof\\u000AObject\") !== true) {\n $ERROR('#6: ({})\\\\u000Ainstanceof\\\\u000AObject === true'); \n}\n\n//CHECK#7\nif (eval(\"({})\\u000Dinstanceof\\u000DObject\") !== true) {\n $ERROR('#7: ({})\\\\u000Dinstanceof\\\\u000DObject === true');\n}\n\n//CHECK#8\nif (eval(\"({})\\u2028instanceof\\u2028Object\") !== true) {\n $ERROR('#8: ({})\\\\u2028instanceof\\\\u2028Object === true');\n}\n\n//CHECK#9\nif (eval(\"({})\\u2029instanceof\\u2029Object\") !== true) {\n $ERROR('#9: ({})\\\\u2029instanceof\\\\u2029Object === true');\n}\n\n//CHECK#10\nif (eval(\"({})\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029instanceof\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029Object\") !== true) {\n $ERROR('#10: ({})\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029instanceof\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029Object === true');\n}\n",
"id": "S11.8.6_A1"
},
{
"section": "11.8.6",
"description": "Either Expression is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (({}) instanceof Object !== true) {\n $ERROR('#1: ({}) instanceof Object === true');\n}\n\n//CHECK#2\nvar object = {};\nif (object instanceof Object !== true) {\n $ERROR('#2: var object = {}; object instanceof Object === true');\n}\n\n//CHECK#3\nvar OBJECT = Object;\nif (({}) instanceof OBJECT !== true) {\n $ERROR('#3: var OBJECT = Object; ({}) instanceof OBJECT === true');\n}\n\n//CHECK#4\nvar object = {};\nvar OBJECT = Object;\nif (object instanceof OBJECT !== true) {\n $ERROR('#4: var object = {}; var OBJECT = Object; object instanceof OBJECT === true');\n}\n\n",
"id": "S11.8.6_A2.1_T1"
},
{
"section": "11.8.6",
"description": "If GetBase(RelationalExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n object instanceof Object;\n $ERROR('#1.1: object instanceof Object throw ReferenceError. Actual: ' + (object instanceof Object)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: object instanceof Object throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.8.6_A2.1_T2"
},
{
"section": "11.8.6",
"description": "If GetBase(ShiftExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n ({}) instanceof OBJECT;\n $ERROR('#1.1: ({}) instanceof OBJECT throw ReferenceError. Actual: ' + (({}) instanceof OBJECT)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: ({}) instanceof OBJECT throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.8.6_A2.1_T3"
},
{
"section": "11.8.6",
"description": "Checking with \"=\"",
"test": "//CHECK#1 \nvar OBJECT = 0;\nif ((OBJECT = Object, {}) instanceof OBJECT !== true) {\n $ERROR('#1: var OBJECT = 0; (OBJECT = Object, {}) instanceof OBJECT === true');\n}\n\n//CHECK#2\nvar object = {}; \nif (object instanceof (object = 0, Object) !== true) {\n $ERROR('#2: var object = {}; object instanceof (object = 0, Object) === true');\n}\n\n",
"id": "S11.8.6_A2.4_T1"
},
{
"section": "11.8.6",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() instanceof y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() instanceof y() throw \"x\". Actual: ' + (x() instanceof y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() instanceof y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.6_A2.4_T2"
},
{
"section": "11.8.6",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n object instanceof (object = {}, Object);\n $ERROR('#1.1: object instanceof (object = {}, Object) throw ReferenceError. Actual: ' + (object instanceof (object = {}, Object))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: object instanceof (object = {}, Object) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((OBJECT = Object, {}) instanceof OBJECT !== true) {\n $ERROR('#2: (OBJECT = Object, {}) instanceof OBJECT !== true');\n}\n\n",
"id": "S11.8.6_A2.4_T3"
},
{
"section": "11.8.6",
"description": "Checking all the types of primitives",
"test": "//CHECK#1\ntry {\n true instanceof true;\n $ERROR('#1: true instanceof true throw TypeError'); \n}\ncatch (e) {\n if (e instanceof TypeError !== true) {\n $ERROR('#1: true instanceof true throw TypeError'); \n }\n}\n\n//CHECK#2\ntry {\n 1 instanceof 1;\n $ERROR('#2: 1 instanceof 1 throw TypeError'); \n}\ncatch (e) {\n if (e instanceof TypeError !== true) {\n $ERROR('#2: 1 instanceof 1 throw TypeError'); \n }\n}\n\n//CHECK#3\ntry {\n \"string\" instanceof \"string\";\n $ERROR('#3: \"string\" instanceof \"string\" throw TypeError'); \n}\ncatch (e) {\n if (e instanceof TypeError !== true) {\n $ERROR('#3: \"string\" instanceof \"string\" throw TypeError'); \n }\n}\n\n//CHECK#4\ntry {\n undefined instanceof undefined;\n $ERROR('#4: undefined instanceof undefined throw TypeError'); \n}\ncatch (e) {\n if (e instanceof TypeError !== true) {\n $ERROR('#4: undefined instanceof undefined throw TypeError'); \n }\n}\n\n//CHECK#5\ntry {\n null instanceof null;\n $ERROR('#5: null instanceof null throw TypeError'); \n}\ncatch (e) {\n if (e instanceof TypeError !== true) {\n $ERROR('#5: null instanceof null throw TypeError'); \n }\n}\n",
"id": "S11.8.6_A3"
},
{
"section": "11.8.6",
"description": "Checking Boolean case",
"test": "//CHECK#1\nif (false instanceof Boolean) {\n\t$ERROR('#1: false is not instanceof Boolean');\n}\n\n//CHECK#2\nif (Boolean(false) instanceof Boolean) {\n\t$ERROR('#2: Boolean(false) is not instanceof Boolean');\n}\n\n//CHECK#3\nif (new Boolean instanceof Boolean !== true) {\n\t$ERROR('#3: new Boolean instanceof Boolean');\n}\n\n",
"id": "S11.8.6_A4_T1"
},
{
"section": "11.8.6",
"description": "Checking Number case",
"test": "//CHECK#1\nif (0 instanceof Number) {\n\t$ERROR('#1: 0 is not instanceof Number');\n}\n\n//CHECK#2\nif (Number(0) instanceof Number) {\n\t$ERROR('#2: Number(0) is not instanceof Number');\n}\n\n//CHECK#3\nif (new Number instanceof Number !== true) {\n\t$ERROR('#3: new Number instanceof Number');\n}\n\n",
"id": "S11.8.6_A4_T2"
},
{
"section": "11.8.6",
"description": "Checking String case",
"test": "//CHECK#1\nif (\"\" instanceof String) {\n\t$ERROR('#1: \"\" is not instanceof String');\n}\n\n//CHECK#2\nif (String(\"\") instanceof String) {\n\t$ERROR('#2: String(\"\") is not instanceof String');\n}\n\n//CHECK#3\nif (new String instanceof String !== true) {\n\t$ERROR('#3: new String instanceof String');\n}\n",
"id": "S11.8.6_A4_T3"
},
{
"section": "11.8.6",
"description": "Checking Error case",
"test": "var __err = new Error;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(__err instanceof Error)) {\n\t$ERROR('#1: TypeError is subclass of Error from instanceof operator poit of view');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__err instanceof TypeError) {\n\t$ERROR('#2: TypeError is subclass of Error from instanceof operator poit of view');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar err__ = Error('failed');\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (!(err__ instanceof Error)) {\n\t$ERROR('#3: TypeError is subclass of Error from instanceof operator poit of view');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (err__ instanceof TypeError) {\n\t$ERROR('#4: TypeError is subclass of Error from instanceof operator poit of view');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S11.8.6_A5_T1"
},
{
"section": "11.8.6",
"description": "Checking TypeError case",
"test": "var __t__err = new TypeError;\n\n//CHECK#1\nif (!(__t__err instanceof Error)) {\n\t$ERROR('#1: TypeError is subclass of Error from instanceof operator poit of view');\n}\n\n//CHECK#2\nif (!(__t__err instanceof TypeError)) {\n\t$ERROR('#2: TypeError is subclass of Error from instanceof operator poit of view');\n}\n\n//////////////////////////////////////////////////////////////////////////////\nvar err__t__ = TypeError('failed');\n\n//CHECK#3\nif (!(err__t__ instanceof Error)) {\n\t$ERROR('#3: TypeError is subclass of Error from instanceof operator poit of view');\n}\n\n//CHECK#4\nif (!(err__t__ instanceof TypeError)) {\n\t$ERROR('#4: TypeError is subclass of Error from instanceof operator poit of view');\n}\n\n",
"id": "S11.8.6_A5_T2"
},
{
"section": "11.8.6",
"description": "Checking \"this\" case",
"test": "//CHECK#1\ntry{\n\t({}) instanceof this;\n\t$ERROR('#1: Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator');\n}\ncatch(e){\n if (e instanceof TypeError !== true) {\n $ERROR('#1: Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator');\n }\n}\n",
"id": "S11.8.6_A6_T1"
},
{
"section": "11.8.6",
"description": "Checking Math case",
"test": "//CHECK#1\ntry{\n\t1 instanceof Math;\n\t$ERROR('#1: 1 instanceof Math throw TypeError');\n}\ncatch(e){\n if (e instanceof TypeError !== true) { \n $ERROR('#1: 1 instanceof Math throw TypeError');\n } \n}\n",
"id": "S11.8.6_A6_T2"
},
{
"section": "11.8.6",
"description": "Checking if RelationalExpression is function",
"test": "function MyFunct(){return 0};\n\n//CHECK#1\nif (MyFunct instanceof MyFunct){\n\t$ERROR('#1 function MyFunct(){return 0}; MyFunct instanceof MyFunct === false');\n}\n\n//CHECK#2\nif (MyFunct instanceof Function !== true){\n\t$ERROR('#2 function MyFunct(){return 0}; MyFunct instanceof Function === true');\n}\n\n//CHECK#3\nif (MyFunct instanceof Object !== true){\n\t$ERROR('#3 function MyFunct(){return 0}; MyFunct instanceof Object === true');\n}\n",
"id": "S11.8.6_A6_T3"
},
{
"section": "11.8.6",
"description": "Checking if RelationalExpression is object",
"test": "MyFunct = function(){};\n__my__funct = new MyFunct;\n\n\n//CHECK#1\nif (!(__my__funct instanceof MyFunct)){\n\t$ERROR('#1 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator');\n}\n\n//CHECK#2\nif (__my__funct instanceof Function){\n\t$ERROR('#2 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator');\n}\n\n//CHECK#3\nif (!(__my__funct instanceof Object)){\n\t$ERROR('#3 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator');\n}\n\n//CHECK#4\ntry{\n\t__my__funct instanceof __my__funct;\n\t$ERROR('#4 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator');\n}\ncatch(e){ \n\tif (e instanceof TypeError !== true) {\n $ERROR('#4 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator');\n\t}\n}\n",
"id": "S11.8.6_A6_T4"
},
{
"section": "11.8.6",
"description": "Checking Object object",
"test": "var __obj={};\n\n//CHECK#1\nif (!(__obj instanceof Object)) {\n\t$ERROR('#1: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression');\n}\n\n//CHECK#2\nif (__obj.constructor !== Object) {\n\t$ERROR('#2: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression');\n}\n",
"id": "S11.8.6_A7_T1"
},
{
"section": "11.8.6",
"description": "Checking Array object",
"test": "var __arr=[];\n\n//CHECK#1\nif (!(__arr instanceof Array)) {\n\t$ERROR('#1: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression');\n}\n\n//CHECK#2\nif (__arr.constructor !== Array) {\n\t$ERROR('#2: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression');\n}\n",
"id": "S11.8.6_A7_T2"
},
{
"section": "11.8.6",
"description": "Checking Function object",
"test": "var __func = new Function;\n\n//CHECK#1\nif (!(__func instanceof Function)) {\n\t$ERROR('#1: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression');\n}\n\n//CHECK#2\nif (__func.constructor !== Function) {\n\t$ERROR('#2: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression');\n}\n\n",
"id": "S11.8.6_A7_T3"
}
]
}
}

View File

@ -0,0 +1,62 @@
{
"testCollection": {
"name": "11.8.7_The_in_operator",
"numTests": 9,
"tests": [
{
"section": "11.8.7, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"'MAX_VALUE'\\u0009in\\u0009Number\") !== true) {\n $ERROR('#1: \"MAX_VALUE\"\\\\u0009in\\\\u0009Number === true');\n}\n\n//CHECK#2\nif (eval(\"'MAX_VALUE'\\u000Bin\\u000BNumber\") !== true) {\n $ERROR('#2: \"MAX_VALUE\"\\\\u000Bin\\\\u000BNumber === true'); \n}\n\n//CHECK#3\nif (eval(\"'MAX_VALUE'\\u000Cin\\u000CNumber\") !== true) {\n $ERROR('#3: \"MAX_VALUE\"\\\\u000Cin\\\\u000CNumber === true');\n}\n\n//CHECK#4\nif (eval(\"'MAX_VALUE'\\u0020in\\u0020Number\") !== true) {\n $ERROR('#4: \"MAX_VALUE\"\\\\u0020in\\\\u0020Number === true');\n}\n\n//CHECK#5\nif (eval(\"'MAX_VALUE'\\u00A0in\\u00A0Number\") !== true) {\n $ERROR('#5: \"MAX_VALUE\"\\\\u00A0in\\\\u00A0Number === true');\n}\n\n//CHECK#6\nif (eval(\"'MAX_VALUE'\\u000Ain\\u000ANumber\") !== true) {\n $ERROR('#6: \"MAX_VALUE\"\\\\u000Ain\\\\u000ANumber === true'); \n}\n\n//CHECK#7\nif (eval(\"'MAX_VALUE'\\u000Din\\u000DNumber\") !== true) {\n $ERROR('#7: \"MAX_VALUE\"\\\\u000Din\\\\u000DNumber === true');\n}\n\n//CHECK#8\nif (eval(\"'MAX_VALUE'\\u2028in\\u2028Number\") !== true) {\n $ERROR('#8: \"MAX_VALUE\"\\\\u2028in\\\\u2028Number === true');\n}\n\n//CHECK#9\nif (eval(\"'MAX_VALUE'\\u2029in\\u2029Number\") !== true) {\n $ERROR('#9: \"MAX_VALUE\"\\\\u2029in\\\\u2029Number === true');\n}\n\n//CHECK#10\nif (eval(\"'MAX_VALUE'\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029in\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029Number\") !== true) {\n $ERROR('#10: \"MAX_VALUE\"\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029in\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029Number === true');\n}\n",
"id": "S11.8.7_A1"
},
{
"section": "11.8.7",
"description": "Either Expression is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (\"MAX_VALUE\" in Number !== true) {\n $ERROR('#1: \"MAX_VALUE\" in Number === true');\n}\n\n//CHECK#2\nvar x = \"MAX_VALUE\";\nif (x in Number !== true) {\n $ERROR('#2: var x = \"MAX_VALUE\"; x in Number === true');\n}\n\n//CHECK#3\nvar y = Number;\nif (\"MAX_VALUE\" in y !== true) {\n $ERROR('#3: var y = Number; \"MAX_VALUE\" in y === true');\n}\n\n//CHECK#4\nvar x = \"MAX_VALUE\";\nvar y = Number;\nif (x in y !== true) {\n $ERROR('#4: var x = \"MAX_VALUE\"; var y = Number; x in y === true');\n}\n\n",
"id": "S11.8.7_A2.1_T1"
},
{
"section": "11.8.7",
"description": "If GetBase(RelationalExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n MAX_VALUE in Number;\n $ERROR('#1.1: MAX_VALUE in Number throw ReferenceError. Actual: ' + (MAX_VALUE in Number)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: MAX_VALUE in Number throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.8.7_A2.1_T2"
},
{
"section": "11.8.7",
"description": "If GetBase(ShiftExpression) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n \"MAX_VALUE\" in NUMBER;\n $ERROR('#1.1: \"MAX_VALUE\" in NUMBER throw ReferenceError. Actual: ' + (\"MAX_VALUE\" in NUMBER)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: \"MAX_VALUE\" in NUMBER throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
"id": "S11.8.7_A2.1_T3"
},
{
"section": "11.8.7",
"description": "Checking with \"=\"",
"test": "//CHECK#1 \nvar NUMBER = 0;\nif ((NUMBER = Number, \"MAX_VALUE\") in NUMBER !== true) {\n $ERROR('#1: var NUMBER = 0; (NUMBER = Number, \"MAX_VALUE\") in NUMBER === true');\n}\n\n//CHECK#2\nvar max_value = \"MAX_VALUE\"; \nif (max_value in (max_value = \"none\", Number) !== true) {\n $ERROR('#2: var max_value = \"MAX_VALUE\"; max_value in (max_value = \"none\", Number) === true');\n}\n\n",
"id": "S11.8.7_A2.4_T1"
},
{
"section": "11.8.7",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() in y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() in y() throw \"x\". Actual: ' + (x() in y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() in y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.8.7_A2.4_T2"
},
{
"section": "11.8.7",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n max_value in (max_value = \"MAX_VALUE\", Number);\n $ERROR('#1.1: max_value in (max_value = \"MAX_VALUE\", Number) throw ReferenceError. Actual: ' + (max_value in (max_value = \"MAX_VALUE\", Number))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: max_value in (max_value = \"MAX_VALUE\", Number) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((NUMBER = Number, \"MAX_VALUE\") in NUMBER !== true) {\n $ERROR('#2: (NUMBER = Number, \"MAX_VALUE\") in NUMBER !== true');\n}\n\n",
"id": "S11.8.7_A2.4_T3"
},
{
"section": "11.8.7",
"description": "Checking all the types of primitives",
"test": "//CHECK#1\ntry {\n \"toString\" in true;\n $ERROR('#1: \"toString\" in true throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#1: \"toString\" in true throw TypeError'); \n }\n}\n\n//CHECK#2\ntry {\n \"MAX_VALUE\" in 1;\n $ERROR('#2: \"MAX_VALUE\" in 1 throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#2: \"MAX_VALUE\" in 1 throw TypeError'); \n }\n}\n\n//CHECK#3\ntry {\n \"length\" in \"string\";\n $ERROR('#3: \"length\" in \"string\" throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#3: \"length\" in \"string\" throw TypeError'); \n }\n}\n\n//CHECK#4\ntry {\n \"toString\" in undefined;\n $ERROR('#4: \"toString\" in undefined throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#4: \"toString\" in undefined throw TypeError'); \n }\n}\n\n//CHECK#5\ntry {\n \"toString\" in null;\n $ERROR('#5: \"toString\" in null throw TypeError'); \n}\ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#5: \"toString\" in null throw TypeError'); \n }\n}\n",
"id": "S11.8.7_A3"
},
{
"section": "11.8.7, 9.8",
"description": ": Checking ToString coversion;;",
"test": "//CHECK#1\nvar object = {};\nobject[\"true\"] = 1;\nif (true in object !== \"true\" in object) { \n $ERROR('#1: \"var object = {}; object[\"true\"] = 1; true in object === \"true\" in object'); \n}\n\n//CHECK#2\nvar object = {};\nobject.Infinity = 1;\nif (Infinity in object !== \"Infinity\" in object) { \n $ERROR('#2: \"var object = {}; object.Infinity = 1; Infinity in object === \"Infinity\" in object'); \n}\n\n//CHECK#4\nvar object = {};\nobject.undefined = 1;\nif (undefined in object !== \"undefined\" in object) { \n $ERROR('#4: \"var object = {}; object.undefined = 1; undefined in object === \"undefined\" in object'); \n}\n\n//CHECK#5\nvar object = {};\nobject[\"null\"] = 1;\nif (null in object !== \"null\" in object) { \n $ERROR('#5: \"var object = {}; object[\"null\"] = 1; null in object === \"null\" in object'); \n}\n",
"id": "S11.8.7_A4"
}
]
}
}

View File

@ -0,0 +1,182 @@
{
"testCollection": {
"name": "11.9.1_The_Equals_Operator",
"numTests": 29,
"tests": [
{
"section": "11.9.1, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"true\\u0009==\\u00091\") !== true) {\n $ERROR('#1: (true\\\\u0009==\\\\u00091) === true');\n}\n\n//CHECK#2\nif (eval(\"true\\u000B==\\u000B1\") !== true) {\n $ERROR('#2: (true\\\\u000B==\\\\u000B1) === true'); \n}\n\n//CHECK#3\nif (eval(\"true\\u000C==\\u000C1\") !== true) {\n $ERROR('#3: (true\\\\u000C==\\\\u000C1) === true');\n}\n\n//CHECK#4\nif (eval(\"true\\u0020==\\u00201\") !== true) {\n $ERROR('#4: (true\\\\u0020==\\\\u00201) === true');\n}\n\n//CHECK#5\nif (eval(\"true\\u00A0==\\u00A01\") !== true) {\n $ERROR('#5: (true\\\\u00A0==\\\\u00A01) === true');\n}\n\n//CHECK#6\nif (eval(\"true\\u000A==\\u000A1\") !== true) {\n $ERROR('#6: (true\\\\u000A==\\\\u000A1) === true'); \n}\n\n//CHECK#7\nif (eval(\"true\\u000D==\\u000D1\") !== true) {\n $ERROR('#7: (true\\\\u000D==\\\\u000D1) === true');\n}\n\n//CHECK#8\nif (eval(\"true\\u2028==\\u20281\") !== true) {\n $ERROR('#8: (true\\\\u2028==\\\\u20281) === true');\n}\n\n//CHECK#9\nif (eval(\"true\\u2029==\\u20291\") !== true) {\n $ERROR('#9: (true\\\\u2029==\\\\u20291) === true');\n}\n\n//CHECK#10\nif (eval(\"true\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029==\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== true) {\n $ERROR('#10: (true\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029==\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === true');\n}\n",
"id": "S11.9.1_A1"
},
{
"section": "11.9.1",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((1 == 1) !== true) {\n $ERROR('#1: (1 == 1) === true');\n}\n\n//CHECK#2\nvar x = 1;\nif ((x == 1) !== true) {\n $ERROR('#2: var x = 1; (x == 1) === true');\n}\n\n//CHECK#3\nvar y = 1;\nif ((1 == y) !== true) {\n $ERROR('#3: var y = 1; (1 == y) === true');\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif ((x == y) !== true) {\n $ERROR('#4: var x = 1; var y = 1; (x == y) === true');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif ((objectx.prop == objecty.prop) !== true) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop == objecty.prop) === true');\n}\n",
"id": "S11.9.1_A2.1_T1"
},
{
"section": "11.9.1",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x == 1;\n $ERROR('#1.1: x == 1 throw ReferenceError. Actual: ' + (x == 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x == 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.1_A2.1_T2"
},
{
"section": "11.9.1",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 == y;\n $ERROR('#1.1: 1 == y throw ReferenceError. Actual: ' + (1 == y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 == y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.1_A2.1_T3"
},
{
"section": "11.9.1",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif (((x = 1) == x) !== true) {\n $ERROR('#1: var x = 0; ((x = 1) == x) === true');\n}\n\n//CHECK#2\nvar x = 0; \nif ((x == (x = 1)) !== false) {\n $ERROR('#2: var x = 0; (x == (x = 1)) === false');\n}\n\n",
"id": "S11.9.1_A2.4_T1"
},
{
"section": "11.9.1",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() == y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() == y() throw \"x\". Actual: ' + (x() == y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() == y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.9.1_A2.4_T2"
},
{
"section": "11.9.1",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x == (x = 1);\n $ERROR('#1.1: x == (x = 1) throw ReferenceError. Actual: ' + (x == (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x == (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (((y = 1) == y) !== true) {\n $ERROR('#2: ((y = 1) == y) === true');\n}\n\n",
"id": "S11.9.1_A2.4_T3"
},
{
"section": "11.9.1, 11.9.3",
"description": "x and y are boolean primitives",
"test": "//CHECK#1\nif ((true == true) !== true) {\n $ERROR('#1: (true == true) === true');\n}\n\n//CHECK#2\nif ((false == false) !== true) {\n $ERROR('#2: (false == false) === true');\n}\n\n//CHECK#3\nif ((true == false) !== false) {\n $ERROR('#3: (true == false) === false');\n}\n\n//CHECK#4\nif ((false == true) !== false) {\n $ERROR('#4: (false == true) === false');\n}\n",
"id": "S11.9.1_A3.1"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is primitive boolean, y is primitive number",
"test": "//CHECK#1\nif ((true == 1) !== true) {\n $ERROR('#1: (true == 1) === true');\n}\n\n//CHECK#2\nif ((false == \"0\") !== true) {\n $ERROR('#2: (false == \"0\") === true');\n}\n",
"id": "S11.9.1_A3.2"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is primitive number, y is primitive boolean",
"test": "//CHECK#1\nif ((0 == false) !== true) {\n $ERROR('#1: (0 == false) === true');\n}\n\n//CHECK#2\nif ((\"1\" == true) !== true) {\n $ERROR('#2: (\"1\" == true) === true');\n}\n",
"id": "S11.9.1_A3.3"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is NaN",
"test": "//CHECK#1\nif ((Number.NaN == true) !== false) {\n $ERROR('#1: (NaN == true) === false');\n}\n\n//CHECK#2\nif ((Number.NaN == 1) !== false) {\n $ERROR('#2: (NaN == 1) === false');\n}\n\n//CHECK#3\nif ((Number.NaN == Number.NaN) !== false) {\n $ERROR('#3: (NaN == NaN) === false');\n}\n\n//CHECK#4\nif ((Number.NaN == Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#4: (NaN == +Infinity) === false');\n}\n\n//CHECK#5\nif ((Number.NaN == Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#5: (NaN == -Infinity) === false');\n}\n\n//CHECK#6\nif ((Number.NaN == Number.MAX_VALUE) !== false) {\n $ERROR('#6: (NaN == Number.MAX_VALUE) === false');\n}\n\n//CHECK#7\nif ((Number.NaN == Number.MIN_VALUE) !== false) {\n $ERROR('#7: (NaN == Number.MIN_VALUE) === false');\n}\n\n//CHECK#8\nif ((Number.NaN == \"string\") !== false) {\n $ERROR('#8: (NaN == \"string\") === false');\n}\n\n//CHECK#9\nif ((Number.NaN == new Object()) !== false) {\n $ERROR('#9: (NaN == new Object()) === false');\n}\n\n",
"id": "S11.9.1_A4.1_T1"
},
{
"section": "11.9.1, 11.9.3",
"description": "y is NaN",
"test": "//CHECK#1\nif ((true == Number.NaN) !== false) {\n $ERROR('#1: (true == NaN) === false');\n}\n\n//CHECK#2\nif ((-1 == Number.NaN) !== false) {\n $ERROR('#2: (-1 == NaN) === false');\n}\n\n//CHECK#3\nif ((Number.NaN == Number.NaN) !== false) {\n $ERROR('#3: (NaN == NaN) === false');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY == Number.NaN) !== false) {\n $ERROR('#4: (+Infinity == NaN) === false');\n}\n\n//CHECK#5\nif ((Number.NEGATIVE_INFINITY == Number.NaN) !== false) {\n $ERROR('#5: (-Infinity == NaN) === false');\n}\n\n//CHECK#6\nif ((Number.MAX_VALUE == Number.NaN) !== false) {\n $ERROR('#6: (Number.MAX_VALUE == NaN) === false');\n}\n\n//CHECK#7\nif ((Number.MIN_VALUE == Number.NaN) !== false) {\n $ERROR('#7: (Number.MIN_VALUE == NaN) === false');\n}\n\n//CHECK#8\nif ((\"string\" == Number.NaN) !== false) {\n $ERROR('#8: (\"string\" == NaN) === false');\n}\n\n//CHECK#9\nif ((new Object() == Number.NaN) !== false) {\n $ERROR('#9: (new Object() == NaN) === false');\n}\n",
"id": "S11.9.1_A4.1_T2"
},
{
"section": "11.9.1, 11.9.3",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((+0 == -0) !== true) {\n $ERROR('#1: (+0 == -0) === true');\n}\n\n//CHECK#2\nif ((-0 == +0) !== true) {\n $ERROR('#2: (-0 == +0) === true');\n}\n",
"id": "S11.9.1_A4.2"
},
{
"section": "11.9.1, 11.9.3",
"description": "x and y are primitive numbers",
"test": "//CHECK#1\nif ((Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#1: (+Infinity == +Infinity) === true');\n}\n\n//CHECK#2\nif ((Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#2: (-Infinity == -Infinity) === true');\n}\n\n//CHECK#3\nif ((Number.POSITIVE_INFINITY == -Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#3: (+Infinity == -(-Infinity)) === true');\n}\n\n//CHECK#4\nif ((1 == 0.999999999999) !== false) {\n $ERROR('#4: (1 == 0.999999999999) === false');\n}\n\n//CHECK#5\nif ((1.0 == 1) !== true) {\n $ERROR('#5: (1.0 == 1) === true');\n}\n",
"id": "S11.9.1_A4.3"
},
{
"section": "11.9.1, 11.9.3",
"description": "x and y are primitive string",
"test": "//CHECK#1\nif ((\"\" == \"\") !== true) {\n $ERROR('#1: (\"\" == \"\") === true');\n}\n\n//CHECK#2\nif ((\" \" == \" \") !== true) {\n $ERROR('#2: \" (\" == \" \") === true');\n}\n\n//CHECK#3\nif ((\" \" == \"\") !== false) {\n $ERROR('#3: \" (\" == \"\") === false');\n}\n\n//CHECK#4\nif ((\"string\" == \"string\") !== true) {\n $ERROR('#4: (\"string\" == \"string\") === true');\n}\n\n//CHECK#5\nif ((\" string\" == \"string \") !== false) {\n $ERROR('#5: (\" string\" == \"string \") === false');\n}\n\n//CHECK#6\nif ((\"1.0\" == \"1\") !== false) {\n $ERROR('#6: (\"1.0\" == \"1\") === false');\n}\n\n//CHECK#7\nif ((\"0xff\" == \"255\") !== false) {\n $ERROR('#7: (\"0xff\" == \"255\") === false');\n}\n",
"id": "S11.9.1_A5.1"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is primitive number, y is primitive string",
"test": "//CHECK#1\nif ((1 == \"1\") !== true) {\n $ERROR('#1: (1 == \"1\") === true');\n}\n\n//CHECK#2\nif ((1.100 == \"+1.10\") !== true) {\n $ERROR('#2: (1.100 == \"+1.10\") === true');\n}\n\n//CHECK#3\nif ((1 == \"true\") !== false) {\n $ERROR('#3: (1 == \"true\") === false');\n}\n\n//CHECK#4\nif ((255 == \"0xff\") !== true) {\n $ERROR('#4: (255 == \"0xff\") === true');\n}\n\n//CHECK#5\nif ((0 == \"\") !== true) {\n $ERROR('#5: (0 == \"\") === true');\n}\n",
"id": "S11.9.1_A5.2"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is primitive string, y is primitive number",
"test": "//CHECK#1\nif ((\"-1\" == -1) !== true) {\n $ERROR('#1: (\"-1\" == -1) === true');\n}\n\n//CHECK#2\nif ((\"-1.100\" == -1.10) !== true) {\n $ERROR('#2: (\"-1.100\" == -1.10) === true');\n}\n\n//CHECK#3\nif ((\"false\" == 0) !== false) {\n $ERROR('#3: (\"false\" == 0) === false');\n}\n\n//CHECK#4\nif ((\"5e-324\" == 5e-324) !== true) {\n $ERROR('#4: (\"5e-324\" == 5e-324) === true');\n}\n\n",
"id": "S11.9.1_A5.3"
},
{
"section": "11.9.1, 11.9.3",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((undefined == undefined) !== true) {\n $ERROR('#1: (undefined == undefined) === true');\n}\n\n//CHECK#2\nif ((void 0 == undefined) !== true) {\n $ERROR('#2: (void 0 == undefined) === true');\n}\n\n//CHECK#3\nif ((undefined == eval(\"var x\")) !== true) {\n $ERROR('#3: (undefined == eval(\"var x\")) === true');\n}\n\n//CHECK#4\nif ((undefined == null) !== true) {\n $ERROR('#4: (undefined == null) === true');\n}\n\n//CHECK#5\nif ((null == void 0) !== true) {\n $ERROR('#5: (null == void 0) === true');\n}\n\n//CHECK#6\nif ((null == null) !== true) {\n $ERROR('#6: (null == null) === true');\n}\n",
"id": "S11.9.1_A6.1"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is null or undefined, y is not",
"test": "//CHECK#1\nif ((undefined == true) !== false) {\n $ERROR('#1: (undefined == true) === false');\n}\n\n//CHECK#2\nif ((undefined == 0) !== false) {\n $ERROR('#2: (undefined == 0) === false');\n}\n\n//CHECK#3\nif ((undefined == \"undefined\") !== false) {\n $ERROR('#3: (undefined == \"undefined\") === false');\n}\n\n//CHECK#4\nif ((undefined == {}) !== false) {\n $ERROR('#4: (undefined == {}) === false');\n}\n\n//CHECK#5\nif ((null == false) !== false) {\n $ERROR('#5: (null == false) === false');\n}\n\n//CHECK#6\nif ((null == 0) !== false) {\n $ERROR('#6: (null == 0) === false');\n}\n\n//CHECK#7\nif ((null == \"null\") !== false) {\n $ERROR('#7: (null == \"null\") === false');\n}\n\n//CHECK#8\nif ((null == {}) !== false) {\n $ERROR('#8: (null == {}) === false');\n}\n",
"id": "S11.9.1_A6.2_T1"
},
{
"section": "11.9.1, 11.9.3",
"description": "y is null or undefined, x is not",
"test": "//CHECK#1\nif ((false == undefined) !== false) {\n $ERROR('#1: (false == undefined) === false');\n}\n\n//CHECK#2\nif ((Number.NaN == undefined) !== false) {\n $ERROR('#2: (Number.NaN == undefined) === false');\n}\n\n//CHECK#3\nif ((\"undefined\" == undefined) !== false) {\n $ERROR('#3: (\"undefined\" == undefined) === false');\n}\n\n//CHECK#4\nif (({} == undefined) !== false) {\n $ERROR('#4: ({} == undefined) === false');\n}\n\n//CHECK#5\nif ((false == null) !== false) {\n $ERROR('#5: (false == null) === false');\n}\n\n//CHECK#6\nif ((0 == null) !== false) {\n $ERROR('#6: (0 == null) === false');\n}\n\n//CHECK#7\nif ((\"null\" == null) !== false) {\n $ERROR('#7: (\"null\" == null) === false');\n}\n\n//CHECK#8\nif (({} == null) !== false) {\n $ERROR('#8: ({} == null) === false');\n}\n",
"id": "S11.9.1_A6.2_T2"
},
{
"section": "11.9.1, 11.9.3",
"description": "Checking Boolean object, Number object, String object, Object object",
"test": "//CHECK#1\nif ((new Boolean(true) == new Boolean(true)) !== false) {\n $ERROR('#1: (new Boolean(true) == new Boolean(true)) === false');\n}\n\n//CHECK#2\nif ((new Number(1) == new Number(1)) !== false) {\n $ERROR('#2: (new Number(1) == new Number(1)) === false');\n}\n\n//CHECK#3\nif ((new String(\"x\") == new String(\"x\")) !== false) {\n $ERROR('#3: (new String(\"x\") == new String(\"x\")) === false');\n}\n\n//CHECK#4\nif ((new Object() == new Object()) !== false) {\n $ERROR('#4: (new Object() == new Object()) === false');\n}\n\n//CHECK#5\nx = {}; \ny = x;\nif ((x == y) !== true) {\n $ERROR('#5: x = {}; y = x; (x == y) === true');\n}\n\n//CHECK#6\nif ((new Boolean(true) == new Number(1)) !== false) {\n $ERROR('#6 (new Boolean(true) == new Number(1)) === false');\n}\n\n//CHECK#7\nif ((new Number(1) == new String(\"1\")) !== false) {\n $ERROR('#7: (new Number(1) == new String(\"1\")) === false');\n}\n\n//CHECK#8\nif ((new String(\"1\") == new Boolean(true)) !== false) {\n $ERROR('#8: (new String(\"x\") == new Boolean(true)) === false');\n}\n",
"id": "S11.9.1_A7.1"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is object, y is primitive boolean",
"test": "//CHECK#1\nif ((new Boolean(true) == true) !== true) {\n $ERROR('#1: (new Boolean(true) == true) === true');\n}\n\n//CHECK#2\nif ((new Number(1) == true) !== true) {\n $ERROR('#2: (new Number(1) == true) === true');\n}\n\n//CHECK#3\nif ((new String(\"1\") == true) !== true) {\n $ERROR('#3: (new String(\"1\") == true) === true');\n}\n",
"id": "S11.9.1_A7.2"
},
{
"section": "11.9.1, 11.9.3",
"description": "y is object, x is primitive boolean",
"test": "//CHECK#1\nif ((true == new Boolean(true)) !== true) {\n $ERROR('#1: (true == new Boolean(true)) === true');\n}\n\n//CHECK#2\nif ((true == new Number(1)) !== true) {\n $ERROR('#2: (true == new Number(1)) === true');\n}\n\n//CHECK#3\nif ((true == new String(\"+1\")) !== true) {\n $ERROR('#3: (true == new String(\"+1\")) === true');\n}\n",
"id": "S11.9.1_A7.3"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is object, y is primitive number",
"test": "//CHECK#1\nif ((new Boolean(true) == 1) !== true) {\n $ERROR('#1: (new Boolean(true) == 1) === true');\n}\n\n//CHECK#2\nif ((new Number(-1) == -1) !== true) {\n $ERROR('#2: (new Number(-1) == -1) === true');\n}\n\n//CHECK#3\nif ((new String(\"-1\") == -1) !== true) {\n $ERROR('#3: (new String(\"-1\") == -1) === true');\n}\n",
"id": "S11.9.1_A7.4"
},
{
"section": "11.9.1, 11.9.3",
"description": "y is object, x is primitive number",
"test": "//CHECK#1\nif ((1 == new Boolean(true)) !== true) {\n $ERROR('#1: (1 == new Boolean(true)) === true');\n}\n\n//CHECK#2\nif ((-1 == new Number(-1)) !== true) {\n $ERROR('#2: (-1 == new Number(-1)) === true');\n}\n\n//CHECK#3\nif ((-1 == new String(\"-1\")) !== true) {\n $ERROR('#3: (-1 == new String(\"-1\")) === true');\n}\n",
"id": "S11.9.1_A7.5"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is object, y is primitive string",
"test": "//CHECK#1\nif ((new Boolean(true) == \"1\") !== true) {\n $ERROR('#1: (new Boolean(true) == \"1\") === true');\n}\n\n//CHECK#2\nif ((new Number(-1) == \"-1\") !== true) {\n $ERROR('#2: (new Number(-1) == \"-1\") === true');\n}\n\n//CHECK#3\nif ((new String(\"x\") == \"x\") !== true) {\n $ERROR('#3: (new String(\"x\") == \"x\") === true');\n}\n",
"id": "S11.9.1_A7.6"
},
{
"section": "11.9.1, 11.9.3",
"description": "y is object, x is primitive string",
"test": "//CHECK#1\nif ((\"1\" == new Boolean(true)) !== true) {\n $ERROR('#1: (\"1\" == new Boolean(true)) === true');\n}\n\n//CHECK#2\nif ((\"-1\" == new Number(-1)) !== true) {\n $ERROR('#2: (\"-1\" == new Number(-1)) === true');\n}\n\n//CHECK#3\nif ((\"x\" == new String(\"x\")) !== true) {\n $ERROR('#3: (\"x\" == new String(\"x\")) === true');\n}\n",
"id": "S11.9.1_A7.7"
},
{
"section": "11.9.1, 11.9.3",
"description": "x is object, y is primtitive",
"test": "//CHECK#1\nif (({valueOf: function() {return 1}} == true) !== true) {\n $ERROR('#1: ({valueOf: function() {return 1}} == true) === true');\n}\n\n//CHECK#2\nif (({valueOf: function() {return 1}, toString: function() {return 0}} == 1) !== true) {\n $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} == 1) === true');\n}\n\n//CHECK#3\nif (({valueOf: function() {return 1}, toString: function() {return {}}} == \"+1\") !== true) {\n $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} == \"+1\") === true');\n} \n \n//CHECK#4\ntry {\n if (({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} == true) !== true) {\n $ERROR('#4.1: ({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} == true) === true');\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: ({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} == true) not throw \"error\"');\n } else {\n $ERROR('#4.3: ({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} == true) not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (({toString: function() {return \"+1\"}} == 1) !== true) {\n $ERROR('#5: ({toString: function() {return \"+1\"}} == 1) === true');\n}\n\n//CHECK#6\nif (({valueOf: function() {return {}}, toString: function() {return \"+1\"}} == \"1\") !== false) {\n $ERROR('#6.1: ({valueOf: function() {return {}}, toString: function() {return \"+1\"}} == \"1\") === false');\n} else {\n if (({valueOf: function() {return {}}, toString: function() {return \"+1\"}} == \"+1\") !== true) {\n $ERROR('#6.2: ({valueOf: function() {return {}}, toString: function() {return \"+1\"}} == \"+1\") === true');\n }\n}\n\n//CHECK#7\ntry {\n ({valueOf: function() {throw \"error\"}, toString: function() {return 1}} == 1);\n $ERROR('#7.1: ({valueOf: function() {throw \"error\"}, toString: function() {return 1}} == 1) throw \"error\". Actual: ' + (({valueOf: function() {throw \"error\"}, toString: function() {return 1}} == 1)));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: ({valueOf: function() {throw \"error\"}, toString: function() {return 1}} == 1) throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n ({valueOf: function() {return {}}, toString: function() {return {}}} == 1);\n $ERROR('#8.1: ({valueOf: function() {return {}}, toString: function() {return {}}} == 1) throw TypeError. Actual: ' + (({valueOf: function() {return {}}, toString: function() {return {}}} == 1)));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: ({valueOf: function() {return {}}, toString: function() {return {}}} == 1) throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.9.1_A7.8"
},
{
"section": "11.9.1, 11.9.3",
"description": "y is object, x is primtitive",
"test": "//CHECK#1\nif ((true == {valueOf: function() {return 1}}) !== true) {\n $ERROR('#1: (true == {valueOf: function() {return 1}}) === true');\n}\n\n//CHECK#2\nif ((1 == {valueOf: function() {return 1}, toString: function() {return 0}}) !== true) {\n $ERROR('#2: (1 == {valueOf: function() {return 1}, toString: function() {return 0}}) === true');\n}\n\n//CHECK#3\nif ((\"+1\" == {valueOf: function() {return 1}, toString: function() {return {}}}) !== true) {\n $ERROR('#3: (\"+1\" == {valueOf: function() {return 1}, toString: function() {return {}}}) === true');\n} \n \n//CHECK#4\ntry {\n if ((true == {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) !== true) {\n $ERROR('#4.1: (true == {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) === true');\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: (true == {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) not throw \"error\"');\n } else {\n $ERROR('#4.3: (true == {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif ((1 == {toString: function() {return \"+1\"}}) !== true) {\n $ERROR('#5: (1 == {toString: function() {return \"+1\"}}) === true');\n}\n\n//CHECK#6\nif ((\"1\" == {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) !== false) {\n $ERROR('#6.1: (\"1\" == {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) === false');\n} else {\n if ((\"+1\" == {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) !== true) {\n $ERROR('#6.2: (\"+1\" == {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) === true');\n }\n}\n\n//CHECK#7\ntry {\n (1 == {valueOf: function() {throw \"error\"}, toString: function() {return 1}});\n $ERROR('#7.1: (1 == {valueOf: function() {throw \"error\"}, toString: function() {return 1}}) throw \"error\". Actual: ' + ((1 == {valueOf: function() {throw \"error\"}, toString: function() {return 1}})));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: (1 == {valueOf: function() {throw \"error\"}, toString: function() {return 1}}) throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n (1 == {valueOf: function() {return {}}, toString: function() {return {}}});\n $ERROR('#8.1: (1 == {valueOf: function() {return {}}, toString: function() {return {}}}) throw TypeError. Actual: ' + ((1 == {valueOf: function() {return {}}, toString: function() {return {}}})));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: (1 == {valueOf: function() {return {}}, toString: function() {return {}}}) throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.9.1_A7.9"
}
]
}
}

View File

@ -0,0 +1,182 @@
{
"testCollection": {
"name": "11.9.2_The_Does_not_equals_Operator",
"numTests": 29,
"tests": [
{
"section": "11.9.2, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"true\\u0009!=\\u00091\") !== false) {\n $ERROR('#1: (true\\\\u0009!=\\\\u00091) === false');\n}\n\n//CHECK#2\nif (eval(\"true\\u000B!=\\u000B1\") !== false) {\n $ERROR('#2: (true\\\\u000B!=\\\\u000B1) === false'); \n}\n\n//CHECK#3\nif (eval(\"true\\u000C!=\\u000C1\") !== false) {\n $ERROR('#3: (true\\\\u000C!=\\\\u000C1) === false');\n}\n\n//CHECK#4\nif (eval(\"true\\u0020!=\\u00201\") !== false) {\n $ERROR('#4: (true\\\\u0020!=\\\\u00201) === false');\n}\n\n//CHECK#5\nif (eval(\"true\\u00A0!=\\u00A01\") !== false) {\n $ERROR('#5: (true\\\\u00A0!=\\\\u00A01) === false');\n}\n\n//CHECK#6\nif (eval(\"true\\u000A!=\\u000A1\") !== false) {\n $ERROR('#6: (true\\\\u000A!=\\\\u000A1) === false'); \n}\n\n//CHECK#7\nif (eval(\"true\\u000D!=\\u000D1\") !== false) {\n $ERROR('#7: (true\\\\u000D!=\\\\u000D1) === false');\n}\n\n//CHECK#8\nif (eval(\"true\\u2028!=\\u20281\") !== false) {\n $ERROR('#8: (true\\\\u2028!=\\\\u20281) === false');\n}\n\n//CHECK#9\nif (eval(\"true\\u2029!=\\u20291\") !== false) {\n $ERROR('#9: (true\\\\u2029!=\\\\u20291) === false');\n}\n\n//CHECK#10\nif (eval(\"true\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029!=\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== false) {\n $ERROR('#10: (true\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029!=\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291) === false');\n}\n",
"id": "S11.9.2_A1"
},
{
"section": "11.9.2",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif ((1 != 1) !== false) {\n $ERROR('#1: (1 != 1) === false');\n}\n\n//CHECK#2\nvar x = 1;\nif ((x != 1) !== false) {\n $ERROR('#2: var x = 1; (x != 1) === false');\n}\n\n//CHECK#3\nvar y = 1;\nif ((1 != y) !== false) {\n $ERROR('#3: var y = 1; (1 != y) === false');\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif ((x != y) !== false) {\n $ERROR('#4: var x = 1; var y = 1; (x != y) === false');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif ((objectx.prop != objecty.prop) !== false) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop != objecty.prop) === false');\n}\n",
"id": "S11.9.2_A2.1_T1"
},
{
"section": "11.9.2",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x != 1;\n $ERROR('#1.1: x != 1 throw ReferenceError. Actual: ' + (x != 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x != 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.2_A2.1_T2"
},
{
"section": "11.9.2",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 != y;\n $ERROR('#1: 1 != y throw ReferenceError'); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 != y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.2_A2.1_T3"
},
{
"section": "11.9.2",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif (((x = 1) != x) !== false) {\n $ERROR('#1: var x = 0; ((x = 1) != x) === false');\n}\n\n//CHECK#2\nvar x = 0; \nif ((x != (x = 1)) !== true) {\n $ERROR('#2: var x = 0; (x != (x = 1)) === true');\n}\n\n",
"id": "S11.9.2_A2.4_T1"
},
{
"section": "11.9.2",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() != y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() != y() throw \"x\". Actual: ' + (x() != y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() != y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.9.2_A2.4_T2"
},
{
"section": "11.9.2",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x != (x = 1);\n $ERROR('#1.1: x != (x = 1) throw ReferenceError. Actual: ' + (x != (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x != (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (((y = 1) != y) !== false) {\n $ERROR('#2: ((y = 1) != y) === false');\n}\n\n",
"id": "S11.9.2_A2.4_T3"
},
{
"section": "11.9.2, 11.9.3",
"description": "x and y are boolean primitives",
"test": "//CHECK#1\nif ((true != true) !== false) {\n $ERROR('#1: (true != true) === false');\n}\n\n//CHECK#2\nif ((false != false) !== false) {\n $ERROR('#2: (false != false) === false');\n}\n\n//CHECK#3\nif ((true != false) !== true) {\n $ERROR('#3: (true != false) === true');\n}\n\n//CHECK#4\nif ((false != true) !== true) {\n $ERROR('#4: (false != true) === true');\n}\n",
"id": "S11.9.2_A3.1"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is primitive boolean, y is primitive number",
"test": "//CHECK#1\nif ((true != 1) !== false) {\n $ERROR('#1: (true != 1) === false');\n}\n\n//CHECK#2\nif ((false != \"0\") !== false) {\n $ERROR('#2: (false != \"0\") === false');\n}\n\n//CHECK#3\nif ((true != new Boolean(true)) !== false) {\n $ERROR('#3: (true != new Boolean(true)) === false');\n}\n\n//CHECK#4\nif ((true != {valueOf: function () {return 1}}) !== false) {\n $ERROR('#4: (true != {valueOf: function () {return 1}}) === false');\n}\n\n",
"id": "S11.9.2_A3.2"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is primitive number, y is primitive boolean",
"test": "//CHECK#1\nif ((0 != false) !== false) {\n $ERROR('#1: (0 != false) === false');\n}\n\n//CHECK#2\nif ((\"1\" != true) !== false) {\n $ERROR('#2: (\"1\" != true) === false');\n}\n\n//CHECK#3\nif ((new Boolean(false) != false) !== false) {\n $ERROR('#3: (new Boolean(false) != false) === false');\n}\n\n//CHECK#4\nif (({valueOf: function () {return \"0\"}} != false) !== false) {\n $ERROR('#4: ({valueOf: function () {return \"0\"}} != false) === false');\n}\n",
"id": "S11.9.2_A3.3"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is NaN",
"test": "//CHECK#1\nif ((Number.NaN != true) !== true) {\n $ERROR('#1: (NaN != true) === true');\n}\n\n//CHECK#2\nif ((Number.NaN != 1) !== true) {\n $ERROR('#2: (NaN != 1) === true');\n}\n\n//CHECK#3\nif ((Number.NaN != Number.NaN) !== true) {\n $ERROR('#3: (NaN != NaN) === true');\n}\n\n//CHECK#4\nif ((Number.NaN != Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: (NaN != +Infinity) === true');\n}\n\n//CHECK#5\nif ((Number.NaN != Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#5: (NaN != -Infinity) === true');\n}\n\n//CHECK#6\nif ((Number.NaN != Number.MAX_VALUE) !== true) {\n $ERROR('#6: (NaN != Number.MAX_VALUE) === true');\n}\n\n//CHECK#7\nif ((Number.NaN != Number.MIN_VALUE) !== true) {\n $ERROR('#7: (NaN != Number.MIN_VALUE) === true');\n}\n\n//CHECK#8\nif ((Number.NaN != \"string\") !== true) {\n $ERROR('#8: (NaN != \"string\") === true');\n}\n\n//CHECK#9\nif ((Number.NaN != new Object()) !== true) {\n $ERROR('#9: (NaN != new Object()) === true');\n}\n\n",
"id": "S11.9.2_A4.1_T1"
},
{
"section": "11.9.2, 11.9.3",
"description": "y is NaN",
"test": "//CHECK#1\nif ((true != Number.NaN) !== true) {\n $ERROR('#1: (true != NaN) === true');\n}\n\n//CHECK#2\nif ((-1 != Number.NaN) !== true) {\n $ERROR('#2: (-1 != NaN) === true');\n}\n\n//CHECK#3\nif ((Number.NaN != Number.NaN) !== true) {\n $ERROR('#3: (NaN != NaN) === true');\n}\n\n//CHECK#4\nif ((Number.POSITIVE_INFINITY != Number.NaN) !== true) {\n $ERROR('#4: (+Infinity != NaN) === true');\n}\n\n//CHECK#5\nif ((Number.NEGATIVE_INFINITY != Number.NaN) !== true) {\n $ERROR('#5: (-Infinity != NaN) === true');\n}\n\n//CHECK#6\nif ((Number.MAX_VALUE != Number.NaN) !== true) {\n $ERROR('#6: (Number.MAX_VALUE != NaN) === true');\n}\n\n//CHECK#7\nif ((Number.MIN_VALUE != Number.NaN) !== true) {\n $ERROR('#7: (Number.MIN_VALUE != NaN) === true');\n}\n\n//CHECK#8\nif ((\"string\" != Number.NaN) !== true) {\n $ERROR('#8: (\"string\" != NaN) === true');\n}\n\n//CHECK#9\nif ((new Object() != Number.NaN) !== true) {\n $ERROR('#9: (new Object() != NaN) === true');\n}\n",
"id": "S11.9.2_A4.1_T2"
},
{
"section": "11.9.2, 11.9.3",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((+0 != -0) !== false) {\n $ERROR('#1: (+0 != -0) === false');\n}\n\n//CHECK#2\nif ((-0 != +0) !== false) {\n $ERROR('#2: (-0 != +0) === false');\n}\n",
"id": "S11.9.2_A4.2"
},
{
"section": "11.9.2, 11.9.3",
"description": "x and y are primitive numbers",
"test": "//CHECK#1\nif ((Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY) !== false) {\n $ERROR('#1: (+Infinity != +Infinity) === false');\n}\n\n//CHECK#2\nif ((Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#2: (-Infinity != -Infinity) === false');\n}\n\n//CHECK#3\nif ((Number.POSITIVE_INFINITY != -Number.NEGATIVE_INFINITY) !== false) {\n $ERROR('#3: (+Infinity != -(-Infinity)) === false');\n}\n\n//CHECK#4\nif ((1 != 0.999999999999) !== true) {\n $ERROR('#4: (1 != 0.999999999999) === true');\n}\n\n//CHECK#5\nif ((1.0 != 1) !== false) {\n $ERROR('#5: (1.0 != 1) === false');\n}\n",
"id": "S11.9.2_A4.3"
},
{
"section": "11.9.2, 11.9.3",
"description": "x and y are primitive strings",
"test": "//CHECK#1\nif ((\"\" != \"\") !== false) {\n $ERROR('#1: (\"\" != \"\") === false');\n}\n\n//CHECK#2\nif ((\" \" != \" \") !== false) {\n $ERROR('#2: \" (\" != \" \") === false');\n}\n\n//CHECK#3\nif ((\" \" != \"\") !== true) {\n $ERROR('#3: \" (\" != \"\") === true');\n}\n\n//CHECK#4\nif ((\"string\" != \"string\") !== false) {\n $ERROR('#4: (\"string\" != \"string\") === false');\n}\n\n//CHECK#5\nif ((\" string\" != \"string \") !== true) {\n $ERROR('#5: (\" string\" != \"string \") === true');\n}\n\n//CHECK#6\nif ((\"1.0\" != \"1\") !== true) {\n $ERROR('#6: (\"1.0\" != \"1\") === true');\n}\n\n//CHECK#7\nif ((\"0xff\" != \"255\") !== true) {\n $ERROR('#7: (\"0xff\" != \"255\") === true');\n}\n",
"id": "S11.9.2_A5.1"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is primitive number, y is primitive string",
"test": "//CHECK#1\nif ((1 != \"1\") !== false) {\n $ERROR('#1: (1 != \"1\") === false');\n}\n\n//CHECK#2\nif ((1.100 != \"+1.10\") !== false) {\n $ERROR('#2: (1.100 != \"+1.10\") === false');\n}\n\n//CHECK#3\nif ((1 != \"true\") !== true) {\n $ERROR('#3: (1 != \"true\") === true');\n}\n\n//CHECK#4\nif ((255 != \"0xff\") !== false) {\n $ERROR('#4: (255 != \"0xff\") === false');\n}\n\n//CHECK#5\nif ((0 != \"\") !== false) {\n $ERROR('#5: (0 != \"\") === false');\n}\n",
"id": "S11.9.2_A5.2"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is primitive string, y is primitive number",
"test": "//CHECK#1\nif ((\"-1\" != -1) !== false) {\n $ERROR('#1: (\"-1\" != -1) === false');\n}\n\n//CHECK#2\nif ((\"-1.100\" != -1.10) !== false) {\n $ERROR('#2: (\"-1.100\" != -1.10) === false');\n}\n\n//CHECK#3\nif ((\"false\" != 0) !== true) {\n $ERROR('#3: (\"false\" != 0) === true');\n}\n\n//CHECK#4\nif ((\"5e-324\" != 5e-324) !== false) {\n $ERROR('#4: (\"5e-324\" != 5e-324) === false');\n}\n\n",
"id": "S11.9.2_A5.3"
},
{
"section": "11.9.2, 11.9.3",
"description": "Checking all combinations",
"test": "//CHECK#1\nif ((undefined != undefined) !== false) {\n $ERROR('#1: (undefined != undefined) === false');\n}\n\n//CHECK#2\nif ((void 0 != undefined) !== false) {\n $ERROR('#2: (void 0 != undefined) === false');\n}\n\n//CHECK#3\nif ((undefined != eval(\"var x\")) !== false) {\n $ERROR('#3: (undefined != eval(\"var x\")) === false');\n}\n\n//CHECK#4\nif ((undefined != null) !== false) {\n $ERROR('#4: (undefined != null) === false');\n}\n\n//CHECK#5\nif ((null != void 0) !== false) {\n $ERROR('#5: (null != void 0) === false');\n}\n\n//CHECK#6\nif ((null != null) !== false) {\n $ERROR('#6: (null != null) === false');\n}\n",
"id": "S11.9.2_A6.1"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is null or undefined, y is not",
"test": "//CHECK#1\nif ((undefined != true) !== true) {\n $ERROR('#1: (undefined != true) === true');\n}\n\n//CHECK#2\nif ((undefined != 0) !== true) {\n $ERROR('#2: (undefined != 0) === true');\n}\n\n//CHECK#3\nif ((undefined != \"undefined\") !== true) {\n $ERROR('#3: (undefined != \"undefined\") === true');\n}\n\n//CHECK#4\nif ((undefined != {}) !== true) {\n $ERROR('#4: (undefined != {}) === true');\n}\n\n//CHECK#5\nif ((null != false) !== true) {\n $ERROR('#5: (null != false) === true');\n}\n\n//CHECK#6\nif ((null != 0) !== true) {\n $ERROR('#6: (null != 0) === true');\n}\n\n//CHECK#7\nif ((null != \"null\") !== true) {\n $ERROR('#7: (null != \"null\") === true');\n}\n\n//CHECK#8\nif ((null != {}) !== true) {\n $ERROR('#8: (null != {}) === true');\n}\n",
"id": "S11.9.2_A6.2_T1"
},
{
"section": "11.9.2, 11.9.3",
"description": "y is null or undefined, x is not",
"test": "//CHECK#1\nif ((false != undefined) !== true) {\n $ERROR('#1: (false != undefined) === true');\n}\n\n//CHECK#2\nif ((Number.NaN != undefined) !== true) {\n $ERROR('#2: (Number.NaN != undefined) === true');\n}\n\n//CHECK#3\nif ((\"undefined\" != undefined) !== true) {\n $ERROR('#3: (\"undefined\" != undefined) === true');\n}\n\n//CHECK#4\nif (({} != undefined) !== true) {\n $ERROR('#4: ({} != undefined) === true');\n}\n\n//CHECK#5\nif ((false != null) !== true) {\n $ERROR('#5: (false != null) === true');\n}\n\n//CHECK#6\nif ((0 != null) !== true) {\n $ERROR('#6: (0 != null) === true');\n}\n\n//CHECK#7\nif ((\"null\" != null) !== true) {\n $ERROR('#7: (\"null\" != null) === true');\n}\n\n//CHECK#8\nif (({} != null) !== true) {\n $ERROR('#8: ({} != null) === true');\n}\n",
"id": "S11.9.2_A6.2_T2"
},
{
"section": "11.9.2, 11.9.3",
"description": "Checking Boolean object, Number object, String object, Object object",
"test": "//CHECK#1\nif ((new Boolean(true) != new Boolean(true)) !== true) {\n $ERROR('#1: (new Boolean(true) != new Boolean(true)) === true');\n}\n\n//CHECK#2\nif ((new Number(1) != new Number(1)) !== true) {\n $ERROR('#2: (new Number(1) != new Number(1)) === true');\n}\n\n//CHECK#3\nif ((new String(\"x\") != new String(\"x\")) !== true) {\n $ERROR('#3: (new String(\"x\") != new String(\"x\")) === true');\n}\n\n//CHECK#4\nif ((new Object() != new Object()) !== true) {\n $ERROR('#4: (new Object() != new Object()) === true');\n}\n\n//CHECK#5\nx = {}; \ny = x;\nif ((x != y) !== false) {\n $ERROR('#5: x = {}; y = x; (x != y) === false');\n}\n\n//CHECK#6\nif ((new Boolean(true) != new Number(1)) !== true) {\n $ERROR('#6 (new Boolean(true) != new Number(1)) === true');\n}\n\n//CHECK#7\nif ((new Number(1) != new String(\"1\")) !== true) {\n $ERROR('#7: (new Number(1) != new String(\"1\")) === true');\n}\n\n//CHECK#8\nif ((new String(\"1\") != new Boolean(true)) !== true) {\n $ERROR('#8: (new String(\"x\") != new Boolean(true)) === true');\n}\n",
"id": "S11.9.2_A7.1"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is object, y is primitive boolean",
"test": "//CHECK#1\nif ((new Boolean(true) != true) !== false) {\n $ERROR('#1: (new Boolean(true) != true) === false');\n}\n\n//CHECK#2\nif ((new Number(1) != true) !== false) {\n $ERROR('#2: (new Number(1) != true) === false');\n}\n\n//CHECK#3\nif ((new String(\"1\") != true) !== false) {\n $ERROR('#3: (new String(\"1\") != true) === false');\n}\n",
"id": "S11.9.2_A7.2"
},
{
"section": "11.9.2, 11.9.3",
"description": "y is object, x is primitive boolean",
"test": "//CHECK#1\nif ((true != new Boolean(true)) !== false) {\n $ERROR('#1: (true != new Boolean(true)) === false');\n}\n\n//CHECK#2\nif ((true != new Number(1)) !== false) {\n $ERROR('#2: (true != new Number(1)) === false');\n}\n\n//CHECK#3\nif ((true != new String(\"+1\")) !== false) {\n $ERROR('#3: (true != new String(\"+1\")) === false');\n}\n",
"id": "S11.9.2_A7.3"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is object, y is primitive number",
"test": "//CHECK#1\nif ((new Boolean(true) != 1) !== false) {\n $ERROR('#1: (new Boolean(true) != 1) === false');\n}\n\n//CHECK#2\nif ((new Number(-1) != -1) !== false) {\n $ERROR('#2: (new Number(-1) != -1) === false');\n}\n\n//CHECK#3\nif ((new String(\"-1\") != -1) !== false) {\n $ERROR('#3: (new String(\"-1\") != -1) === false');\n}\n",
"id": "S11.9.2_A7.4"
},
{
"section": "11.9.2, 11.9.3",
"description": "y is object, x is primitive number",
"test": "//CHECK#1\nif ((1 != new Boolean(true)) !== false) {\n $ERROR('#1: (1 != new Boolean(true)) === false');\n}\n\n//CHECK#2\nif ((-1 != new Number(-1)) !== false) {\n $ERROR('#2: (-1 != new Number(-1)) === false');\n}\n\n//CHECK#3\nif ((-1 != new String(\"-1\")) !== false) {\n $ERROR('#3: (-1 != new String(\"-1\")) === false');\n}\n",
"id": "S11.9.2_A7.5"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is object, y is primitive string",
"test": "//CHECK#1\nif ((new Boolean(true) != \"1\") !== false) {\n $ERROR('#1: (new Boolean(true) != \"1\") === false');\n}\n\n//CHECK#2\nif ((new Number(-1) != \"-1\") !== false) {\n $ERROR('#2: (new Number(-1) != \"-1\") === false');\n}\n\n//CHECK#3\nif ((new String(\"x\") != \"x\") !== false) {\n $ERROR('#3: (new String(\"x\") != \"x\") === false');\n}\n",
"id": "S11.9.2_A7.6"
},
{
"section": "11.9.2, 11.9.3",
"description": "y is object, x is primitive string",
"test": "//CHECK#1\nif ((\"1\" != new Boolean(true)) !== false) {\n $ERROR('#1: (\"1\" != new Boolean(true)) === false');\n}\n\n//CHECK#2\nif ((\"-1\" != new Number(-1)) !== false) {\n $ERROR('#2: (\"-1\" != new Number(-1)) === false');\n}\n\n//CHECK#3\nif ((\"x\" != new String(\"x\")) !== false) {\n $ERROR('#3: (\"x\" != new String(\"x\")) === false');\n}\n",
"id": "S11.9.2_A7.7"
},
{
"section": "11.9.2, 11.9.3",
"description": "x is object, y is primtitive",
"test": "//CHECK#1\nif ((true != {valueOf: function() {return 1}}) !== false) {\n $ERROR('#1: (true != {valueOf: function() {return 1}}) === false');\n}\n\n//CHECK#2\nif ((1 != {valueOf: function() {return 1}, toString: function() {return 0}}) !== false) {\n $ERROR('#2: (1 != {valueOf: function() {return 1}, toString: function() {return 0}}) === false');\n}\n\n//CHECK#3\nif ((\"+1\" != {valueOf: function() {return 1}, toString: function() {return {}}}) !== false) {\n $ERROR('#3: (\"+1\" != {valueOf: function() {return 1}, toString: function() {return {}}}) === false');\n} \n \n//CHECK#4\ntry {\n if ((true != {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) !== false) {\n $ERROR('#4.1: (true != {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) === false');\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: (true != {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) not throw \"error\"');\n } else {\n $ERROR('#4.3: (true != {valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}}) not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif ((1 != {toString: function() {return \"+1\"}}) !== false) {\n $ERROR('#5: (1 != {toString: function() {return \"+1\"}}) === false');\n}\n\n//CHECK#6\nif ((\"1\" != {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) !== true) {\n $ERROR('#6.1: (\"1\" != {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) === true');\n} else {\n if ((\"+1\" != {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) !== false) {\n $ERROR('#6.2: (\"+1\" != {valueOf: function() {return {}}, toString: function() {return \"+1\"}}) === false');\n }\n}\n\n//CHECK#7\ntry {\n (1 != {valueOf: function() {throw \"error\"}, toString: function() {return 1}});\n $ERROR('#7: (1 != {valueOf: function() {throw \"error\"}, toString: function() {return 1}}) throw \"error\"');\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7: (1 != {valueOf: function() {throw \"error\"}, toString: function() {return 1}}) throw \"error\"');\n } \n}\n\n//CHECK#8\ntry {\n (1 != {valueOf: function() {return {}}, toString: function() {return {}}});\n $ERROR('#8: (1 != {valueOf: function() {return {}}, toString: function() {return {}}}) throw TypeError');\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8: (1 != {valueOf: function() {return {}}, toString: function() {return {}}}) throw TypeError');\n } \n}\n",
"id": "S11.9.2_A7.8"
},
{
"section": "11.9.2, 11.9.3",
"description": "y is object, x is primtitive",
"test": "//CHECK#1\nif (({valueOf: function() {return 1}} != true) !== false) {\n $ERROR('#1: ({valueOf: function() {return 1}} != true) === false');\n}\n\n//CHECK#2\nif (({valueOf: function() {return 1}, toString: function() {return 0}} != 1) !== false) {\n $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} != 1) === false');\n}\n\n//CHECK#3\nif (({valueOf: function() {return 1}, toString: function() {return {}}} != \"+1\") !== false) {\n $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} != \"+1\") === false');\n} \n \n//CHECK#4\ntry {\n if (({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} != true) !== false) {\n $ERROR('#4.1: ({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} != true) === false');\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: ({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} != true) not throw \"error\"');\n } else {\n $ERROR('#4.3: ({valueOf: function() {return \"+1\"}, toString: function() {throw \"error\"}} != true) not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (({toString: function() {return \"+1\"}} != 1) !== false) {\n $ERROR('#5: ({toString: function() {return \"+1\"}} != 1) === false');\n}\n\n//CHECK#6\nif (({valueOf: function() {return {}}, toString: function() {return \"+1\"}} != \"1\") !== true) {\n $ERROR('#6.1: ({valueOf: function() {return {}}, toString: function() {return \"+1\"}} != \"1\") === true');\n} else {\n if (({valueOf: function() {return {}}, toString: function() {return \"+1\"}} != \"+1\") !== false) {\n $ERROR('#6.2: ({valueOf: function() {return {}}, toString: function() {return \"+1\"}} != \"+1\") === false');\n }\n}\n\n//CHECK#7\ntry {\n ({valueOf: function() {throw \"error\"}, toString: function() {return 1}} != 1);\n $ERROR('#7.1: ({valueOf: function() {throw \"error\"}, toString: function() {return 1}} != 1) throw \"error\". Actual: ' + (({valueOf: function() {throw \"error\"}, toString: function() {return 1}} != 1)));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: ({valueOf: function() {throw \"error\"}, toString: function() {return 1}} != 1) throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n ({valueOf: function() {return {}}, toString: function() {return {}}} != 1);\n $ERROR('#8.1: ({valueOf: function() {return {}}, toString: function() {return {}}} != 1) throw TypeError. Actual: ' + (({valueOf: function() {return {}}, toString: function() {return {}}} != 1)));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: ({valueOf: function() {return {}}, toString: function() {return {}}} != 1) throw TypeError. Actual: ' + (e));\n } \n}\n",
"id": "S11.9.2_A7.9"
}
]
}
}

View File

@ -0,0 +1,134 @@
{
"testCollection": {
"name": "11.9.4_The_Strict_Equals_Operator",
"numTests": 21,
"tests": [
{
"section": "11.9.4, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (!(eval(\"1\\u0009===\\u00091\"))) {\n $ERROR('#1: 1\\\\u0009===\\\\u00091');\n}\n\n//CHECK#2\nif (!(eval(\"1\\u000B===\\u000B1\"))) {\n $ERROR('#2: 1\\\\u000B===\\\\u000B1'); \n}\n\n//CHECK#3\nif (!(eval(\"1\\u000C===\\u000C1\"))) {\n $ERROR('#3: 1\\\\u000C===\\\\u000C1');\n}\n\n//CHECK#4\nif (!(eval(\"1\\u0020===\\u00201\"))) {\n $ERROR('#4: 1\\\\u0020===\\\\u00201');\n}\n\n//CHECK#5\nif (!(eval(\"1\\u00A0===\\u00A01\"))) {\n $ERROR('#5: 1\\\\u00A0===\\\\u00A01');\n}\n\n//CHECK#6\nif (!(eval(\"1\\u000A===\\u000A1\"))) {\n $ERROR('#6: 1\\\\u000A===\\\\u000A1'); \n}\n\n//CHECK#7\nif (!(eval(\"1\\u000D===\\u000D1\"))) {\n $ERROR('#7: 1\\\\u000D===\\\\u000D1');\n}\n\n//CHECK#8\nif (!(eval(\"1\\u2028===\\u20281\"))) {\n $ERROR('#8: 1\\\\u2028===\\\\u20281');\n}\n\n//CHECK#9\nif (!(eval(\"1\\u2029===\\u20291\"))) {\n $ERROR('#9: 1\\\\u2029===\\\\u20291');\n}\n\n//CHECK#10\nif (!(eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029===\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\"))) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029===\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291');\n}\n",
"id": "S11.9.4_A1"
},
{
"section": "11.9.4",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (!(1 === 1)) {\n $ERROR('#1: 1 === 1');\n}\n\n//CHECK#2\nvar x = 1;\nif (!(x === 1)) {\n $ERROR('#2: var x = 1; x === 1');\n}\n\n//CHECK#3\nvar y = 1;\nif (!(1 === y)) {\n $ERROR('#3: var y = 1; 1 === y');\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (!(x === y)) {\n $ERROR('#4: var x = 1; var y = 1; x === y');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (!(objectx.prop === objecty.prop)) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop === objecty.prop');\n}\n\n",
"id": "S11.9.4_A2.1_T1"
},
{
"section": "11.9.4",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x === 1;\n $ERROR('#1.1: x === 1 throw ReferenceError. Actual: ' + (x === 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x === 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.4_A2.1_T2"
},
{
"section": "11.9.4",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 === y;\n $ERROR('#1.1: 1 === y throw ReferenceError. Actual: ' + (1 === y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 === y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.4_A2.1_T3"
},
{
"section": "11.9.4",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif (!((x = 1) === x)) {\n $ERROR('#1: var x = 0; (x = 1) === x');\n}\n\n//CHECK#2\nvar x = 0; \nif (x === (x = 1)) {\n $ERROR('#2: var x = 0; x !== (x = 1)');\n}\n\n",
"id": "S11.9.4_A2.4_T1"
},
{
"section": "11.9.4",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() === y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() === y() throw \"x\". Actual: ' + (x() === y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (!(e === \"x\")) {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() === y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.9.4_A2.4_T2"
},
{
"section": "11.9.4",
"description": "Checking with undeclarated variables",
"test": "//CHECK#1\ntry {\n x === (x = 1);\n $ERROR('#1.1: x === (x = 1) throw ReferenceError. Actual: ' + (x === (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x === (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif (!((y = 1) === y)) {\n $ERROR('#2: (y = 1) === y');\n}\n\n",
"id": "S11.9.4_A2.4_T3"
},
{
"section": "11.9.4, 11.9.6",
"description": "x and y are primitive booleans",
"test": "//CHECK#1\nif (!(true === true)) {\n $ERROR('#1: true === true');\n}\n\n//CHECK#2\nif (!(false === false)) {\n $ERROR('#2: false === false');\n}\n\n//CHECK#3\nif (true === false) {\n $ERROR('#3: true !== false');\n}\n\n//CHECK#4\nif (false === true) {\n $ERROR('#4: false !== true');\n}\n",
"id": "S11.9.4_A3"
},
{
"section": "11.9.4, 11.9.6",
"description": "x is NaN",
"test": "//CHECK#1\nif (Number.NaN === true) {\n $ERROR('#1: NaN !== true');\n}\n\n//CHECK#2\nif (Number.NaN === 1) {\n $ERROR('#2: NaN !== 1');\n}\n\n//CHECK#3\nif (Number.NaN === Number.NaN) {\n $ERROR('#3: NaN !== NaN');\n}\n\n//CHECK#4\nif (Number.NaN === Number.POSITIVE_INFINITY) {\n $ERROR('#4: NaN !== +Infinity');\n}\n\n//CHECK#5\nif (Number.NaN === Number.NEGATIVE_INFINITY) {\n $ERROR('#5: NaN !== -Infinity');\n}\n\n//CHECK#6\nif (Number.NaN === Number.MAX_VALUE) {\n $ERROR('#6: NaN !== Number.MAX_VALUE');\n}\n\n//CHECK#7\nif (Number.NaN === Number.MIN_VALUE) {\n $ERROR('#7: NaN !== Number.MIN_VALUE');\n}\n\n//CHECK#8\nif (Number.NaN === \"string\") {\n $ERROR('#8: NaN !== \"string\"');\n}\n\n//CHECK#9\nif (Number.NaN === new Object()) {\n $ERROR('#9: NaN !== new Object()');\n}\n\n",
"id": "S11.9.4_A4.1_T1"
},
{
"section": "11.9.4, 11.9.6",
"description": "y is NaN",
"test": "//CHECK#1\nif (true === Number.NaN) {\n $ERROR('#1: true !== NaN');\n}\n\n//CHECK#2\nif (-1 === Number.NaN) {\n $ERROR('#2: -1 !== NaN');\n}\n\n//CHECK#3\nif (Number.NaN === Number.NaN) {\n $ERROR('#3: NaN !== NaN');\n}\n\n//CHECK#4\nif (Number.POSITIVE_INFINITY === Number.NaN) {\n $ERROR('#4: +Infinity !== NaN');\n}\n\n//CHECK#5\nif (Number.NEGATIVE_INFINITY === Number.NaN) {\n $ERROR('#5: -Infinity !== NaN');\n}\n\n//CHECK#6\nif (Number.MAX_VALUE === Number.NaN) {\n $ERROR('#6: Number.MAX_VALUE !== NaN');\n}\n\n//CHECK#7\nif (Number.MIN_VALUE === Number.NaN) {\n $ERROR('#7: Number.MIN_VALUE !== NaN');\n}\n\n//CHECK#8\nif (\"string\" === Number.NaN) {\n $ERROR('#8: \"string\" !== NaN');\n}\n\n//CHECK#9\nif (new Object() === Number.NaN) {\n $ERROR('#9: new Object() !== NaN');\n}\n",
"id": "S11.9.4_A4.1_T2"
},
{
"section": "11.9.4, 11.9.6",
"description": "Checking all combinations",
"test": "//CHECK#1\nif (!(+0 === -0)) {\n $ERROR('#1: +0 === -0');\n}\n\n//CHECK#2\nif (!(-0 === +0)) {\n $ERROR('#2: -0 === +0');\n}\n",
"id": "S11.9.4_A4.2"
},
{
"section": "11.9.4, 11.9.6",
"description": "x and y are primitive numbers",
"test": "//CHECK#1\nif (!(Number.POSITIVE_INFINITY === Number.POSITIVE_INFINITY)) {\n $ERROR('#1: +Infinity === +Infinity');\n}\n\n//CHECK#2\nif (!(Number.NEGATIVE_INFINITY === Number.NEGATIVE_INFINITY)) {\n $ERROR('#2: -Infinity === -Infinity');\n}\n\n//CHECK#3\nif (!(13 === 13)) {\n $ERROR('#3: 13 === 13');\n}\n\n//CHECK#4\nif (!(-13 === -13)) {\n $ERROR('#4: -13 === -13');\n}\n\n//CHECK#5\nif (!(1.3 === 1.3)) {\n $ERROR('#5: 1.3 === 1.3');\n}\n\n//CHECK#6\nif (!(-1.3 === -1.3)) {\n $ERROR('#6: -1.3 === -1.3');\n}\n\n//CHECK#7\nif (!(Number.POSITIVE_INFINITY === -Number.NEGATIVE_INFINITY)) {\n $ERROR('#7: +Infinity === -(-Infinity)');\n}\n\n//CHECK#8\nif (1 === 0.999999999999) {\n $ERROR('#8: 1 !== 0.999999999999');\n}\n\n//CHECK#9\nif (!(1.0 === 1)) {\n $ERROR('#9: 1.0 === 1');\n}\n",
"id": "S11.9.4_A4.3"
},
{
"section": "11.9.4, 11.9.6",
"description": "x and y are primitive strings",
"test": "//CHECK#1\nif (!(\"\" === \"\")) {\n $ERROR('#1: \"\" === \"\"');\n}\n\n//CHECK#2\nif (!(\" \" === \" \")) {\n $ERROR('#2: \" \" === \" \"');\n}\n\n//CHECK#3\nif (!(\"string\" === \"string\")) {\n $ERROR('#3: \"string\" === \"string\"');\n}\n\n//CHECK#4\nif (\" string\" === \"string \") {\n $ERROR('#4: \" string\" !== \"string \"');\n}\n\n//CHECK#5\nif (\"1.0\" === \"1\") {\n $ERROR('#5: \"1.0\" !== \"1\"');\n}\n",
"id": "S11.9.4_A5"
},
{
"section": "11.9.4, 11.9.6",
"description": "void 0, eval(\"var x\") is undefined",
"test": "//CHECK#1\nif (!(undefined === undefined)) {\n $ERROR('#1: undefined === undefined');\n}\n\n//CHECK#2\nif (!(void 0 === undefined)) {\n $ERROR('#2: void 0 === undefined');\n}\n\n//CHECK#3\nif (!(undefined === eval(\"var x\"))) {\n $ERROR('#3: undefined === eval(\"var x\")');\n}\n",
"id": "S11.9.4_A6.1"
},
{
"section": "11.9.4, 11.9.6",
"description": "null === null",
"test": "//CHECK#1\nif (!(null === null)) {\n $ERROR('#1: null === null');\n}\n",
"id": "S11.9.4_A6.2"
},
{
"section": "11.9.4, 11.9.6",
"description": "Checking Boolean object, Number object, String object, Object object",
"test": "//CHECK#1\nif (new Object() === new Object()) {\n $ERROR('#1: new Object() !== new Object()');\n}\n\n//CHECK#2\nif (new Object(true) === new Object(true)) {\n $ERROR('#2: new Object() !== new Object()');\n}\n\n//CHECK#3\nif (new Object(false) === new Object(false)) {\n $ERROR('#3: new Object() !== new Object()');\n}\n\n//CHECK#4\nif (new Object(+0) === new Object(-0)) {\n $ERROR('#4: new Object(+0) !== new Object(-0)');\n}\n\n//CHECK#5\nx = {}; \ny = x;\nif (!(x === y)) {\n $ERROR('#5: x = {}; y = x; x === y');\n}\n\n//CHECK#6\nif (new Boolean(true) === new Number(1)) {\n $ERROR('#6 new Boolean(true) === new Number(1)');\n}\n\n//CHECK#7\nif (new Number(1) === new String(\"1\")) {\n $ERROR('#7: new Number(1) === new String(\"1\")');\n}\n\n//CHECK#8\nif (new String(\"1\") === new Boolean(true)) {\n $ERROR('#8: new String(\"x\") === new Boolean(true)');\n}\n",
"id": "S11.9.4_A7"
},
{
"section": "11.9.4, 11.9.6",
"description": "x or y is primitive boolean",
"test": "//CHECK#1\nif (true === new Boolean(true)) {\n $ERROR('#1: true !== new Number(true)');\n}\n\n//CHECK#2\nif (true === 1) {\n $ERROR('#2: true !== 1');\n}\n\n//CHECK#3\nif (true === new Number(true)) {\n $ERROR('#3: true !== new Number(true)');\n}\n\n//CHECK#4\nif (true === \"1\") {\n $ERROR('#4: true !== \"1\"');\n}\n\n//CHECK#5\nif (true === new String(true)) {\n $ERROR('#5: true !== new String(true)');\n}\n\n//CHECK#6\nif (new Boolean(false) === false) {\n $ERROR('#6: new Number(false) !== false');\n}\n\n//CHECK#7\nif (0 === false) {\n $ERROR('#7: 0 !== false');\n}\n\n//CHECK#8\nif (new Number(false) === false) {\n $ERROR('#8: new Number(false) !== false');\n}\n\n//CHECK#9\nif (\"0\" === false) {\n $ERROR('#9: \"0\" !== false');\n}\n\n//CHECK#10\nif (false === new String(false)) {\n $ERROR('#10: false !== new String(false)');\n}\n\n//CHECK#11\nif (true === {valueOf: function () {return true}}) {\n $ERROR('#11: true === {valueOf: function () {return true}}');\n}\n",
"id": "S11.9.4_A8_T1"
},
{
"section": "11.9.4, 11.9.6",
"description": "x or y is primitive number",
"test": "//CHECK#1\nif (1 === new Number(1)) {\n $ERROR('#1: 1 !== new Number(1)');\n}\n\n//CHECK#2\nif (1 === true) {\n $ERROR('#2: 1 !== true');\n}\n\n//CHECK#3\nif (1 === new Boolean(1)) {\n $ERROR('#3: 1 !== new Boolean(1)');\n}\n\n//CHECK#4\nif (1 === \"1\") {\n $ERROR('#4: 1 !== \"1\"');\n}\n\n//CHECK#5\nif (1 === new String(1)) {\n $ERROR('#5: 1 !== new String(1)');\n}\n\n//CHECK#6\nif (new Number(0) === 0) {\n $ERROR('#6: new Number(0) !== 0');\n}\n\n//CHECK#7\nif (false === 0) {\n $ERROR('#7: false !== 0');\n}\n\n//CHECK#8\nif (new Boolean(0) === 0) {\n $ERROR('#8: new Boolean(0) !== 0');\n}\n\n//CHECK#9\nif (\"0\" === 0) {\n $ERROR('#9: \"0\" !== 0');\n}\n\n//CHECK#10\nif (new String(0) === 0) {\n $ERROR('#10: new String(0) !== 0');\n}\n\n//CHECK#11\nif (1 === {valueOf: function () {return 1}}) {\n $ERROR('#11: 1 === {valueOf: function () {return 1}}');\n}\n",
"id": "S11.9.4_A8_T2"
},
{
"section": "11.9.4, 11.9.6",
"description": "x or y is primitive string",
"test": "//CHECK#1\nif (\"1\" === new String(\"1\")) {\n $ERROR('#1: \"1\" !== new String(\"1\")');\n}\n\n//CHECK#2\nif (\"1\" === true) {\n $ERROR('#2: \"1\" !== true');\n}\n\n//CHECK#3\nif (\"1\" === new Boolean(\"1\")) {\n $ERROR('#3: \"1\" !== new Boolean(\"1\")');\n}\n\n//CHECK#4\nif (\"1\" === 1) {\n $ERROR('#4: \"1\" === 1');\n}\n\n//CHECK#5\nif (\"1\" === new Number(\"1\")) {\n $ERROR('#5: \"1\" === new Number(\"1\")');\n}\n\n//CHECK#6\nif (new String(false) === false) {\n $ERROR('#6: new Number(false) !== false');\n}\n\n//CHECK#7\nif (false === \"0\") {\n $ERROR('#7: false !== \"0\"');\n}\n\n//CHECK#8\nif (\"0\" === new Boolean(\"0\")) {\n $ERROR('#8: \"0\" !== new Boolean(\"0\")');\n}\n\n//CHECK#9\nif (false === 0) {\n $ERROR('#9: false !== 0');\n}\n\n//CHECK#10\nif (false === new Number(false)) {\n $ERROR('#10: false !== new Number(false)');\n}\n\n//CHECK#11\nif (\"1\" === {valueOf: function () {return \"1\"}}) {\n $ERROR('#11: \"1\" === {valueOf: function () {return \"1\"}}');\n}\n",
"id": "S11.9.4_A8_T3"
},
{
"section": "11.9.4, 11.9.6",
"description": "x or y is null or undefined",
"test": "//CHECK#1\nif (undefined === null) {\n $ERROR('#1: undefined !== null');\n}\n\n//CHECK#2\nif (null === undefined) {\n $ERROR('#2: null !== undefined');\n}\n\n//CHECK#3\nif (null === 0) {\n $ERROR('#3: null !== 0');\n}\n\n//CHECK#4\nif (0 === null) {\n $ERROR('#4: 0 !== null');\n}\n\n//CHECK#5\nif (null === false) {\n $ERROR('#5: null !== false');\n}\n\n//CHECK#6\nif (false === null) {\n $ERROR('#6: false !== null');\n}\n\n//CHECK#7\nif (undefined === false) {\n $ERROR('#7: undefined !== false');\n}\n\n//CHECK#8\nif (false === undefined) {\n $ERROR('#8: false !== undefined');\n}\n\n//CHECK#9\nif (null === new Object()) {\n $ERROR('#9: null !== new Object()');\n}\n\n//CHECK#10\nif (new Object() === null) {\n $ERROR('#10: new Object() !== null');\n}\n\n//CHECK#11\nif (null === \"null\") {\n $ERROR('#11: null !== \"null\"');\n}\n\n//CHECK#12\nif (\"null\" === null) {\n $ERROR('#12: \"null\" !== null');\n}\n\n//CHECK#13\nif (undefined === \"undefined\") {\n $ERROR('#13: undefined !== \"undefined\"');\n}\n\n//CHECK#14\nif (\"undefined\" === undefined) {\n $ERROR('#14: \"undefined\" !== undefined');\n}\n",
"id": "S11.9.4_A8_T4"
},
{
"section": "11.9.4, 11.9.6",
"description": "Checking with such x and y that either x or y is primitive string and the other is primitive number",
"test": "//CHECK#1\ntry {\n throw 1;\n} catch(e) {\n if (e === \"1\") {\n $ERROR('#1: throw 1 !== \"1\"');\n }\n}\n\n//CHECK#2\ntry {\n throw \"1\";\n} catch(e) {\n if (1 === e) {\n $ERROR('#2: 1 !== throw \"1\"');\n }\n} \n",
"id": "S11.9.4_A8_T5"
}
]
}
}

View File

@ -0,0 +1,134 @@
{
"testCollection": {
"name": "11.9.5_The_Strict_Does_not_equals_Operator",
"numTests": 21,
"tests": [
{
"section": "11.9.5, 7.2, 7.3",
"description": "Checking by using eval",
"test": "//CHECK#1\nif (eval(\"1\\u0009!==\\u00091\")) {\n $ERROR('#1: 1\\\\u0009!==\\\\u00091');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B!==\\u000B1\")) {\n $ERROR('#2: 1\\\\u000B!==\\\\u000B1'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C!==\\u000C1\")) {\n $ERROR('#3: 1\\\\u000C!==\\\\u000C1');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020!==\\u00201\")) {\n $ERROR('#4: 1\\\\u0020!==\\\\u00201');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0!==\\u00A01\")) {\n $ERROR('#5: 1\\\\u00A0!==\\\\u00A01');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A!==\\u000A1\")) {\n $ERROR('#6: 1\\\\u000A!==\\\\u000A1'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D!==\\u000D1\")) {\n $ERROR('#7: 1\\\\u000D!==\\\\u000D1');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028!==\\u20281\")) {\n $ERROR('#8: 1\\\\u2028!==\\\\u20281');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029!==\\u20291\")) {\n $ERROR('#9: 1\\\\u2029!==\\\\u20291');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029!==\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\")) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029!==\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291');\n}\n",
"id": "S11.9.5_A1"
},
{
"section": "11.9.5",
"description": "Either Type is not Reference or GetBase is not null",
"test": "//CHECK#1\nif (1 !== 1) {\n $ERROR('#1: 1 === 1');\n}\n\n//CHECK#2\nvar x = 1;\nif (x !== 1) {\n $ERROR('#2: var x = 1; x === 1');\n}\n\n//CHECK#3\nvar y = 1;\nif (1 !== y) {\n $ERROR('#3: var y = 1; 1 === y');\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 1;\nif (x !== y) {\n $ERROR('#4: var x = 1; var y = 1; x === y');\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 1;\nif (objectx.prop !== objecty.prop) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop === objecty.prop');\n}\n\n",
"id": "S11.9.5_A2.1_T1"
},
{
"section": "11.9.5",
"description": "If GetBase(x) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n x !== 1;\n $ERROR('#1.1: x !== 1 throw ReferenceError. Actual: ' + (x !== 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x !== 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.5_A2.1_T2"
},
{
"section": "11.9.5",
"description": "If GetBase(y) is null, throw ReferenceError",
"test": "//CHECK#1\ntry {\n 1 !== y;\n $ERROR('#1.1: 1 !== y throw ReferenceError. Actual: ' + (1 !== y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1 !== y throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n",
"id": "S11.9.5_A2.1_T3"
},
{
"section": "11.9.5",
"description": "Checking with \"=\"",
"test": "//CHECK#1\nvar x = 0; \nif ((x = 1) !== x) {\n $ERROR('#1: var x = 0; (x = 1) === x');\n}\n\n//CHECK#2\nvar x = 0; \nif (!(x !== (x = 1))) {\n $ERROR('#2: var x = 0; x !== (x = 1)');\n}\n\n",
"id": "S11.9.5_A2.4_T1"
},
{
"section": "11.9.5",
"description": "Checking with \"throw\"",
"test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() !== y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() !== y() throw \"x\". Actual: ' + (x() !== y()));\n} catch (e) {\n if (!(e !== \"y\")) {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() !== y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
"id": "S11.9.5_A2.4_T2"
},
{
"section": "11.9.5",
"description": "Checking undeclarated variables",
"test": "//CHECK#1\ntry {\n x !== (x = 1);\n $ERROR('#1.1: x !== (x = 1) throw ReferenceError. Actual: ' + (x !== (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x !== (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) !== y) {\n $ERROR('#2: (y = 1) === y');\n}\n\n",
"id": "S11.9.5_A2.4_T3"
},
{
"section": "11.9.5, 11.9.6",
"description": "x and y are primitive booleans",
"test": "//CHECK#1\nif (true !== true) {\n $ERROR('#1: true === true');\n}\n\n//CHECK#2\nif (false !== false) {\n $ERROR('#2: false === false');\n}\n\n//CHECK#3\nif (!(true !== false)) {\n $ERROR('#3: true !== false');\n}\n\n//CHECK#4\nif (!(false !== true)) {\n $ERROR('#4: false !== true');\n}\n",
"id": "S11.9.5_A3"
},
{
"section": "11.9.5, 11.9.6",
"description": "x is NaN",
"test": "//CHECK#1\nif (!(Number.NaN !== true)) {\n $ERROR('#1: NaN !== true');\n}\n\n//CHECK#2\nif (!(Number.NaN !== 1)) {\n $ERROR('#2: NaN !== 1');\n}\n\n//CHECK#3\nif (!(Number.NaN !== Number.NaN)) {\n $ERROR('#3: NaN !== NaN');\n}\n\n//CHECK#4\nif (!(Number.NaN !== Number.POSITIVE_INFINITY)) {\n $ERROR('#4: NaN !== +Infinity');\n}\n\n//CHECK#5\nif (!(Number.NaN !== Number.NEGATIVE_INFINITY)) {\n $ERROR('#5: NaN !== -Infinity');\n}\n\n//CHECK#6\nif (!(Number.NaN !== Number.MAX_VALUE)) {\n $ERROR('#6: NaN !== Number.MAX_VALUE');\n}\n\n//CHECK#7\nif (!(Number.NaN !== Number.MIN_VALUE)) {\n $ERROR('#7: NaN !== Number.MIN_VALUE');\n}\n\n//CHECK#8\nif (!(Number.NaN !== \"string\")) {\n $ERROR('#8: NaN !== \"string\"');\n}\n\n//CHECK#9\nif (!(Number.NaN !== new Object())) {\n $ERROR('#9: NaN !== new Object()');\n}\n\n",
"id": "S11.9.5_A4.1_T1"
},
{
"section": "11.9.5, 11.9.6",
"description": "y is NaN",
"test": "//CHECK#1\nif (!(true !== Number.NaN)) {\n $ERROR('#1: true !== NaN');\n}\n\n//CHECK#2\nif (!(-1 !== Number.NaN)) {\n $ERROR('#2: -1 !== NaN');\n}\n\n//CHECK#3\nif (!(Number.NaN !== Number.NaN)) {\n $ERROR('#3: NaN !== NaN');\n}\n\n//CHECK#4\nif (!(Number.POSITIVE_INFINITY !== Number.NaN)) {\n $ERROR('#4: +Infinity !== NaN');\n}\n\n//CHECK#5\nif (!(Number.NEGATIVE_INFINITY !== Number.NaN)) {\n $ERROR('#5: -Infinity !== NaN');\n}\n\n//CHECK#6\nif (!(Number.MAX_VALUE !== Number.NaN)) {\n $ERROR('#6: Number.MAX_VALUE !== NaN');\n}\n\n//CHECK#7\nif (!(Number.MIN_VALUE !== Number.NaN)) {\n $ERROR('#7: Number.MIN_VALUE !== NaN');\n}\n\n//CHECK#8\nif (!(\"string\" !== Number.NaN)) {\n $ERROR('#8: \"string\" !== NaN');\n}\n\n//CHECK#9\nif (!(new Object() !== Number.NaN)) {\n $ERROR('#9: new Object() !== NaN');\n}\n",
"id": "S11.9.5_A4.1_T2"
},
{
"section": "11.9.5, 11.9.6",
"description": "Checking all combinations",
"test": "//CHECK#1\nif (+0 !== -0) {\n $ERROR('#1: +0 === -0');\n}\n\n//CHECK#2\nif (-0 !== +0) {\n $ERROR('#2: -0 === +0');\n}\n",
"id": "S11.9.5_A4.2"
},
{
"section": "11.9.5, 11.9.6",
"description": "x and y are primitive numbers",
"test": "//CHECK#1\nif (Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY) {\n $ERROR('#1: +Infinity === +Infinity');\n}\n\n//CHECK#2\nif (Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2: -Infinity === -Infinity');\n}\n\n//CHECK#3\nif (13 !== 13) {\n $ERROR('#3: 13 === 13');\n}\n\n//CHECK#4\nif (-13 !== -13) {\n $ERROR('#4: -13 === -13');\n}\n\n//CHECK#5\nif (1.3 !== 1.3) {\n $ERROR('#5: 1.3 === 1.3');\n}\n\n//CHECK#6\nif (-1.3 !== -1.3) {\n $ERROR('#6: -1.3 === -1.3');\n}\n\n//CHECK#7\nif (Number.POSITIVE_INFINITY !== -Number.NEGATIVE_INFINITY) {\n $ERROR('#7: +Infinity === -(-Infinity)');\n}\n\n//CHECK#8\nif (!(1 !== 0.999999999999)) {\n $ERROR('#8: 1 !== 0.999999999999');\n}\n\n//CHECK#9\nif (1.0 !== 1) {\n $ERROR('#9: 1.0 === 1');\n}\n",
"id": "S11.9.5_A4.3"
},
{
"section": "11.9.5, 11.9.6",
"description": "x and y are primitive strings",
"test": "//CHECK#1\nif (\"\" !== \"\") {\n $ERROR('#1: \"\" === \"\"');\n}\n\n//CHECK#2\nif (\" \" !== \" \") {\n $ERROR('#2: \" \" === \" \"');\n}\n\n//CHECK#3\nif (\"string\" !== \"string\") {\n $ERROR('#3: \"string\" === \"string\"');\n}\n\n//CHECK#4\nif (!(\" string\" !== \"string \")) {\n $ERROR('#4: \" string\" !== \"string \"');\n}\n\n//CHECK#5\nif (!(\"1.0\" !== \"1\")) {\n $ERROR('#5: \"1.0\" !== \"1\"');\n}\n",
"id": "S11.9.5_A5"
},
{
"section": "11.9.5, 11.9.6",
"description": "void 0, eval(\"var x\") is undefined",
"test": "//CHECK#1\nif (undefined !== undefined) {\n $ERROR('#1: undefined === undefined');\n}\n\n//CHECK#2\nif (void 0 !== undefined) {\n $ERROR('#2: void 0 === undefined');\n}\n\n//CHECK#3\nif (undefined !== eval(\"var x\")) {\n $ERROR('#3: undefined === eval(\"var x\")');\n}\n",
"id": "S11.9.5_A6.1"
},
{
"section": "11.9.5, 11.9.6",
"description": "null === null",
"test": "//CHECK#1\nif (null !== null) {\n $ERROR('#1: null === null');\n}\n",
"id": "S11.9.5_A6.2"
},
{
"section": "11.9.5, 11.9.6",
"description": "Checking Boolean object, Number object, String object, Object object",
"test": "//CHECK#1\nif (!(new Object() !== new Object())) {\n $ERROR('#1: new Object() !== new Object()');\n}\n\n//CHECK#2\nif (!(new Object(true) !== new Object(true))) {\n $ERROR('#2: new Object() !== new Object()');\n}\n\n//CHECK#3\nif (!(new Object(false) !== new Object(false))) {\n $ERROR('#3: new Object() !== new Object()');\n}\n\n//CHECK#4\nif (!(new Object(+0) !== new Object(-0))) {\n $ERROR('#4: new Object(+0) !== new Object(-0)');\n}\n\n//CHECK#5\nx = {}; \ny = x;\nif (x !== y) {\n $ERROR('#5: x = {}; y = x; x === y');\n}\n\n//CHECK#6\nif (!(new Boolean(true) !== new Number(1))) {\n $ERROR('#6 new Boolean(true) !== new Number(1)');\n}\n\n//CHECK#7\nif (!(new Number(1) !== new String(\"1\"))) {\n $ERROR('#7: new Number(1) !== new String(\"1\")');\n}\n\n//CHECK#8\nif (!(new String(\"1\") !== new Boolean(true))) {\n $ERROR('#8: new String(\"x\") !== new Boolean(true)');\n}\n\n\n",
"id": "S11.9.5_A7"
},
{
"section": "11.9.5, 11.9.6",
"description": "x or y is primitive boolean",
"test": "//CHECK#1\nif (!(true !== new Boolean(true))) {\n $ERROR('#1: true !== new Number(true)');\n}\n\n//CHECK#2\nif (!(true !== 1)) {\n $ERROR('#2: true !== 1');\n}\n\n//CHECK#3\nif (!(true !== new Number(true))) {\n $ERROR('#3: true !== new Number(true)');\n}\n\n//CHECK#4\nif (!(true !== \"1\")) {\n $ERROR('#4: true !== \"1\"');\n}\n\n//CHECK#5\nif (!(true !== new String(true))) {\n $ERROR('#5: true !== new String(true)');\n}\n\n//CHECK#6\nif (!(new Boolean(false) !== false)) {\n $ERROR('#6: new Number(false) !== false');\n}\n\n//CHECK#7\nif (!(0 !== false)) {\n $ERROR('#7: 0 !== false');\n}\n\n//CHECK#8\nif (!(new Number(false) !== false)) {\n $ERROR('#8: new Number(false) !== false');\n}\n\n//CHECK#9\nif (!(\"0\" !== false)) {\n $ERROR('#9: \"0\" !== false');\n}\n\n//CHECK#10\nif (!(false !== new String(false))) {\n $ERROR('#10: false !== new String(false)');\n}\n\n//CHECK#11\nif (!(true !== {valueOf: function () {return true}})) {\n $ERROR('#11: true !== {valueOf: function () {return true}}');\n}\n",
"id": "S11.9.5_A8_T1"
},
{
"section": "11.9.5, 11.9.6",
"description": "x or y is primitive number",
"test": "//CHECK#1\nif (!(1 !== new Number(1))) {\n $ERROR('#1: 1 !== new Number(1)');\n}\n\n//CHECK#2\nif (!(1 !== true)) {\n $ERROR('#2: 1 !== true');\n}\n\n//CHECK#3\nif (!(1 !== new Boolean(1))) {\n $ERROR('#3: 1 !== new Boolean(1)');\n}\n\n//CHECK#4\nif (!(1 !== \"1\")) {\n $ERROR('#4: 1 !== \"1\"');\n}\n\n//CHECK#5\nif (!(1 !== new String(1))) {\n $ERROR('#5: 1 !== new String(1)');\n}\n\n//CHECK#6\nif (!(new Number(0) !== 0)) {\n $ERROR('#6: new Number(0) !== 0');\n}\n\n//CHECK#7\nif (!(false !== 0)) {\n $ERROR('#7: false !== 0');\n}\n\n//CHECK#8\nif (!(new Boolean(0) !== 0)) {\n $ERROR('#8: new Boolean(0) !== 0');\n}\n\n//CHECK#9\nif (!(\"0\" !== 0)) {\n $ERROR('#9: \"0\" !== 0');\n}\n\n//CHECK#10\nif (!(new String(0) !== 0)) {\n $ERROR('#10: new String(0) !== 0');\n}\n\n//CHECK#11\nif (!(1 !== {valueOf: function () {return 1}})) {\n $ERROR('#11: 1 !== {valueOf: function () {return 1}}');\n}\n",
"id": "S11.9.5_A8_T2"
},
{
"section": "11.9.5, 11.9.6",
"description": "x or y is primitive string",
"test": "//CHECK#1\nif (!(\"1\" !== new String(\"1\"))) {\n $ERROR('#1: \"1\" !== new String(\"1\")');\n}\n\n//CHECK#2\nif (!(\"1\" !== true)) {\n $ERROR('#2: \"1\" !== true');\n}\n\n//CHECK#3\nif (!(\"1\" !== new Boolean(\"1\"))) {\n $ERROR('#3: \"1\" !== new Boolean(\"1\")');\n}\n\n//CHECK#4\nif (!(\"1\" !== 1)) {\n $ERROR('#4: \"1\" === 1');\n}\n\n//CHECK#5\nif (!(\"1\" !== new Number(\"1\"))) {\n $ERROR('#5: \"1\" === new Number(\"1\")');\n}\n\n//CHECK#6\nif (!(new String(false) !== false)) {\n $ERROR('#6: new Number(false) !== false');\n}\n\n//CHECK#7\nif (!(false !== \"0\")) {\n $ERROR('#7: false !== \"0\"');\n}\n\n//CHECK#8\nif (!(\"0\" !== new Boolean(\"0\"))) {\n $ERROR('#8: \"0\" !== new Boolean(\"0\")');\n}\n\n//CHECK#9\nif (!(false !== 0)) {\n $ERROR('#9: false !== 0');\n}\n\n//CHECK#10\nif (!(false !== new Number(false))) {\n $ERROR('#10: false !== new Number(false)');\n}\n\n//CHECK#11\nif (!(\"1\" !== {valueOf: function () {return \"1\"}})) {\n $ERROR('#11: \"1\" !== {valueOf: function () {return \"1\"}}');\n}\n\n",
"id": "S11.9.5_A8_T3"
},
{
"section": "11.9.5, 11.9.6",
"description": "x or y is null or undefined",
"test": "//CHECK#1\nif (!(undefined !== null)) {\n $ERROR('#1: undefined !== null');\n}\n\n//CHECK#2\nif (!(null !== undefined)) {\n $ERROR('#2: null !== undefined');\n}\n\n//CHECK#3\nif (!(null !== 0)) {\n $ERROR('#3: null !== 0');\n}\n\n//CHECK#4\nif (!(0 !== null)) {\n $ERROR('#4: 0 !== null');\n}\n\n//CHECK#5\nif (!(null !== false)) {\n $ERROR('#5: null !== false');\n}\n\n//CHECK#6\nif (!(false !== null)) {\n $ERROR('#6: false !== null');\n}\n\n//CHECK#7\nif (!(undefined !== false)) {\n $ERROR('#7: undefined !== false');\n}\n\n//CHECK#8\nif (!(false !== undefined)) {\n $ERROR('#8: false !== undefined');\n}\n\n//CHECK#9\nif (!(null !== new Object())) {\n $ERROR('#9: null !== new Object()');\n}\n\n//CHECK#10\nif (!(new Object() !== null)) {\n $ERROR('#10: new Object() !== null');\n}\n\n//CHECK#11\nif (!(null !== \"null\")) {\n $ERROR('#11: null !== \"null\"');\n}\n\n//CHECK#12\nif (!(\"null\" !== null)) {\n $ERROR('#12: \"null\" !== null');\n}\n\n//CHECK#13\nif (!(undefined !== \"undefined\")) {\n $ERROR('#13: undefined !== \"undefined\"');\n}\n\n//CHECK#14\nif (!(\"undefined\" !== undefined)) {\n $ERROR('#14: \"undefined\" !== undefined');\n}\n",
"id": "S11.9.5_A8_T4"
},
{
"section": "11.9.5, 11.9.6",
"description": "Checking such x and y that either x or y is primitive string and the other is primitive number",
"test": "//CHECK#1\ntry {\n throw 1;\n} catch(e) {\n if (!(e !== \"1\")) {\n $ERROR('#1: throw 1 !== \"1\"');\n }\n}\n\n//CHECK#2\ntry {\n throw \"1\";\n} catch(e) {\n if (!(1 !== e)) {\n $ERROR('#2: 1 !== throw \"1\"');\n }\n} \n",
"id": "S11.9.5_A8_T5"
}
]
}
}

View File

@ -0,0 +1,50 @@
{
"testCollection": {
"name": "12.1",
"numTests": 7,
"tests": [
{
"id": "12.1-1",
"path": "TestCases/chapter12/12.1/12.1-1.js",
"description": "12.1 - block '{ StatementListopt };' is not allowed: try-catch",
"test": "assertTrue((function testcase() {\n try {\n eval(\"try{};catch(){}\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n"
},
{
"id": "12.1-2",
"path": "TestCases/chapter12/12.1/12.1-2.js",
"description": "12.1 - block '{ StatementListopt };' is not allowed: try-catch-finally",
"test": "assertTrue((function testcase() {\n try {\n eval(\"try{};catch{};finally{}\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n"
},
{
"id": "12.1-3",
"path": "TestCases/chapter12/12.1/12.1-3.js",
"description": "12.1 - block '{ StatementListopt };' is not allowed: try-finally",
"test": "assertTrue((function testcase() {\n try {\n eval(\"try{};finally{}\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n"
},
{
"id": "12.1-4",
"path": "TestCases/chapter12/12.1/12.1-4.js",
"description": "12.1 - block '{ StatementListopt };' is not allowed: if-else",
"test": "assertTrue((function testcase() {\n try {\n eval(\"if{};else{}\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n"
},
{
"id": "12.1-5",
"path": "TestCases/chapter12/12.1/12.1-5.js",
"description": "12.1 - block '{ StatementListopt };' is not allowed: if-else-if",
"test": "assertTrue((function testcase() {\n try {\n eval(\"if{};else if{}\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n"
},
{
"id": "12.1-6",
"path": "TestCases/chapter12/12.1/12.1-6.js",
"description": "12.1 - block '{ StatementListopt };' is not allowed: if-else-if-else",
"test": "assertTrue((function testcase() {\n try {\n eval(\"if{};else if{};else{}\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n"
},
{
"id": "12.1-7",
"path": "TestCases/chapter12/12.1/12.1-7.js",
"description": "12.1 - block '{ StatementListopt };' is not allowed: do-while",
"test": "assertTrue((function testcase() {\n try {\n eval(\"do{};while()\");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,126 @@
{
"testCollection": {
"name": "12.10.1",
"numTests": 15,
"tests": [
{
"id": "12.10.1-1-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-1-s.js",
"description": "with statement in strict mode throws SyntaxError (strict function)",
"test": "assertTrue((function testcase() {\n\n try {\n // wrapping it in eval since this needs to be a syntax error. The\n // exception thrown must be a SyntaxError exception.\n eval(\"\\\n function f() {\\\n \\'use strict\\';\\\n var o = {}; \\\n with (o) {};\\\n }\\\n \");\n return false;\n }\n catch (e) {\n return(e instanceof SyntaxError); \n\t}\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-10-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-10-s.js",
"description": "with statement in strict mode throws SyntaxError (eval, where the container function is strict)",
"test": "assertTrue((function testcase() {\n 'use strict';\n \n // wrapping it in eval since this needs to be a syntax error. The\n // exception thrown must be a SyntaxError exception. Note that eval\n // inherits the strictness of its calling context. \n try {\n eval(\"\\\n var o = {};\\\n with (o) {}\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-11-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-11-s.js",
"description": "Strict Mode - SyntaxError is thrown when using WithStatement in strict mode code",
"test": "assertTrue((function testcase() {\n \"use strict\";\n try {\n eval(\"with ({}) { throw new Error();}\");\n\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-12-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-12-s.js",
"description": "with statement in strict mode throws SyntaxError (strict eval)",
"test": "assertTrue((function testcase() {\n try {\n eval(\"\\\n 'use strict'; \\\n var o = {}; \\\n with (o) {}\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError) ;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-13-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-13-s.js",
"description": "Strict Mode - SyntaxError isn't thrown when WithStatement body is in strict mode code",
"test": "assertTrue((function testcase() {\n with ({}) {\n \"use strict\";\n }\n return true;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "12.10.1-14-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-14-s.js",
"description": "Strict Mode - SyntaxError is thrown when the getter of a literal object utilizes WithStatement",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var obj = { get: function (a) { with(a){} } }; \");\n\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-15-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-15-s.js",
"description": "Strict Mode - SyntaxError is thrown when the RHS of a dot property assignment utilizes WithStatement",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var obj = {}; obj.get = function (a) { with(a){} }; \");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-16-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-16-s.js",
"description": "Strict Mode - SyntaxError is thrown when the RHS of an object indexer assignment utilizes WithStatement",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"var obj = {}; obj['get'] = function (a) { with(a){} }; \");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-2-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-2-s.js",
"description": "with statement in strict mode throws SyntaxError (nested function where container is strict)",
"test": "assertTrue((function testcase() {\n try {\n // wrapping it in eval since this needs to be a syntax error. The\n // exception thrown must be a SyntaxError exception.\n eval(\"\\\n function foo() {\\\n \\'use strict\\'; \\\n function f() {\\\n var o = {}; \\\n with (o) {};\\\n }\\\n }\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-3-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-3-s.js",
"description": "with statement in strict mode throws SyntaxError (nested strict function)",
"test": "assertTrue((function testcase() {\n try {\n // wrapping it in eval since this needs to be a syntax error. The\n // exception thrown must be a SyntaxError exception.\n eval(\"\\\n function foo() {\\\n function f() {\\\n \\'use strict\\'; \\\n var o = {}; \\\n with (o) {};\\\n }\\\n }\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-4-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-4-s.js",
"description": "with statement in strict mode throws SyntaxError (strict Function)",
"test": "assertTrue((function testcase() {\n try {\n var f = Function(\"\\\n \\'use strict\\'; \\\n var o = {}; \\\n with (o) {};\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n\t\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-5-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-5-s.js",
"description": "with statement allowed in nested Function even if its container Function is strict)",
"test": "assertTrue((function testcase() {\n \n Function(\"\\'use strict\\'; var f1 = Function( \\\"var o = {}; with (o) {};\\\")\");\n return true;\n \n }).call(this));\n",
"strict_only": ""
},
{
"id": "12.10.1-7-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-7-s.js",
"description": "with statement in strict mode throws SyntaxError (function expression, where the container function is directly evaled from strict code)",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval(\"var f = function () {\\\n var o = {}; \\\n with (o) {}; \\\n }\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-8-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-8-s.js",
"description": "with statement in strict mode throws SyntaxError (function expression, where the container Function is strict)",
"test": "assertTrue((function testcase() {\n try {\n Function(\"\\\n \\'use strict\\'; \\\n var f1 = function () {\\\n var o = {}; \\\n with (o) {}; \\\n }\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.10.1-9-s",
"path": "TestCases/chapter12/12.10/12.10.1/12.10.1-9-s.js",
"description": "with statement in strict mode throws SyntaxError (strict function expression)",
"test": "assertTrue((function testcase() {\n try {\n eval(\"\\\n var f = function () {\\\n \\'use strict\\';\\\n var o = {}; \\\n with (o) {}; \\\n }\\\n \");\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError) ;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,80 @@
{
"testCollection": {
"name": "12.10",
"numTests": 12,
"tests": [
{
"id": "12.10-0-1",
"path": "TestCases/chapter12/12.10/12.10-0-1.js",
"description": "with does not change declaration scope - vars in with are visible outside",
"test": "assertTrue((function testcase() {\n var o = {};\n var f = function () {\n\t/* capture foo binding before executing with */\n\treturn foo;\n }\n\n with (o) {\n var foo = \"12.10-0-1\";\n }\n\n return f()===\"12.10-0-1\"\n\n }).call(this));\n"
},
{
"id": "12.10-0-10",
"path": "TestCases/chapter12/12.10/12.10-0-10.js",
"description": "with introduces scope - name lookup finds function parameter",
"test": "assertTrue((function testcase() {\n function f(o) {\n\n function innerf(o, x) {\n with (o) {\n return x;\n }\n }\n\n return innerf(o, 42);\n }\n \n if (f({}) === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.10-0-11",
"path": "TestCases/chapter12/12.10/12.10-0-11.js",
"description": "with introduces scope - name lookup finds inner variable",
"test": "assertTrue((function testcase() {\n function f(o) {\n\n function innerf(o) {\n var x = 42;\n\n with (o) {\n return x;\n }\n }\n\n return innerf(o);\n }\n \n if (f({}) === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.10-0-12",
"path": "TestCases/chapter12/12.10/12.10-0-12.js",
"description": "with introduces scope - name lookup finds property",
"test": "assertTrue((function testcase() {\n function f(o) {\n\n function innerf(o) {\n with (o) {\n return x;\n }\n }\n\n return innerf(o);\n }\n \n if (f({x:42}) === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.10-0-3",
"path": "TestCases/chapter12/12.10/12.10-0-3.js",
"description": "with introduces scope - that is captured by function expression",
"test": "assertTrue((function testcase() {\n var o = {prop: \"12.10-0-3 before\"};\n var f;\n\n with (o) {\n f = function () { return prop; }\n }\n o.prop = \"12.10-0-3 after\";\n return f()===\"12.10-0-3 after\"\n }).call(this));\n"
},
{
"id": "12.10-0-7",
"path": "TestCases/chapter12/12.10/12.10-0-7.js",
"description": "with introduces scope - scope removed when exiting with statement",
"test": "assertTrue((function testcase() {\n var o = {foo: 1};\n\n with (o) {\n foo = 42;\n }\n\n try {\n foo;\n }\n catch (e) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.10-0-8",
"path": "TestCases/chapter12/12.10/12.10-0-8.js",
"description": "with introduces scope - var initializer sets like named property",
"test": "assertTrue((function testcase() {\n var o = {foo: 42};\n\n with (o) {\n var foo = \"set in with\";\n }\n\n return o.foo === \"set in with\";\n }).call(this));\n"
},
{
"id": "12.10-0-9",
"path": "TestCases/chapter12/12.10/12.10-0-9.js",
"description": "with introduces scope - name lookup finds outer variable",
"test": "assertTrue((function testcase() {\n function f(o) {\n var x = 42;\n\n function innerf(o) {\n with (o) {\n return x;\n }\n }\n\n return innerf(o);\n }\n \n if (f({}) === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.10-2-1",
"path": "TestCases/chapter12/12.10/12.10-2-1.js",
"description": "with - expression being Number",
"test": "assertTrue((function testcase() {\n var o = 2;\n var foo = 1;\n try\n {\n with (o) {\n foo = 42;\n }\n }\n catch(e)\n {\n }\n return true;\n \n }).call(this));\n"
},
{
"id": "12.10-2-2",
"path": "TestCases/chapter12/12.10/12.10-2-2.js",
"description": "with - expression being Boolean",
"test": "assertTrue((function testcase() {\n var o = true;\n var foo = 1;\n try\n {\n with (o) {\n foo = 42;\n }\n }\n catch(e)\n {\n }\n return true;\n \n }).call(this));\n"
},
{
"id": "12.10-2-3",
"path": "TestCases/chapter12/12.10/12.10-2-3.js",
"description": "with - expression being string",
"test": "assertTrue((function testcase() {\n var o = \"str\";\n var foo = 1;\n try\n {\n with (o) {\n foo = 42;\n }\n }\n catch(e)\n {\n }\n return true;\n \n }).call(this));\n"
},
{
"id": "12.10-7-1",
"path": "TestCases/chapter12/12.10/12.10-7-1.js",
"description": "with introduces scope - restores the earlier environment on exit",
"test": "assertTrue((function testcase() {\n var a = 1;\n\n var o = {a : 2};\n try\n {\n with (o) {\n a = 3;\n throw 1;\n a = 4;\n }\n }\n catch(e)\n {}\n\n if (a === 1 && o.a === 3) {\n return true;\n }\n\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,968 @@
{
"testCollection": {
"name": "12.10_The_with_Statement",
"numTests": 120,
"tests": [
{
"section": "12.10",
"description": "Using interation statement within \"with\" statement leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n do{\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n while(false);\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.10_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement within \"with\" statement leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n do{\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n while(false);\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.10_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statment withing \"with\" statement leading to completion by exception\niteration statement inside with statement - exception completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n do{\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n while(false);\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.10_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement witthin \"with\" staement leading to completion by break\niteration statement inside with statement - break completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n do{\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n break;\n }\n while(false);\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.10_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement within \"with\" statement leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n do{\n break;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n while(false);\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.10_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n}\n\nwith(myObj){\n f();\n}\n\nif(!(p1 === \"x1\")){\n $ERROR('#1: p1 === \"x1\". Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\ntry{\n p3;\n $ERROR('#3: p3 is nod defined');\n}\ncatch(e){\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === parseInt)){\n $ERROR('#11: st_parseInt === parseInt. Actual: st_parseInt ==='+ st_parseInt );\n}\n\nif(!isNaN(st_NaN)){\n $ERROR('#12: st_NaN === NaN. Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === Infinity)){\n $ERROR('#13: st_Infinity === Infinity. Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === eval)){\n $ERROR('#14: st_eval === eval. Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === parseFloat)){\n $ERROR('#15: st_parseFloat === parseFloat. Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === isNaN)){\n $ERROR('#16: st_isNaN === isNaN. Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === isFinite)){\n $ERROR('#17: st_isFinite === isFinite. Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry {\n value;\n $ERROR('#18: value is not defined');\n} catch(e) { \n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.11_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n return value;\n}\n\nwith(myObj){\n result = f();\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === \"x1\")){\n $ERROR('#1: p1 === \"x1\". Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\ntry{\n p3;\n $ERROR('#3: p3 is nod defined');\n}\ncatch(e){\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === parseInt)){\n $ERROR('#11: st_parseInt === parseInt. Actual: st_parseInt ==='+ st_parseInt );\n}\n\nif(!isNaN(st_NaN)){\n $ERROR('#12: st_NaN === NaN. Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === Infinity)){\n $ERROR('#13: st_Infinity === Infinity. Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === eval)){\n $ERROR('#14: st_eval === eval. Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === parseFloat)){\n $ERROR('#15: st_parseFloat === parseFloat. Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === isNaN)){\n $ERROR('#16: st_isNaN === isNaN. Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === isFinite)){\n $ERROR('#17: st_isFinite === isFinite. Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry {\n value;\n $ERROR('#18: value is not defined');\n} catch(e) { \n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.11_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n return value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n}\n\nwith(myObj){\n result = f();\n}\n\nif(!(result === undefined)){\n $ERROR('#0: result === undefined. Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry{\n p4;\n $ERROR('#4: p4 doesn\\'t exists');\n}\ncatch(e){\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry {\n value;\n $ERROR('#18: value is not defined');\n} catch(e) { \n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.11_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n with(myObj){\n f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === \"x1\")){\n $ERROR('#1: p1 === \"x1\". Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\ntry{\n p3;\n $ERROR('#3: p3 is nod defined');\n}\ncatch(e){\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === parseInt)){\n $ERROR('#11: st_parseInt === parseInt. Actual: st_parseInt ==='+ st_parseInt );\n}\n\nif(!isNaN(st_NaN)){\n $ERROR('#12: st_NaN === NaN. Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === Infinity)){\n $ERROR('#13: st_Infinity === Infinity. Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === eval)){\n $ERROR('#14: st_eval === eval. Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === parseFloat)){\n $ERROR('#15: st_parseFloat === parseFloat. Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === isNaN)){\n $ERROR('#16: st_isNaN === isNaN. Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === isFinite)){\n $ERROR('#17: st_isFinite === isFinite. Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry {\n value;\n $ERROR('#18: value is not defined');\n} catch(e) { \n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.11_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n var f = function(){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n with(myObj){\n f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === undefined)){\n $ERROR('#0: result === undefined. Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry{\n p4;\n $ERROR('#4: p4 doesn\\'t exists');\n}\ncatch(e){\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry {\n value;\n $ERROR('#18: value is not defined');\n} catch(e) { \n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.11_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nf();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry{\n p4;\n $ERROR('#4: p4 doesn\\'t exists');\n}\ncatch(e){\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry {\n value;\n $ERROR('#18: value is not defined');\n} catch(e) { \n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.12_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n return value;\n }\n}\nresult = f();\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry{\n p4;\n $ERROR('#4: p4 doesn\\'t exists');\n}\ncatch(e){\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.12_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n return value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nresult = f();\n\nif(!(result === undefined)){\n $ERROR('#0: result === undefined. Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n\n",
"id": "S12.10_A1.12_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n }\n f();\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry {\n value;\n $ERROR('#18: value is not defined');\n} catch(e) { \n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.12_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n var f = function(){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n }\n f();\n} catch(e){\n result = e;\n}\n\nif(!(result === undefined)){\n $ERROR('#0: result === undefined. Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n\n",
"id": "S12.10_A1.12_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" inside of global context leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.1_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" inside of global context leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.1_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" inside of global context leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.1_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement when the statement itself is declared within the function declaration, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nf();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.2_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement when the statement itself is declared within the function declaration, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n return value;\n }\n}\nresult = f();\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.2_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement when the statement itself is declared within the function declaration, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n with(myObj){\n return value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nresult = f();\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n\n",
"id": "S12.10_A1.2_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement when the statement itself is declared within the function declaration, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n var f = function(){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n }\n f();\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.2_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement when the statement itself is declared within the function declaration, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n var f = function(){\n with(myObj){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n }\n f();\n} catch(e){\n result = e;\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.2_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within function constructor, leading to normal completition",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nvar obj = new f();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.3_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within function constructor, leading to normal completition by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n return value;\n }\n}\nvar obj = new f();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.3_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within function constructor, leading to normal completition by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nvar f = function(){\n with(myObj){\n return value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nvar obj = new f();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n\n",
"id": "S12.10_A1.3_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within function constructor, leading to completition by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n var f = function(){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n }\n var obj = new f();\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.3_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within function constructor, leading to completition by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n var f = function(){\n with(myObj){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n }\n var obj = new f();\n} catch(e){\n result = e;\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n\n",
"id": "S12.10_A1.3_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ndo{\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nwhile(false);\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.4_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n do{\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n }\n while(false);\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.4_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n do{\n with(myObj){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n }\n while(false);\n} catch(e){\n result = e;\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.4_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ndo{\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n break;\n }\n}\nwhile(false);\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.4_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ndo{\n with(myObj){\n break;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\nwhile(false);\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 ===undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.4_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nfor(var prop in myObj){\n with(myObj){\n if(prop === 'p1') {\n st_p1 = p1;\n p1 = 'x1';\n }\n if(prop === 'p2') {\n st_p2 = p2;\n this.p2 = 'x2';\n }\n if(prop === 'p3') {\n st_p3 = p3;\n del = delete p3;\n }\n if(prop === 'parseInt') st_parseInt = parseInt;\n if(prop === 'NaN') st_NaN = NaN;\n if(prop === 'Infinity') st_Infinity = Infinity;\n if(prop === 'eval') st_eval = eval;\n if(prop === 'parseFloat') st_parseFloat = parseFloat;\n if(prop === 'isNaN') st_isNaN = isNaN;\n if(prop === 'isFinite') st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.5_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n for(var prop in myObj){\n with(myObj){\n st_p1 = p1;\n p1 = 'x1';\n st_p2 = p2;\n this.p2 = 'x2';\n st_p3 = p3;\n del = delete p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.5_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n for(var prop in myObj){\n with(myObj){\n throw value;\n if(prop === 'p1') {\n st_p1 = p1;\n p1 = 'x1';\n }\n if(prop === 'p2') {\n st_p2 = p2;\n this.p2 = 'x2';\n }\n if(prop === 'p3') {\n st_p3 = p3;\n del = delete p3;\n }\n if(prop === 'parseInt') st_parseInt = parseInt;\n if(prop === 'NaN') st_NaN = NaN;\n if(prop === 'Infinity') st_Infinity = Infinity;\n if(prop === 'eval') st_eval = eval;\n if(prop === 'parseFloat') st_parseFloat = parseFloat;\n if(prop === 'isNaN') st_isNaN = isNaN;\n if(prop === 'isFinite') st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.5_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nfor(var prop in myObj){\n with(myObj){\n st_p1 = p1;\n p1 = 'x1';\n st_p2 = p2;\n this.p2 = 'x2';\n st_p3 = p3;\n del = delete p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n break;\n }\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.5_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nfor(var prop in myObj){\n with(myObj){\n break;\n if(prop === 'p1') {\n st_p1 = p1;\n p1 = 'x1';\n }\n if(prop === 'p2') {\n st_p2 = p2;\n this.p2 = 'x2';\n }\n if(prop === 'p3') {\n st_p3 = p3;\n del = delete p3;\n }\n if(prop === 'parseInt') st_parseInt = parseInt;\n if(prop === 'NaN') st_NaN = NaN;\n if(prop === 'Infinity') st_Infinity = Infinity;\n if(prop === 'eval') st_eval = eval;\n if(prop === 'parseFloat') st_parseFloat = parseFloat;\n if(prop === 'isNaN') st_isNaN = isNaN;\n if(prop === 'isFinite') st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.5_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within another \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.6_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within another \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n with(myObj){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.6_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within another \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n with(myObj){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#0: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.6_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared within the statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n f();\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.7_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared within the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n return value;\n }\n result = f();\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.7_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared within the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n return value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n result = f();\n}\n\nif(!(result === undefined)){\n $ERROR('#0: result === undefined. Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.7_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared within the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.7_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared within the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n var f = function(){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === undefined)){\n $ERROR('#0: result === undefined. Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.7_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n var obj = new f();\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.8_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n return value;\n }\n var obj = new f();\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.8_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n var f = function(){\n return value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n var obj = new f();\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.8_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n var f = function(){\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n throw value;\n }\n var obj = new f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === \"value\")){\n $ERROR('#0: result === \"value\". Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.8_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\ntry {\n with(myObj){\n var f = function(){\n throw value;\n st_p1 = p1;\n st_p2 = p2;\n st_p3 = p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n p1 = 'x1';\n this.p2 = 'x2';\n del = delete p3;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n var obj = new f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(result === undefined)){\n $ERROR('#0: result === undefined. Actual: result ==='+ result );\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\ntry {\n p4;\n $ERROR('#4: p4 is not defined');\n} catch(e) { \n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\ntry{\n value;\n $ERROR('#18: value is not defined');\n}\ncatch(e){\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.8_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"for-in\" statement within \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n for(var prop in myObj){\n if(prop === 'p1') {\n st_p1 = p1;\n p1 = 'x1';\n }\n if(prop === 'p2') {\n st_p2 = p2;\n this.p2 = 'x2';\n }\n if(prop === 'p3') {\n st_p3 = p3;\n del = delete p3;\n }\n if(prop === 'parseInt') st_parseInt = parseInt;\n if(prop === 'NaN') st_NaN = NaN;\n if(prop === 'Infinity') st_Infinity = Infinity;\n if(prop === 'eval') st_eval = eval;\n if(prop === 'parseFloat') st_parseFloat = parseFloat;\n if(prop === 'isNaN') st_isNaN = isNaN;\n if(prop === 'isFinite') st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.9_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"for-in\" statement within \"with\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n for(var prop in myObj){\n st_p1 = p1;\n p1 = 'x1';\n st_p2 = p2;\n this.p2 = 'x2';\n st_p3 = p3;\n del = delete p3;\n st_parseInt = parseInt;\n st_NaN = NaN;\n st_Infinity = Infinity;\n st_eval = eval;\n st_parseFloat = parseFloat;\n st_isNaN = isNaN;\n st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n break;\n }\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === \"x2\")){\n $ERROR('#2: p2 === \"x2\". Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === \"x4\")){\n $ERROR('#4: p4 === \"x4\". Actual: p4 ==='+ p4 );\n}\n\nif(!(p5 === \"x5\")){\n $ERROR('#5: p5 === \"x5\". Actual: p5 ==='+ p5 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#6: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === undefined)){\n $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt !== parseInt)){\n $ERROR('#11: myObj.parseInt !== parseInt');\n}\n\nif(!(st_NaN === \"obj_NaN\")){\n $ERROR('#12: myObj.NaN !== NaN');\n}\n\nif(!(st_Infinity !== Infinity)){\n $ERROR('#13: myObj.Infinity !== Infinity');\n}\n\nif(!(st_eval !== eval)){\n $ERROR('#14: myObj.eval !== eval');\n}\n\nif(!(st_parseFloat !== parseFloat)){\n $ERROR('#15: myObj.parseFloat !== parseFloat');\n}\n\nif(!(st_isNaN !== isNaN)){\n $ERROR('#16: myObj.isNaN !== isNaN');\n}\n\nif(!(st_isFinite !== isFinite)){\n $ERROR('#17: myObj.isFinite !== isFinite');\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"value\")){\n $ERROR('#19: myObj.value === \"value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.9_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"for-in\" statement within \"with\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nthis.p2 = 2;\nthis.p3 = 3;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\nvar del;\nvar st_p1 = \"p1\";\nvar st_p2 = \"p2\";\nvar st_p3 = \"p3\";\nvar st_parseInt = \"parseInt\";\nvar st_NaN = \"NaN\";\nvar st_Infinity = \"Infinity\";\nvar st_eval = \"eval\";\nvar st_parseFloat = \"parseFloat\";\nvar st_isNaN = \"isNaN\";\nvar st_isFinite = \"isFinite\";\n\nwith(myObj){\n for(var prop in myObj){\n break;\n if(prop === 'p1') {\n st_p1 = p1;\n p1 = 'x1';\n }\n if(prop === 'p2') {\n st_p2 = p2;\n this.p2 = 'x2';\n }\n if(prop === 'p3') {\n st_p3 = p3;\n del = delete p3;\n }\n if(prop === 'parseInt') st_parseInt = parseInt;\n if(prop === 'NaN') st_NaN = NaN;\n if(prop === 'Infinity') st_Infinity = Infinity;\n if(prop === 'eval') st_eval = eval;\n if(prop === 'parseFloat') st_parseFloat = parseFloat;\n if(prop === 'isNaN') st_isNaN = isNaN;\n if(prop === 'isFinite') st_isFinite = isFinite;\n var p4 = 'x4';\n p5 = 'x5';\n var value = 'value';\n }\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(p2 === 2)){\n $ERROR('#2: p2 === 2. Actual: p2 ==='+ p2 );\n}\n\nif(!(p3 === 3)){\n $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );\n}\n\nif(!(p4 === undefined)){\n $ERROR('#4: p4 === undefined. Actual: p4 ==='+ p4 );\n}\n\ntry {\n p5;\n $ERROR('#5: p5 is not defined');\n} catch(e) { \n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#6: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(myObj.p2 === \"b\")){\n $ERROR('#7: myObj.p2 === \"b\". Actual: myObj.p2 ==='+ myObj.p2 );\n}\n\nif(!(myObj.p3 === \"c\")){\n $ERROR('#8: myObj.p3 === \"c\". Actual: myObj.p3 ==='+ myObj.p3 );\n}\n\nif(!(myObj.p4 === undefined)){\n $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );\n}\n\nif(!(myObj.p5 === undefined)){\n $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );\n}\n\nif(!(st_parseInt === \"parseInt\")){\n $ERROR('#11: myObj.parseInt === \"parseInt\". Actual: myObj.parseInt ==='+ myObj.parseInt );\n}\n\nif(!(st_NaN === \"NaN\")){\n $ERROR('#12: st_NaN === \"NaN\". Actual: st_NaN ==='+ st_NaN );\n}\n\nif(!(st_Infinity === \"Infinity\")){\n $ERROR('#13: st_Infinity === \"Infinity\". Actual: st_Infinity ==='+ st_Infinity );\n}\n\nif(!(st_eval === \"eval\")){\n $ERROR('#14: st_eval === \"eval\". Actual: st_eval ==='+ st_eval );\n}\n\nif(!(st_parseFloat === \"parseFloat\")){\n $ERROR('#15: st_parseFloat === \"parseFloat\". Actual: st_parseFloat ==='+ st_parseFloat );\n}\n\nif(!(st_isNaN === \"isNaN\")){\n $ERROR('#16: st_isNaN === \"isNaN\". Actual: st_isNaN ==='+ st_isNaN );\n}\n\nif(!(st_isFinite === \"isFinite\")){\n $ERROR('#17: st_isFinite === \"isFinite\". Actual: st_isFinite ==='+ st_isFinite );\n}\n\nif(!(value === undefined)){\n $ERROR('#18: value === undefined. Actual: value ==='+ value );\n}\n\nif(!(myObj.value === \"myObj_value\")){\n $ERROR('#19: myObj.value === \"myObj_value\". Actual: myObj.value ==='+ myObj.value );\n}\n",
"id": "S12.10_A1.9_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement within \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n do{\n p1 = 'x1';\n } while(false);\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.10_A3.10_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement within \"with\" statement, leading completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n do{\n p1 = 'x1';\n throw value;\n } while(false);\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"x1\"){\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.10_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement within \"with\" statement, leading completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n do{\n throw value;\n p1 = 'x1';\n } while(false);\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.10_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement within \"with\" statement, leading completion be break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n do{\n p1 = 'x1';\n break;\n } while(false);\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.10_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using iteration statement within \"with\" statement, leading completion be break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n do{\n break;\n p1 = 'x1';\n } while(false);\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.10_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar f = function(){\n p1 = 'x1';\n}\n\nwith(myObj){\n f();\n}\n\nif(!(p1 === \"x1\")){\n $ERROR('#1: p1 === \"x1\". Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n",
"id": "S12.10_A3.11_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar f = function(){\n p1 = 'x1';\n return value;\n}\n\nwith(myObj){\n result = f();\n}\n\nif(!(p1 === \"x1\")){\n $ERROR('#1: p1 === \"x1\". Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"value\")){\n $ERROR('#3: result === \"value\". Actual: result ==='+ result );\n}\n",
"id": "S12.10_A3.11_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar f = function(){\n return value;\n p1 = 'x1';\n}\n\nwith(myObj){\n result = f();\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"value\")){\n $ERROR('#3: result === \"value\". Actual: result ==='+ result );\n}\n\n",
"id": "S12.10_A3.11_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n var f = function(){\n p1 = 'x1';\n throw value;\n }\n \n with(myObj){\n f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(p1 === \"x1\")){\n $ERROR('#1: p1 === \"x1\". Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"value\")){\n $ERROR('#3: result === \"value\". Actual: result ==='+ result );\n}\n\n\n",
"id": "S12.10_A3.11_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function within \"with\" statement declared without the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n var f = function(){\n throw value;\n p1 = 'x1';\n }\n with(myObj){\n f();\n }\n} catch(e){\n result = e;\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"value\")){\n $ERROR('#3: result === \"value\". Actual: result ==='+ result );\n}\n\n",
"id": "S12.10_A3.11_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n var f = function(){\n p1 = 'x1';\n }\n}\n\nf();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n",
"id": "S12.10_A3.12_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n var f = function(){\n p1 = 'x1'\n return value;\n }\n}\n\nresult = f();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#3: result === \"myObj_value\". Actual: result ==='+ result );\n}\n",
"id": "S12.10_A3.12_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n var f = function(){\n return value;\n p1 = 'x1';\n }\n}\nresult = f();\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#3: result === \"myObj_value\". Actual: result ==='+ result );\n}\n",
"id": "S12.10_A3.12_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n var f = function(){\n p1 = 'x1';\n throw value;\n }\n }\n f();\n} catch(e){\n result = e;\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"x1\")){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#3: result === \"myObj_value\". Actual: result ==='+ result );\n}\n\n",
"id": "S12.10_A3.12_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Calling a function without \"with\" statement declared within the statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar value = \"value\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n var f = function(){\n throw value;\n p1 = 'x1';\n }\n }\n f();\n} catch(e){\n result = e;\n}\n\nif(!(p1 === 1)){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n\nif(!(myObj.p1 === \"a\")){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n\nif(!(result === \"myObj_value\")){\n $ERROR('#3: result === \"myObj_value\". Actual: result ==='+ result );\n}\n",
"id": "S12.10_A3.12_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within global context - normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\n\nwith(myObj){\n p1 = 'x1';\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.1_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within global context, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n\n with(myObj){\n \n p1 = 'x1'\n throw value;\n \n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (myObj.p1 !== \"x1\") {\n\t$ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.1_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within global context, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar result = \"result\";\nvar myObj = {p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n\n with(myObj){\n \n throw value;\n p1 = 'x1'\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(!(result === 1)){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(!(p1 === 1)){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(!(myObj.p1 === \"a\")){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n\n",
"id": "S12.10_A3.1_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function body, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar f = function(){\n with(myObj){\n p1 = 'x1';\n }\n}\n\nf();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.2_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function body, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar f = function(){\n with(myObj){\n p1 = 'x1';\n return value;\n }\n};\n\nf();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 !== \"x1\"){\n $ERROR('#1: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.2_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function body, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar f = function(){\n with(myObj){\n return value;\n p1 = 'x1';\n }\n};\n\nf();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.2_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function body, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n var f = function(){\n with(myObj){\n p1 = 'x1';\n throw value;\n }\n };\n \n f();\n} catch(e){\n result = p1;\n}\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"x1\"){\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.2_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function body, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n};\n\ntry {\n var f = function(){\n with(myObj){\n throw value;\n p1 = 'x1';\n }\n };\n f();\n} catch(e){\n result = p1;\n}\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n\n",
"id": "S12.10_A3.2_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function constructor, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nfunction __FACTORY(){\n with(myObj){\n p1 = 'x1';\n }\n}\n\nvar obj = new __FACTORY();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.3_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function constructor, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nfunction __FACTORY(){\n with(myObj){\n p1 = 'x1';\n return value;\n }\n}\n\nvar obj = new __FACTORY;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.3_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function constructor, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nfunction __FACTORY(){\n with(myObj){\n return value;\n p1 = 'x1';\n }\n}\n\nvar obj = new __FACTORY;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.3_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function constructor, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n};\n\nfunction __FACTORY(){\n with(myObj){\n var p1 = 'x1';\n throw value;\n }\n}\n\ntry {\n var obj = new __FACTORY();\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (result !== 1) {\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (p1 !== 1) {\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (myObj.p1 !== \"x1\") {\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.3_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring \"with\" statement within a function constructor, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n function __FACTORY(){\n with(myObj){\n throw value;\n p1 = 'x1';\n }\n }\n var obj = new __FACTORY();\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.10_A3.3_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ndo {\n with(myObj){\n p1 = 'x1';\n }\n} while(false);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.4_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n do{\n with(myObj){\n p1 = 'x1';\n throw value;\n }\n } while(false);\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"x1\"){\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.4_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n do{\n with(myObj){\n throw value;\n p1 = 'x1';\n }\n } while(false);\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.4_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ndo {\n with(myObj){\n p1 = 'x1';\n break;\n }\n} while(false);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.4_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within iteration statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ndo {\n with(myObj){\n break;\n p1 = 'x1';\n }\n} while(false);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.4_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nfor(var prop in myObj){\n with(myObj){\n p1 = 'x1';\n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.5_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n for(var prop in myObj){\n with(myObj){\n p1 = 'x1';\n throw value;\n }\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"x1\"){\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.5_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n for(var prop in myObj){\n with(myObj){\n throw value;\n p1 = 'x1';\n }\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.5_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nfor(var prop in myObj){\n with(myObj){\n p1 = 'x1';\n break;\n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.5_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within \"for-in\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nfor(var prop in myObj){\n with(myObj){\n break;\n p1 = 'x1';\n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 !== \"a\"){\n $ERROR('#1: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.10_A3.5_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within another \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar theirObj = {\n p1: true, \n value: 'theirObj_value',\n valueOf : function(){return 'thr_valueOf';}\n}\n\nwith(myObj){\n with(theirObj){\n p1 = 'x1';\n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(theirObj.p1 !== \"x1\"){\n $ERROR('#3: theirObj.p1 === \"x1\". Actual: theirObj.p1 ==='+ theirObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.6_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within another \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar theirObj = {\n p1: true, \n value: 'theirObj_value',\n valueOf : function(){return 'thr_valueOf';}\n}\n\n\ntry {\n with(myObj){\n with(theirObj){\n p1 = 'x1';\n throw value;\n }\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(theirObj.p1 !== \"x1\"){\n $ERROR('#3: theirObj.p1 === \"x1\". Actual: theirObj.p1 ==='+ theirObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.10_A3.6_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"with\" statement within another \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nvar theirObj = {\n p1: true, \n value: 'theirObj_value',\n valueOf : function(){return 'thr_valueOf';}\n}\n\n\ntry {\n with(myObj){\n with(theirObj){\n throw value;\n p1 = 'x1';\n \n }\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(theirObj.p1 !== true){\n $ERROR('#3: theirObj.p1 === true. Actual: theirObj.p1 ==='+ theirObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.10_A3.6_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring and calling a function within \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n (function(){\n p1 = 'x1';\n })();\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.7_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring and calling a function within \"with\" statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n result=(function(){\n p1 = 'x1';\n return value;\n })();\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(result !== \"myObj_value\"){\n $ERROR('#2: result === \"myObj_value\". Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"x1\"){\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.7_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring and calling a function within \"with\" statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n result=(function(){\n return value;\n p1 = 'x1';\n })();\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(result !== 'myObj_value'){\n $ERROR('#2: result === \\'myObj_value\\'. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.7_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring and calling a function within \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n (function (){\n p1 = 'x1';\n throw value;\n })();\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"x1\"){\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.7_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring and calling a function within \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n (function f(){\n throw value;\n p1 = 'x1';\n })();\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.7_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n var __FACTORY = function(){\n p1 = 'x1';\n }\n var obj = new __FACTORY;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.8_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n var __FACTORY = function(){\n p1 = 'x1';\n return value;\n }\n var obj = new __FACTORY;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.8_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to normal completion by \"return\"",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n var __FACTORY = function(){\n return value;\n p1 = 'x1';\n }\n var obj = new __FACTORY;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.8_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n var __FACTORY = function(){\n p1 = 'x1';\n throw value;\n }\n var obj = new __FACTORY;\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"x1\"){\n $ERROR('#3: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.8_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Declaring function constructor within \"with\" statement, leading to completion by exception",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\ntry {\n with(myObj){\n var __FACTORY = function(){\n throw value;\n p1 = 'x1';\n }\n var obj = new __FACTORY;\n }\n} catch(e){\n result = p1;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(result !== 1){\n $ERROR('#1: result === 1. Actual: result ==='+ result );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(p1 !== 1){\n $ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 !== \"a\"){\n $ERROR('#3: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A3.8_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"for-in\" statement within \"with\" statement, leading to normal completion",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n for(var prop in myObj){\n p1 = 'x1';\n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.10_A3.9_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"for-in\" statement within \"with\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n for(var prop in myObj){\n p1 = 'x1';\n break;\n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"x1\"){\n $ERROR('#2: myObj.p1 === \"x1\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.10_A3.9_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Using \"for-in\" statement within \"with\" statement, leading to completion by break",
"strict_mode_negative": "",
"test": "this.p1 = 1;\n\nvar result = \"result\";\n\nvar myObj = {\n p1: 'a', \n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';}\n}\n\nwith(myObj){\n for(var prop in myObj){\n break;\n p1 = 'x1';\n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(p1 !== 1){\n $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== \"a\"){\n $ERROR('#2: myObj.p1 === \"a\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.10_A3.9_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Changing string property",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar myObj = {\n p1: 'a', \n}\neval(\"with(myObj){p1='b'}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 !== 'b'){\n $ERROR('#1: myObj.p1 === \"b\". Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 === 1){\n $ERROR('#2: myObj.p1 !== 1');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A4_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Changing number property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: 1, \n}\neval(\"with(myObj){p1=2}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 !== 2){\n $ERROR('#1: myObj.p1 === 2. Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 === 'a'){\n $ERROR('#2: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A4_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Changing boolean property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: true, \n}\neval(\"with(myObj){p1=false}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 !== false){\n $ERROR('#1: myObj.p1 === false. Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 === 'a'){\n $ERROR('#2: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A4_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Changing object property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: {a:\"hello\"}, \n}\neval(\"with(myObj){p1={b:'hi'}}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1.a === \"hello\"){\n $ERROR('#1: myObj.p1.a !== \"hello\"');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1.b !== \"hi\"){\n $ERROR('#2: myObj.p1.b === \"hi\". Actual: myObj.p1.b ==='+ myObj.p1.b );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 === 'a'){\n $ERROR('#3: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A4_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Changing array property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: [1,2,3], \n}\neval(\"with(myObj){p1=[3,2,1]}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1[2] !== 1){\n $ERROR('#1: myObj.p1[2] === 1. Actual: myObj.p1[2] ==='+ myObj.p1[2] );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 === 'a'){\n $ERROR('#2: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A4_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Changing function property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: function(){return 0;}, \n}\neval(\"with(myObj){p1=function(){return 1;}}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1() !== 1){\n $ERROR('#1: myObj.p1 === 1. Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.p1 === 'a'){\n $ERROR('#2: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A4_T6",
"strict_only": ""
},
{
"section": "12.10",
"description": "Deleting string property",
"strict_mode_negative": "",
"test": "this.p1 = 1;\nvar myObj = {\n p1: 'a', \n del:false\n}\neval(\"with(myObj){del = delete p1}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 === 'a'){\n $ERROR('#1: myObj.p1 !== \"a\"');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== undefined){\n $ERROR('#2: myObj.p1 === undefined. Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.del !== true){\n $ERROR('#3: myObj.del === true. Actual: myObj.del ==='+ myObj.del );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(myObj.p1 === 1){\n $ERROR('#4: myObj.p1 !== 1');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A5_T1",
"strict_only": ""
},
{
"section": "12.10",
"description": "Deleting number property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: 1,\n del:false \n}\neval(\"with(myObj){del = delete p1}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 === 1){\n $ERROR('#1: myObj.p1 !== 1');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== undefined){\n $ERROR('#2: myObj.p1 === undefined . Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.del !== true){\n $ERROR('#3: myObj.del === true. Actual: myObj.del ===. Actual: myObj.del ==='+ myObj.del +myObj.del);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(myObj.p1 === 'a'){\n $ERROR('#4: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A5_T2",
"strict_only": ""
},
{
"section": "12.10",
"description": "Deleting boolean property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: true,\n del:false \n}\n\neval(\"with(myObj){del = delete p1}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(myObj.p1 === true){\n $ERROR('#1: myObj.p1 !== true ');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== undefined){\n $ERROR('#2: myObj.p1 === undefined . Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.del !== true){\n $ERROR('#3: myObj.del === true . Actual: myObj.del ==='+ myObj.del );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(myObj.p1 === 'a'){\n $ERROR('#4: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A5_T3",
"strict_only": ""
},
{
"section": "12.10",
"description": "Deleting object property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: {a:\"hello\"},\n del:false \n}\neval(\"with(myObj){del = delete p1}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\nif(myObj.p1.a === \"hello\"){\n $ERROR('#1: myObj.p1.a !== \"hello\" ');\n}\n}catch(e){var x=1};\nif(x !== 1){\n $ERROR('#1: x === 1. Actual: x ==='+ x );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== undefined){\n $ERROR('#2: myObj.p1 === undefined . Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.del !== true){\n $ERROR('#3: myObj.del === true . Actual: myObj.del ==='+ myObj.del );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(myObj.p1 === 'a'){\n $ERROR('#4: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A5_T4",
"strict_only": ""
},
{
"section": "12.10",
"description": "Deleting array property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: [1,2,3],\n del:false \n}\neval(\"with(myObj){del = delete p1}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\nif(myObj.p1[2] === 3){\n $ERROR('#1: myObj.p1[2] !== 3 ');\n}\n}catch(e){var x=1};\nif(x !== 1){\n $ERROR('#1: x === 1. Actual: x ==='+ x );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== undefined){\n $ERROR('#2: myObj.p1 === undefined . Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.del !== true){\n $ERROR('#3: myObj.del === true . Actual: myObj.del ==='+ myObj.del );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(myObj.p1 === 'a'){\n $ERROR('#4: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A5_T5",
"strict_only": ""
},
{
"section": "12.10",
"description": "Deleting function property",
"strict_mode_negative": "",
"test": "this.p1 = 'a';\nvar myObj = {\n p1: function(){return 0;}, \n del:false\n}\neval(\"with(myObj){del = delete p1}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\nif(myObj.p1() === 0){\n $ERROR('#1: myObj.p1() !== 0 ');\n}\n}catch(e){var x=1};\nif(x !== 1){\n $ERROR('#1: x === 1. Actual: x ==='+ x );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(myObj.p1 !== undefined){\n $ERROR('#2: myObj.p1 === undefined . Actual: myObj.p1 ==='+ myObj.p1 );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(myObj.del !== true){\n $ERROR('#3: myObj.del === true . Actual: myObj.del ==='+ myObj.del );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(myObj.p1 === 'a'){\n $ERROR('#4: myObj.p1 !== \\'a\\'');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.10_A5_T6",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,80 @@
{
"testCollection": {
"name": "12.11_The_switch_Statement",
"numTests": 11,
"tests": [
{
"section": "12.11",
"description": "Simple test using switch statement",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch(value) {\n case 0:\n result += 2;\n case 1:\n result += 4;\n break;\n case 2:\n result += 8;\n case 3:\n result += 16;\n default:\n result += 32;\n break;\n case 4:\n result += 64;\n }\n \n return result;\n}\n \nif(!(SwitchTest(0) === 6)){\n $ERROR(\"#1: SwitchTest(0) === 6. Actual: SwitchTest(0) ===\"+ SwitchTest(0) );\n}\n\nif(!(SwitchTest(1) === 4)){\n $ERROR(\"#2: SwitchTest(1) === 4. Actual: SwitchTest(1) ===\"+ SwitchTest(1) );\n}\n\nif(!(SwitchTest(2) === 56)){\n $ERROR(\"#3: SwitchTest(2) === 56. Actual: SwitchTest(2) ===\"+ SwitchTest(2) );\n}\n\nif(!(SwitchTest(3) === 48)){\n $ERROR(\"#4: SwitchTest(3) === 48. Actual: SwitchTest(3) ===\"+ SwitchTest(3) );\n}\n\nif(!(SwitchTest(4) === 64)){\n $ERROR(\"#5: SwitchTest(4) === 64. Actual: SwitchTest(4) ===\"+ SwitchTest(4) );\n}\n\nif(!(SwitchTest(true) === 32)){\n $ERROR(\"#6: SwitchTest(true) === 32. Actual: SwitchTest(true) ===\"+ SwitchTest(true) );\n}\n\nif(!(SwitchTest(false) === 32)){\n $ERROR(\"#7: SwitchTest(false) === 32. Actual: SwitchTest(false) ===\"+ SwitchTest(false) );\n}\n\nif(!(SwitchTest(null) === 32)){\n $ERROR(\"#8: SwitchTest(null) === 32. Actual: SwitchTest(null) ===\"+ SwitchTest(null) );\n}\n\nif(!(SwitchTest(void 0) === 32)){\n $ERROR(\"#9: SwitchTest(void 0) === 32. Actual: SwitchTest(void 0) ===\"+ SwitchTest(void 0) );\n}\n\nif(!(SwitchTest('0') === 32)){\n $ERROR(\"#10: SwitchTest('0') === 32. Actual: SwitchTest('0') ===\"+ SwitchTest('0') );\n}\n",
"id": "S12.11_A1_T1"
},
{
"section": "12.11",
"description": "Switch with different types of variables",
"test": "var x = new Number(2);\n\nfunction SwitchTest(value){\n var result = 0;\n \n switch(value) {\n case 0:\n result += 2;\n case '1':\n result += 4;\n break;\n case new Number(2):\n result += 8;\n case 3:\n result += 16;\n default:\n result += 32;\n break;\n case 4:\n result += 64;\n break;\n case x:\n result += 128;\n break;\n case 0:\n result += 256;\n case 1:\n result += 512;\n }\n \n return result;\n}\n \nif(!(SwitchTest(0) === 6)){\n $ERROR(\"#1: SwitchTest(0) === 6. Actual: SwitchTest(0) ===\"+ SwitchTest(0) );\n}\n\nif(!(SwitchTest(1) === 512)){\n $ERROR(\"#2: SwitchTest(1) === 512. Actual: SwitchTest(1) ===\"+ SwitchTest(1) );\n}\n\nif(!(SwitchTest(2) === 32)){\n $ERROR(\"#3: SwitchTest(2) === 32. Actual: SwitchTest(2) ===\"+ SwitchTest(2) );\n}\n\nif(!(SwitchTest(3) === 48)){\n $ERROR(\"#4: SwitchTest(3) === 48. Actual: SwitchTest(3) ===\"+ SwitchTest(3) );\n}\n\nif(!(SwitchTest(4) === 64)){\n $ERROR(\"#5: SwitchTest(4) === 64. Actual: SwitchTest(4) ===\"+ SwitchTest(4) );\n}\n\nif(!(SwitchTest(true) === 32)){\n $ERROR(\"#6: SwitchTest(true) === 32. Actual: SwitchTest(true) ===\"+ SwitchTest(true) );\n}\n\nif(!(SwitchTest(false) === 32)){\n $ERROR(\"#7: SwitchTest(false) === 32. Actual: SwitchTest(false) ===\"+ SwitchTest(false) );\n}\n\nif(!(SwitchTest(null) === 32)){\n $ERROR(\"#8: SwitchTest(null) === 32. Actual: SwitchTest(null) ===\"+ SwitchTest(null) );\n}\n\nif(!(SwitchTest(void 0) === 32)){\n $ERROR(\"#9: SwitchTest(void 0) === 32. Actual: SwitchTest(void 0) ===\"+ SwitchTest(void 0) );\n}\n\nif(!(SwitchTest('0') === 32)){\n $ERROR(\"#10: SwitchTest('0') === 32. Actual: SwitchTest('0') ===\"+ SwitchTest('0') );\n}\n\nif(!(SwitchTest(x) === 128)){\n $ERROR(\"#10: SwitchTest(x) === 128. Actual: SwitchTest(x) ===\"+ SwitchTest(x) );\n}\n",
"id": "S12.11_A1_T2"
},
{
"section": "12.11",
"description": "Using case with null, NaN, Infinity",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch(value) {\n case 0:\n result += 2;\n case 1:\n result += 4;\n break;\n case 2:\n result += 8;\n case 3:\n result += 16;\n default:\n result += 32;\n break;\n case null:\n result += 64;\n case NaN:\n result += 128;\n break;\n case Infinity:\n result += 256;\n case 2+3:\n result += 512;\n break;\n case undefined:\n result += 1024;\n }\n \n return result;\n}\n \nif(!(SwitchTest(0) === 6)){\n $ERROR(\"#1: SwitchTest(0) === 6. Actual: SwitchTest(0) ===\"+ SwitchTest(0) );\n}\n\nif(!(SwitchTest(1) === 4)){\n $ERROR(\"#2: SwitchTest(1) === 4. Actual: SwitchTest(1) ===\"+ SwitchTest(1) );\n}\n\nif(!(SwitchTest(2) === 56)){\n $ERROR(\"#3: SwitchTest(2) === 56. Actual: SwitchTest(2) ===\"+ SwitchTest(2) );\n}\n\nif(!(SwitchTest(3) === 48)){\n $ERROR(\"#4: SwitchTest(3) === 48. Actual: SwitchTest(3) ===\"+ SwitchTest(3) );\n}\n\nif(!(SwitchTest(4) === 32)){\n $ERROR(\"#5: SwitchTest(4) === 32. Actual: SwitchTest(4) ===\"+ SwitchTest(4) );\n}\n\nif(!(SwitchTest(5) === 512)){\n $ERROR(\"#5: SwitchTest(5) === 512. Actual: SwitchTest(5) ===\"+ SwitchTest(5) );\n}\n\nif(!(SwitchTest(true) === 32)){\n $ERROR(\"#6: SwitchTest(true) === 32. Actual: SwitchTest(true) ===\"+ SwitchTest(true) );\n}\n\nif(!(SwitchTest(false) === 32)){\n $ERROR(\"#7: SwitchTest(false) === 32. Actual: SwitchTest(false) ===\"+ SwitchTest(false) );\n}\n\nif(!(SwitchTest(null) === 192)){\n $ERROR(\"#8: SwitchTest(null) === 192. Actual: SwitchTest(null) ===\"+ SwitchTest(null) );\n}\n\nif(!(SwitchTest(void 0) === 1024)){\n $ERROR(\"#9: SwitchTest(void 0) === 1024. Actual: SwitchTest(void 0) ===\"+ SwitchTest(void 0) );\n}\n\nif(!(SwitchTest(NaN) === 32)){\n $ERROR(\"#10: SwitchTest(NaN) === 32. Actual: SwitchTest(NaN) ===\"+ SwitchTest(NaN) );\n}\n\nif(!(SwitchTest(Infinity) === 768)){\n $ERROR(\"#10: SwitchTest(NaN) === 768. Actual: SwitchTest(NaN) ===\"+ SwitchTest(NaN) );\n}\n",
"id": "S12.11_A1_T3"
},
{
"section": "12.11",
"description": "Using case with isNaN and isNaN(value)",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch(value) {\n case 0:\n result += 2;\n case 1:\n result += 4;\n break;\n case 2:\n result += 8;\n case isNaN(value):\n result += 16;\n default:\n result += 32;\n break;\n case null:\n result += 64;\n case isNaN:\n result += 128;\n break;\n case Infinity:\n result += 256;\n case 2+3:\n result += 512;\n break;\n case undefined:\n result += 1024;\n }\n \n return result;\n}\n \nif(!(SwitchTest(eval('Number(false)')) === 6)){\n $ERROR(\"#1: SwitchTest(0) === 6. Actual: SwitchTest(0) ===\"+ SwitchTest(0) );\n}\n\nif(!(SwitchTest(parseInt) === 32)){\n $ERROR(\"#2: SwitchTest(parseInt) === 32. Actual: SwitchTest(parseInt) ===\"+ SwitchTest(parseInt) );\n}\n\nif(!(SwitchTest(isNaN) === 128)){\n $ERROR(\"#3: SwitchTest(isNaN) === 128. Actual: SwitchTest(isNaN) ===\"+ SwitchTest(isNaN) );\n}\n\nif(!(SwitchTest(true) === 32)){\n $ERROR(\"#6: SwitchTest(true) === 32. Actual: SwitchTest(true) ===\"+ SwitchTest(true) );\n}\n\nif(!(SwitchTest(false) === 48)){\n $ERROR(\"#7: SwitchTest(false) === 48. Actual: SwitchTest(false) ===\"+ SwitchTest(false) );\n}\n\nif(!(SwitchTest(null) === 192)){\n $ERROR(\"#8: SwitchTest(null) === 192. Actual: SwitchTest(null) ===\"+ SwitchTest(null) );\n}\n\nif(!(SwitchTest(void 0) === 1024)){\n $ERROR(\"#9: SwitchTest(void 0) === 1024. Actual: SwitchTest(void 0) ===\"+ SwitchTest(void 0) );\n}\n\nif(!(SwitchTest(NaN) === 32)){\n $ERROR(\"#10: SwitchTest(NaN) === 32. Actual: SwitchTest(NaN) ===\"+ SwitchTest(NaN) );\n}\n\nif(!(SwitchTest(Infinity) === 768)){\n $ERROR(\"#10: SwitchTest(NaN) === 768. Actual: SwitchTest(NaN) ===\"+ SwitchTest(NaN) );\n}\n",
"id": "S12.11_A1_T4"
},
{
"section": "12.11",
"description": "Duplicate DefaultClause",
"negative": "",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch(value) {\n case 0:\n result += 2;\n default:\n result += 32;\n break;\n default:\n result += 32;\n break;\n }\n \n return result;\n}\n\nvar x = SwitchTest(0);\n",
"id": "S12.11_A2_T1"
},
{
"section": "12.11",
"description": "Checking if execution of \"switch() {}\" fails",
"negative": "",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch() {\n case 0:\n result += 2;\n default:\n result += 32;\n break;\n }\n \n return result;\n}\n\nvar x = SwitchTest(0);\n",
"id": "S12.11_A3_T1"
},
{
"section": "12.11",
"description": "Checking if execution of \"switch {}\" fails",
"negative": "",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch {\n case 0:\n result += 2;\n default:\n result += 32;\n break;\n }\n \n return result;\n}\n\nvar x = SwitchTest(0);\n",
"id": "S12.11_A3_T2"
},
{
"section": "12.11",
"description": "Checking if execution of \"switch(value)\" fails",
"negative": "",
"test": "switch(value);\n",
"id": "S12.11_A3_T3"
},
{
"section": "12.11",
"description": "Using \"case\" that has no Expresson after it. \"CaseClause: case Expression : [StatementList]\"",
"negative": "",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch(value) {\n case:\n result += 2;\n default:\n result += 32;\n break;\n }\n \n return result;\n}\n\nvar x = SwitchTest(0);\n",
"id": "S12.11_A3_T4"
},
{
"section": "12.11",
"description": "Introducing statement not followed by \"case\" keyword",
"negative": "",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch(value) {\n \tresult =2;\n case 0:\n result += 2;\n default:\n result += 32;\n break;\n }\n \n return result;\n}\n\nvar x = SwitchTest(0);\n",
"id": "S12.11_A3_T5"
},
{
"section": "12.11",
"description": "Nesting one \"switch\" statement into StatementList of the other's",
"test": "function SwitchTest(value){\n var result = 0;\n \n switch(value) {\n case 0:\n switch(value) {\n case 0:\n result += 3;\n break;\n default:\n result += 32;\n break;\n }\n result *= 2;\n break;\n result=3;\n default:\n result += 32;\n break;\n }\n return result;\n}\n\nvar x = SwitchTest(0);\nif(x!==6) $ERROR(\"#1: SwitchTest(0) === 6. Actual: SwitchTest(0) ===\"+ SwitchTest(0) );\n",
"id": "S12.11_A4_T1"
}
]
}
}

View File

@ -0,0 +1,14 @@
{
"testCollection": {
"name": "12.12_Labelled_Statements",
"numTests": 1,
"tests": [
{
"section": "12.12",
"description": "Checking if labelled break works. See continue and break sections",
"test": "var object = {p1: 1, p2: 1};\nvar result = 0;\nlbl: for(var i in object){\n result += object[i];\n break lbl;\n}\n\nif(!(result === 1)){\n $ERROR(\"'break label' should break execution of labelled iteration statement\");\n}\n",
"id": "S12.12_A1_T1"
}
]
}
}

View File

@ -0,0 +1,93 @@
{
"testCollection": {
"name": "12.13_The_throw_statement",
"numTests": 14,
"tests": [
{
"section": "12.13",
"description": "Trying to throw exception with \"throw\"",
"negative": "",
"test": "throw \"error\";\n",
"id": "S12.13_A1"
},
{
"section": "12.13",
"description": "Throwing undefined",
"test": "// CHECK#1\ntry{\n throw undefined;\n}\ncatch(e){\n if (e!==undefined) $ERROR('#1: Exception === undefined. Actual: Exception ==='+ e );\n}\n",
"id": "S12.13_A2_T1"
},
{
"section": "12.13",
"description": "Throwing null",
"test": "// CHECK#1\ntry{\n throw null;\n}\ncatch(e){\n if (e!==null) $ERROR('#1: Exception === null. Actual: Exception ==='+ e );\n}\n",
"id": "S12.13_A2_T2"
},
{
"section": "12.13",
"description": "Throwing boolean",
"test": "// CHECK#1\ntry{\n throw true;\n}\ncatch(e){\n if (e!==true) $ERROR('#1: Exception ===true. Actual: Exception ==='+ e );\n}\n\n// CHECK#2\ntry{\n throw false;\n}\ncatch(e){\n if (e!==false) $ERROR('#2: Exception ===false. Actual: Exception ==='+ e );\n}\n\n// CHECK#3\nvar b=false;\ntry{\n throw b;\n}\ncatch(e){\n if (e!==false) $ERROR('#3: Exception ===false. Actual: Exception ==='+ e );\n}\n\n// CHECK#4\nvar b=true;\ntry{\n throw b;\n}\ncatch(e){\n if (e!==true) $ERROR('#4: Exception ===true. Actual: Exception ==='+ e );\n}\n",
"id": "S12.13_A2_T3"
},
{
"section": "12.13",
"description": "Throwing string",
"test": "// CHECK#1\ntry{\n throw \"exception #1\";\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#1: Exception ===\"exception #1\". Actual: Exception ==='+ e );\n}\n\n// CHECK#2\nvar b=\"exception #1\";\ntry{\n throw b;\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#2: Exception ===\"exception #1\". Actual: Exception ==='+ e );\n}\n",
"id": "S12.13_A2_T4"
},
{
"section": "12.13",
"description": "Throwing number",
"test": "// CHECK#1\ntry{\n throw 13;\n}\ncatch(e){\n if (e!==13) $ERROR('#1: Exception ===13. Actual: Exception ==='+ e );\n}\n\n// CHECK#2\nvar b=13;\ntry{\n throw b;\n}\ncatch(e){\n if (e!==13) $ERROR('#2: Exception ===13. Actual: Exception ==='+ e );\n}\n\n// CHECK#3\ntry{\n throw 2.13;\n}\ncatch(e){\n if (e!==2.13) $ERROR('#3: Exception ===2.13. Actual: Exception ==='+ e );\n}\n\n// CHECK#4\ntry{\n throw NaN;\n}\ncatch(e){\n if (!isNaN(e)) $ERROR('#4: Exception is NaN');\n}\n\n// CHECK#5\ntry{\n throw +Infinity;\n}\ncatch(e){\n if (e!==+Infinity) $ERROR('#5: Exception ===+Infinity. Actual: Exception ==='+ e );\n}\n\n// CHECK#6\ntry{\n throw -Infinity;\n}\ncatch(e){\n if (e!==-Infinity) $ERROR('#6: Exception ===-Infinity. Actual: Exception ==='+ e );\n}\n\n// CHECK#7\ntry{\n throw +0;\n}\ncatch(e){\n if (e!==+0) $ERROR('#7: Exception ===+0. Actual: Exception ==='+ e );\n}\n\n// CHECK#8\ntry{\n throw -0;\n}\ncatch(e){\n if (e!==-0) $ERROR('#8: Exception ===-0. Actual: Exception ==='+ e );\n}\n",
"id": "S12.13_A2_T5"
},
{
"section": "12.13",
"description": "Throwing object",
"test": "var myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';},\n i:7\n}\n\ntry{\n throw myObj;\n}\ncatch(e){\t\n// CHECK#1\n if (e.p1!==\"a\") $ERROR('#1: e.p1 === \"a\". Actual: e.p1 ==='+ e.p1 );\n// CHECK#2\n if (e.value!=='myObj_value') $ERROR('#2: e.p1 === \\'myObj_value\\'. Actual: e.p1 ==='+ e.p1 );\n// CHECK#3\n if (e.eval()!=='obj_eval') $ERROR('#3: e.p1 === \\'obj_eval\\'. Actual: e.p1 ==='+ e.p1 );\n}\n\n// CHECK#4\nmyObj.i=6\ntry{\n throw myObj;\n}\ncatch(e){}\nif (myObj.i!==6) $ERROR('#4: Handling of catch must be correct');\n",
"id": "S12.13_A2_T6"
},
{
"section": "12.13",
"description": "Throwing Array",
"test": "var mycars = new Array();\nmycars[0] = \"Saab\";\nmycars[1] = \"Volvo\";\nmycars[2] = \"BMW\";\n\nvar mycars2 = new Array();\nmycars2[0] = \"Mercedes\";\nmycars2[1] = \"Jeep\";\nmycars2[2] = \"Suzuki\";\n\n// CHECK#1\ntry{\n throw mycars;\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars[i]) $ERROR('#1.'+i+': Exception['+i+'] === mycars['+i+']. Actual: Exception['+i+'] ==='+ e[i] );\n }\n}\n",
"id": "S12.13_A2_T7"
},
{
"section": "12.13",
"description": "Evaluating boolean expression",
"test": "// CHECK#1\nvar b=true;\ntry{\n throw b&&false;\n}\ncatch(e){\n if (e!==false) $ERROR('#1: Exception === false(operaton &&). Actual: Exception ==='+ e );\n}\n\n// CHECK#2\nvar b=true;\ntry{\n throw b||false;\n}\ncatch(e){\n if (e!==true) $ERROR('#2: Exception === true(operaton ||). Actual: Exception ==='+ e );\n}\n\n// CHECK#3\ntry{\n throw !false;\n}\ncatch(e){\n if (e!==true) $ERROR('#3: Exception === true(operaton !). Actual: Exception ==='+ e );\n}\n\n// CHECK#4\nvar b=true;\ntry{\n throw !(b&&false);\n}\ncatch(e){\n if (e!==true) $ERROR('#4: Exception === true(operaton &&). Actual: Exception ==='+ e );\n}\n",
"id": "S12.13_A3_T1"
},
{
"section": "12.13",
"description": "Evaluating string expression",
"test": "// CHECK#1\ntry{\n throw \"exception\"+\" #1\";\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#1: Exception === \"exception #1\"(operaton +). Actual: Exception ==='+ e );\n}\n\n// CHECK#2\nvar b=\"exception\"\nvar a=\" #1\";\ntry{\n throw b+a;\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#2: Exception === \"exception #1\"(operaton +). Actual: Exception ==='+ e );\n}\n",
"id": "S12.13_A3_T2"
},
{
"section": "12.13",
"description": "Evaluating number expression",
"test": "// CHECK#1\ntry{\n throw 10+3;\n}\ncatch(e){\n if (e!==13) $ERROR('#1: Exception ===13(operaton +). Actual: Exception ==='+ e);\n}\n\n// CHECK#2\nvar b=10;\nvar a=3;\ntry{\n throw a+b;\n}\ncatch(e){\n if (e!==13) $ERROR('#2: Exception ===13(operaton +). Actual: Exception ==='+ e);\n}\n\n// CHECK#3\ntry{\n throw 3.15-1.02;\n}\ncatch(e){\n if (e!==2.13) $ERROR('#3: Exception ===2.13(operaton -). Actual: Exception ==='+ e);\n}\n\n// CHECK#4\ntry{\n throw 2*2;\n}\ncatch(e){\n if (e!==4) $ERROR('#4: Exception ===4(operaton *). Actual: Exception ==='+ e);\n}\n\n// CHECK#5\ntry{\n throw 1+Infinity;\n}\ncatch(e){\n if (e!==+Infinity) $ERROR('#5: Exception ===+Infinity(operaton +). Actual: Exception ==='+ e);\n}\n\n// CHECK#6\ntry{\n throw 1-Infinity;\n}\ncatch(e){\n if (e!==-Infinity) $ERROR('#6: Exception ===-Infinity(operaton -). Actual: Exception ==='+ e);\n}\n\n// CHECK#7\ntry{\n throw 10/5;\n}\ncatch(e){\n if (e!==2) $ERROR('#7: Exception ===2(operaton /). Actual: Exception ==='+ e);\n}\n\n// CHECK#8\ntry{\n throw 8>>2;\n}\ncatch(e){\n if (e!==2) $ERROR('#8: Exception ===2(operaton >>). Actual: Exception ==='+ e);\n}\n\n// CHECK#9\ntry{\n throw 2<<2;\n}\ncatch(e){\n if (e!==8) $ERROR('#9: Exception ===8(operaton <<). Actual: Exception ==='+ e);\n}\n\n// CHECK#10\ntry{\n throw 123%100;\n}\ncatch(e){\n if (e!==23) $ERROR('#10: Exception ===23(operaton %). Actual: Exception ==='+ e);\n}\n",
"id": "S12.13_A3_T3"
},
{
"section": "12.13",
"description": "Evaluating array expression",
"test": "var mycars = new Array();\nmycars[0] = \"Saab\";\nmycars[1] = \"Volvo\";\nmycars[2] = \"BMW\";\n\nvar mycars2 = new Array();\nmycars2[0] = \"Mercedes\";\nmycars2[1] = \"Jeep\";\nmycars2[2] = \"Suzuki\";\n\n// CHECK#1\ntry{\n throw mycars.concat(mycars2);\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars[i]) $ERROR('#1.'+i+': Exception['+i+']===mycars['+i+'](operation .concat). Actual: Exception['+i+']==='+ e[i] );\n }\n for (var i=3;i<6;i++){\n if (e[i]!==mycars2[i-3]) $ERROR('#1.'+i+': Exception['+i+']===mycars2['+(i-3)+'](operation .concat). Actual: Exception['+i+']==='+ e[i] );\n }\n}\n\n// CHECK#2\ntry{\n throw new Array(\"Mercedes\",\"Jeep\",\"Suzuki\");\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars2[i]) $ERROR('#2.'+i+': Exception['+i+']===mycars2['+i+'](operation new). Actual: Exception['+i+']==='+ e[i] );\n }\n}\n\n// CHECK#3\ntry{\n throw mycars.concat(new Array(\"Mercedes\",\"Jeep\",\"Suzuki\"));\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars[i]) $ERROR('#3.'+i+': Exception['+i+']===mycars['+i+'](operation .concat(new)). Actual: Exception['+i+']==='+ e[i] );\n }\n for (var i=3;i<6;i++){\n if (e[i]!==mycars2[i-3]) $ERROR('#3.'+i+': Exception['+i+']===mycars2['+(i-3)+'](operation .concat(new)). Actual: Exception['+i+']==='+ e[i] );\n }\n}\n",
"id": "S12.13_A3_T4"
},
{
"section": "12.13",
"description": "Evaluating equation expression",
"test": "// CHECK#1\nvar a=true;\nvar b=false;\ntry{\n throw ((a&&(!b))?\"exception\":\" #1\");\n}\ncatch(e){\n if (e!==\"exception\") $ERROR('#1: Exception ===\"exception\"(operaton ? , ). Actual: Exception ==='+e );\n}\n",
"id": "S12.13_A3_T5"
},
{
"section": "12.13",
"description": "Evaluating functions",
"test": "// CHECK#1\nvar i=0;\nfunction adding1(){\n i++;\n return 1;\n}\ntry{\n throw (adding1());\n}\ncatch(e){\n if (e!==1) $ERROR('#1: Exception ===1. Actual: Exception ==='+ e);\n}\n\n// CHECK#2\nvar i=0;\nfunction adding2(){\n i++;\n return i;\n}\ntry{\n throw adding2();\n}\ncatch(e){}\nif (i!==1) $ERROR('#2: i===1. Actual: i==='+ i);\n\n// CHECK#3\nvar i=0;\nfunction adding3(){\n i++;\n}\ntry{\n throw adding3();\n}\ncatch(e){}\nif (i!==1) $ERROR('#3: i===1. Actual: i==='+i);\n\n// CHECK#4\nfunction adding4(i){\n i++;\n return i;\n}\ntry{\n throw (adding4(1));\n}\ncatch(e){\n if (e!==2) $ERROR('#4: Exception ===2. Actual: Exception ==='+ e);\n}\n",
"id": "S12.13_A3_T6"
}
]
}
}

View File

@ -0,0 +1,53 @@
{
"testCollection": {
"name": "12.14.1",
"numTests": 6,
"tests": [
{
"id": "12.14.1-1-s",
"path": "TestCases/chapter12/12.14/12.14.1/12.14.1-1-s.js",
"description": "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is eval",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"\\\n try {} catch (eval) { }\\\n \");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.14.1-2-s",
"path": "TestCases/chapter12/12.14/12.14.1/12.14.1-2-s.js",
"description": "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is arguments",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n eval(\"\\\n try {} catch (arguments) { }\\\n \");\n return false;\n } catch (e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.14.1-3-s",
"path": "TestCases/chapter12/12.14/12.14.1/12.14.1-3-s.js",
"description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL but throws SyntaxError if it is eval",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try{ eval(\" try { \\\n throw new Error(\\\"...\\\");\\\n return false;\\\n } catch (EVAL) {\\\n try\\\n {\\\n throw new Error(\\\"...\\\");\\\n }catch(eval)\\\n {\\\n return EVAL instanceof Error;\\\n }\\\n }\");\n return false;\n } catch(e) {\n return e instanceof SyntaxError;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.14.1-4-s",
"path": "TestCases/chapter12/12.14/12.14.1/12.14.1-4-s.js",
"description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n throw new Error(\"...\");\n return false;\n } catch (EVAL) {\n return EVAL instanceof Error;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "12.14.1-5-s",
"path": "TestCases/chapter12/12.14/12.14.1/12.14.1-5-s.js",
"description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is Arguments",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n throw new Error(\"...\");\n return false;\n } catch (Arguments) {\n return Arguments instanceof Error;\n }\n }).call(this));\n",
"strict_only": ""
},
{
"id": "12.14.1-6-s",
"path": "TestCases/chapter12/12.14/12.14.1/12.14.1-6-s.js",
"description": "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is ARGUMENTS",
"test": "assertTrue((function testcase() {\n \"use strict\";\n\n try {\n throw new Error(\"...\");\n return false;\n } catch (ARGUMENTS) {\n return ARGUMENTS instanceof Error;\n }\n }).call(this));\n",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,98 @@
{
"testCollection": {
"name": "12.14",
"numTests": 15,
"tests": [
{
"id": "12.14-1",
"path": "TestCases/chapter12/12.14/12.14-1.js",
"description": "catch doesn't change declaration scope - var initializer in catch with same name as catch parameter changes parameter",
"test": "assertTrue((function testcase() {\n foo = \"prior to throw\";\n try {\n throw new Error();\n }\n catch (foo) {\n var foo = \"initializer in catch\";\n }\n return foo === \"prior to throw\";\n \n }).call(this));\n"
},
{
"id": "12.14-10",
"path": "TestCases/chapter12/12.14/12.14-10.js",
"description": "catch introduces scope - name lookup finds function parameter",
"test": "assertTrue((function testcase() {\n function f(o) {\n\n function innerf(o, x) {\n try {\n throw o;\n }\n catch (e) {\n return x;\n }\n }\n\n return innerf(o, 42);\n }\n \n if (f({}) === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.14-11",
"path": "TestCases/chapter12/12.14/12.14-11.js",
"description": "catch introduces scope - name lookup finds inner variable",
"test": "assertTrue((function testcase() {\n function f(o) {\n\n function innerf(o) {\n var x = 42;\n\n try {\n throw o;\n }\n catch (e) {\n return x;\n }\n }\n\n return innerf(o);\n }\n \n if (f({}) === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.14-12",
"path": "TestCases/chapter12/12.14/12.14-12.js",
"description": "catch introduces scope - name lookup finds property",
"test": "assertTrue((function testcase() {\n function f(o) {\n\n function innerf(o) {\n try {\n throw o;\n }\n catch (e) {\n return e.x;\n }\n }\n\n return innerf(o);\n }\n \n if (f({x:42}) === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.14-13",
"path": "TestCases/chapter12/12.14/12.14-13.js",
"description": "catch introduces scope - updates are based on scope",
"test": "assertTrue((function testcase() {\n var res1 = false;\n var res2 = false;\n var res3 = false;\n\n var x_12_14_13 = 'local';\n try {\n function foo() {\n this.x_12_14_13 = 'instance';\n }\n\n try {\n throw foo;\n }\n catch (e) {\n res1 = (x_12_14_13 === 'local');\n e();\n res2 = (x_12_14_13 === 'local');\n }\n res3 = (x_12_14_13 === 'local');\n\n if (res1 === true &&\n res2 === true &&\n res3 === true) {\n return true;\n }\n } finally {\n delete this.x_12_14_13;\n }\n }).call(this));\n"
},
{
"id": "12.14-14",
"path": "TestCases/chapter12/12.14/12.14-14.js",
"description": "Exception object is a function, when an exception parameter is called as a function in catch block, global object is passed as the this value",
"test": "assertTrue((function testcase() {\n try {\n throw function () {\n this._12_14_14_foo = \"test\";\n };\n return false;\n } catch (e) {\n e();\n return fnGlobalObject()._12_14_14_foo === \"test\";\n }\n finally {\n delete fnGlobalObject()._12_14_14_foo;\n }\n }).call(this));\n"
},
{
"id": "12.14-15",
"path": "TestCases/chapter12/12.14/12.14-15.js",
"description": "Exception object is a function which is a property of an object, when an exception parameter is called as a function in catch block, global object is passed as the this value",
"test": "assertTrue((function testcase() {\n var obj = {};\n obj.test = function () {\n this._12_14_15_foo = \"test\";\n };\n try {\n throw obj.test;\n return false;\n } catch (e) {\n e();\n return fnGlobalObject()._12_14_15_foo === \"test\";\n }\n finally {\n delete fnGlobalObject()._12_14_15_foo;\n }\n }).call(this));\n"
},
{
"id": "12.14-16",
"path": "TestCases/chapter12/12.14/12.14-16.js",
"description": "Exception object is a function which update in catch block, when an exception parameter is called as a function in catch block, global object is passed as the this value",
"test": "assertTrue((function testcase() {\n try {\n throw function () {\n this._12_14_16_foo = \"test\";\n };\n return false;\n } catch (e) {\n var obj = {};\n obj.test = function () {\n this._12_14_16_foo = \"test1\";\n };\n e = obj.test;\n e();\n return fnGlobalObject()._12_14_16_foo === \"test1\";\n }\n finally {\n delete fnGlobalObject()._12_14_16_foo;\n }\n\n }).call(this));\n"
},
{
"id": "12.14-2",
"path": "TestCases/chapter12/12.14/12.14-2.js",
"description": "catch doesn't change declaration scope - var initializer in catch with same name as catch parameter changes parameter",
"test": "assertTrue((function testcase() {\n function capturedFoo() {return foo};\n foo = \"prior to throw\";\n try {\n throw new Error();\n }\n catch (foo) {\n var foo = \"initializer in catch\";\n return capturedFoo() !== \"initializer in catch\";\n }\n \n }).call(this));\n"
},
{
"id": "12.14-3",
"path": "TestCases/chapter12/12.14/12.14-3.js",
"description": "catch doesn't change declaration scope - var declaration are visible outside when name different from catch parameter",
"test": "assertTrue((function testcase() {\n try {\n throw new Error();\n }\n catch (e) {\n var foo = \"declaration in catch\";\n }\n \n return foo === \"declaration in catch\";\n }).call(this));\n"
},
{
"id": "12.14-4",
"path": "TestCases/chapter12/12.14/12.14-4.js",
"description": "catch introduces scope - block-local vars must shadow outer vars",
"test": "assertTrue((function testcase() {\n var o = { foo : 42};\n\n try {\n throw o;\n }\n catch (e) {\n var foo;\n\n if (foo === undefined) {\n return true;\n }\n }\n }).call(this));\n"
},
{
"id": "12.14-6",
"path": "TestCases/chapter12/12.14/12.14-6.js",
"description": "catch introduces scope - block-local function expression must shadow outer function expression",
"test": "assertTrue((function testcase() {\n var o = {foo : function () { return 42;}};\n\n try {\n throw o;\n }\n catch (e) {\n var foo = function () {};\n if (foo() === undefined) {\n return true;\n }\n }\n }).call(this));\n"
},
{
"id": "12.14-7",
"path": "TestCases/chapter12/12.14/12.14-7.js",
"description": "catch introduces scope - scope removed when exiting catch block",
"test": "assertTrue((function testcase() {\n var o = {foo: 1};\n var catchAccessed = false;\n \n try {\n throw o;\n }\n catch (expObj) {\n catchAccessed = (expObj.foo == 1);\n }\n\n try {\n expObj;\n }\n catch (e) {\n return catchAccessed && e instanceof ReferenceError\n }\n return false;\n }).call(this));\n"
},
{
"id": "12.14-8",
"path": "TestCases/chapter12/12.14/12.14-8.js",
"description": "catch introduces scope - scope removed when exiting catch block (properties)",
"test": "assertTrue((function testcase() {\n var o = {foo: 42};\n\n try {\n throw o;\n }\n catch (e) {\n var foo = 1;\n }\n\n if (o.foo === 42) {\n return true;\n }\n }).call(this));\n"
},
{
"id": "12.14-9",
"path": "TestCases/chapter12/12.14/12.14-9.js",
"description": "catch introduces scope - name lookup finds outer variable",
"test": "assertTrue((function testcase() {\n function f(o) {\n var x = 42;\n\n function innerf(o) {\n try {\n throw o;\n }\n catch (e) {\n return x;\n }\n }\n\n return innerf(o);\n }\n \n if (f({}) === 42) {\n return true;\n }\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,375 @@
{
"testCollection": {
"name": "12.14_The_try_Statement",
"numTests": 58,
"tests": [
{
"section": "12.14",
"description": "Executing TryStatement : try Block Catch. The statements doesn't cause actual exceptions",
"test": "// CHECK#1\ntry {\n var x=0;\n}\ncatch (e) {\n $ERROR('#1: If Result(1).type is not throw, return Result(1). Actual: 4 Return(Result(3))');\n}\n\n// CHECK#2\nvar c1=0;\ntry{\n var x1=1;\n}\nfinally\n{\n c1=1;\n}\nif(x1!==1){\n $ERROR('#2.1: \"try\" block must be evaluated. Actual: try Block has not been evaluated');\n}\nif (c1!==1){\n $ERROR('#2.2: \"finally\" block must be evaluated. Actual: finally Block has not been evaluated');\n}\n\n// CHECK#3\nvar c2=0;\ntry{\n var x2=1;\n}\ncatch(e){\n $ERROR('#3.1: If Result(1).type is not throw, return Result(1). Actual: 4 Return(Result(3))');\t\n}\nfinally{\n c2=1;\n}\nif(x2!==1){\n $ERROR('#3.2: \"try\" block must be evaluated. Actual: try Block has not been evaluated');\n}\nif (c2!==1){\n $ERROR('#3.3: \"finally\" block must be evaluated. Actual: finally Block has not been evaluated');\n}\n",
"id": "S12.14_A1"
},
{
"section": "12.14",
"description": "Throwing exception while executing iteration statement placed into try Block",
"test": "// CHECK#1\nvar i=0;\ntry{\nwhile(i<10){\n if(i===5) throw i;\n i++;\n}\n}\ncatch(e){\n if(e!==5)$ERROR('#1: Exception === 5. Actual: Exception ==='+ e );\n}\n",
"id": "S12.14_A10_T1"
},
{
"section": "12.14",
"description": "Try statement inside loop, where use continue loop",
"test": "// CHECK#1\nvar c1=0,fin=0;\nwhile(c1<2){\n try{\n c1+=1;\n continue;\n }\n catch(er1){}\n finally{\n fin=1;\n }\n fin=-1;\n};\nif(fin!==1){\n $ERROR('#1: \"finally\" block must be evaluated at \"try{continue} catch finally\" construction');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nwhile(c2<2){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n continue;\n }\n finally{\n fin2=1;\n }\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2: \"finally\" block must be evaluated at \"try catch{continue} finally\" construction');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\nwhile(c3<2){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n continue;\n }\n fin3=0;\n}\nif(fin3!==1){\n $ERROR('#3: \"finally\" block must be evaluated at \"try catch finally{continue}\" construction');\n}\n\n// CHECK#4\nvar c4=0,fin4=0;\nwhile(c4<2){\n try{\n c4+=1;\n continue;\n }\n finally{\n fin4=1;\n }\n fin4=-1;\n};\nif(fin4!==1){\n $ERROR('#4: \"finally\" block must be evaluated at \"try{continue} finally\" construction');\n}\n\n// CHECK#5\nvar c5=0;\nwhile(c5<2){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c5+=1;\n continue;\n }\n}\nif(c5!==2){\n $ERROR('#5: \"try catch{continue}\" must work correctly');\n}\n\n// CHECK#6\nvar c6=0,fin6=0;\nwhile(c6<2){\n try{\n c6+=1;\n throw \"ex1\"\n }\n finally{\n fin6=1;\n continue;\n }\n fin6=-1;\n}\nif(fin6!==1){\n $ERROR('#6.1: \"finally\" block must be evaluated');\n}\nif(c6!==2){\n $ERROR('#6.2: \"try finally{continue}\" must work correctly');\n}\n",
"id": "S12.14_A10_T2"
},
{
"section": "12.14",
"description": "Try statement inside loop, where use break",
"test": "// CHECK#1\nvar c1=0,fin=0;\nwhile(c1<2){\n try{\n c1+=1;\n break;\n }\n catch(er1){}\n finally{\n fin=1;\n }\n fin=-1;\n c1+=2;\n}\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==1){\n $ERROR('#1.2: \"try{break}catch finally\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nwhile(c2<2){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n fin2=1;\n }\n c2+=2;\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==1){\n $ERROR('#2.2: \"try catch{break} finally\" must work correctly');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\nwhile(c3<2){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n break;\n }\n c3+=2;\n fin3=0;\n}\nif(fin3!==1){\n $ERROR('#3.1: \"finally\" block must be evaluated');\n}\nif(c3!==1){\n $ERROR('#3.2: \"try catch finally{break}\" must work correctly');\n}\n\n// CHECK#4\nvar c4=0,fin4=0;\nwhile(c4<2){\n try{\n c4+=1;\n break;\n }\n finally{\n fin4=1;\n }\n fin4=-1;\n c4+=2;\n}\nif(fin4!==1){\n $ERROR('#4.1: \"finally\" block must be evaluated');\n}\nif(c4!==1){\n $ERROR('#4.2: \"try{break} finally\" must work correctly');\n}\n\n// CHECK#5\nvar c5=0;\nwhile(c5<2){\n try{\n throw \"ex1\";\n }\n catch(er1){\n break;\n }\n}\nif(c5!==0){\n $ERROR('#5: \"try catch{break}\" must work correctly');\n}\n\n// CHECK#6\nvar c6=0;\nwhile(c6<2){\n try{\n c6+=1;\n break;\n }\n catch(er1){}\n c6+=2;\n}\nif(c6!==1){\n $ERROR('#6: \"try{break} catch\" must work correctly');\n}\n\n// CHECK#7\nvar c7=0,fin7=0;\ntry{\n while(c7<2){\n try{\n c7+=1;\n throw \"ex1\";\n }\n finally{\n fin7=1;\n break;\n }\n fin7=-1;\n c7+=2;\n }\n}\ncatch(ex1){\n c7=10;\n}\nif(fin7!==1){\n $ERROR('#7.1: \"finally\" block must be evaluated');\n}\nif(c7!==1){\n $ERROR('#7.2: \"try finally{break}\" must work correctly');\n}\n",
"id": "S12.14_A10_T3"
},
{
"section": "12.14",
"description": "Try statement inside loop, where combinate using break and continue",
"test": "// CHECK#1\nvar c1=0,fin=0;\nwhile(c1<2){\n try{\n c1+=1;\n break;\n }\n catch(er1){}\n finally{\n fin=1;\n continue;\n }\n fin=-1;\n c1+=2;\n}\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==2){\n $ERROR('#1.2: \"try{break} catch finally{continue}\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nwhile(c2<2){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n fin2=1;\n continue;\n }\n c2+=2;\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==2){\n $ERROR('#2.2: \"try catch{break} finally{continue} must work correctly');\n}\n",
"id": "S12.14_A10_T4"
},
{
"section": "12.14",
"description": "Throw some exceptions from different place of loop body",
"test": "// CHECK#1\nvar c=0, i=0;\nvar fin=0;\nwhile(i<10){\n i+=1;\n try{\n if(c===0){\n throw \"ex1\";\n $ERROR('#1.1: throw \"ex1\" lead to throwing exception');\n }\n c+=2;\n if(c===1){\n throw \"ex2\";\n $ERROR('#1.2: throw \"ex2\" lead to throwing exception');\n }\n }\n catch(er1){\n c-=1;\n continue;\n $ERROR('#1.3: \"try catch{continue} finally\" must work correctly');\n }\n finally{\n fin+=1;\n }\n}\nif(fin!==10){\n $ERROR('#1.4: \"finally\" block must be evaluated');\n}\n",
"id": "S12.14_A10_T5"
},
{
"section": "12.14",
"description": "Loop inside try Block, where throw exception",
"test": "// CHECK#1\ntry{\n for(var i=0;i<10;i++){\n if(i===5) throw i;\n }\n}\ncatch(e){\n if(e!==5)$ERROR('#1: Exception === 5. Actual: Exception ==='+ e );\n}\n",
"id": "S12.14_A11_T1"
},
{
"section": "12.14",
"description": "Try statement inside loop, where use continue loop",
"test": "// CHECK#1\nvar fin=0;\nfor(var i=0;i<5;i++){\n try{\n i+=1;\n continue;\n }\n catch(er1){}\n finally{\n fin=1;\n }\n fin=-1;\n}\nif(fin!==1){\n $ERROR('#1: \"finally\" block must be evaluated at \"try{continue} catch finally\" construction');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nfor(var i=0;i<5;i++){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n continue;\n }\n finally{\n fin2=1;\n }\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==5){\n $ERROR('#2.1: \"try catch{continue} finally\" must work correctly');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\nfor(var i=0;i<5;i++){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n continue;\n }\n fin3=0;\n}\nif(fin3!==1){\n $ERROR('#3.1: \"finally\" block must be evaluated');\n}\nif(c3!==5){\n $ERROR('#3.2: \"try catch finally{continue}\" must work correctly');\n}\n\n// CHECK#4\nvar fin=0;\nfor(var i=0;i<5;i++){\n try{\n i+=1;\n continue;\n }\n finally{\n fin=1;\n }\n fin=-1;\n};\nif(fin!==1){\n $ERROR('#4: \"finally\" block must be evaluated at \"try{continue} finally\" construction');\n}\n\n// CHECK#5\nvar c5=0;\nfor(var c5=0;c5<10;){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c5+=1;\n continue;\n }\n c5+=12;\n};\nif(c5!==10){\n $ERROR('#5: \"try catch{continue} must work correctly');\n}\n\n// CHECK#6\nvar c6=0,fin6=0;\nfor(var c6=0;c6<10;){\n try{\n c6+=1;\n throw \"ex1\"\n }\n finally{\n fin6=1;\n continue;\n }\n fin6=-1;\n};\nif(fin6!==1){\n $ERROR('#6.1: \"finally\" block must be evaluated');\n}\nif(c6!==10){\n $ERROR('#6.2: \"try finally{continue}\" must work correctly');\n}\n",
"id": "S12.14_A11_T2"
},
{
"section": "12.14",
"description": "Try statement inside loop, where use break",
"test": "// CHECK#1\nvar c1=0,fin=0;\nfor(var i=0;i<5;i++){\n try{\n c1+=1;\n break;\n }\n catch(er1){}\n finally{\n fin=1;\n }\n fin=-1;\n c1+=2;\n};\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==1){\n $ERROR('#1.2: \"try{break}catch finally\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nfor(var i=0;i<5;i++){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n fin2=1;\n }\n c2+=2;\n fin2=-1;\n};\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==1){\n $ERROR('#2.2: \"try catch{break} finally\" must work correctly');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\nfor(var i=0;i<5;i++){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n break;\n }\n c3+=2;\n fin3=0;\n};\nif(fin3!==1){\n $ERROR('#3.1: \"finally\" block must be evaluated');\n}\nif(c3!==1){\n $ERROR('#3.2: \"try catch finally{break}\" must work correctly');\n}\n\n// CHECK#4\nvar c4=0,fin4=0;\nfor(var i=0;i<5;i++){\n try{\n c4+=1;\n break;\n }\n finally{\n fin4=1;\n }\n fin4=-1;\n c4+=2;\n};\nif(fin4!==1){\n $ERROR('#4.1: \"finally\" block must be evaluated');\n}\nif(c4!==1){\n $ERROR('#4.2: \"try{break} finally\" must work correctly');\n}\n\n// CHECK#5\nfor(var i=0;i<5;i++){\n try{\n throw \"ex1\";\n }\n catch(er1){\n break;\n }\n};\nif(i!==0){\n $ERROR('#5: \"try catch{break}\" must work correctly');\n}\n\n// CHECK#6\nvar c6=0;\nfor(var c6=0;c6<5;){\n try{\n c6+=1;\n break;\n }\n catch(er1){}\n c6+=2;\n};\nif(c6!==1){\n $ERROR('#6: \"try{break} catch\" must work correctly');\n}\n\n// CHECK#7\nvar c7=0,fin7=0;\ntry{\n for(var c7=0;c7<5;){\n try{\n c7+=1;\n throw \"ex1\";\n }\n finally{\n fin7=1;\n break;\n }\n fin7=-1;\n c7+=2;\n }\n}\ncatch(ex1){\n c7=10;\n}\nif(fin7!==1){\n $ERROR('#7.1: \"finally\" block must be evaluated');\n}\nif(c7!==1){\n $ERROR('#7.2: \"try finally{break}\" must work correctly');\n}\n",
"id": "S12.14_A11_T3"
},
{
"section": "12.14",
"description": "Try statement inside loop, where combinate using break and continue",
"test": "// CHECK#1\nvar c1=0,fin=0;\nfor(var i=0;i<5;i++){\n try{\n c1+=1;\n break;\n }\n catch(er1){}\n finally{\n fin=1;\n continue;\n }\n fin=-1;\n c1+=2;\n}\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==5){\n $ERROR('#1.2: \"try{break} catch finally{continue}\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nfor(var i=0;i<5;i++){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n fin2=1;\n continue;\n }\n c2+=2;\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==5){\n $ERROR('#2.2: \"try catch{break} finally{continue}\" must work correctly');\n}\n",
"id": "S12.14_A11_T4"
},
{
"section": "12.14",
"description": "Loop inside try Block, where throw exception",
"test": "var x;\nvar mycars = new Array();\nmycars[0] = \"Saab\";\nmycars[1] = \"Volvo\";\nmycars[2] = \"BMW\";\n\n// CHECK#1\ntry{\n for (x in mycars){\n if (mycars[x]===\"BMW\") throw \"ex\";\n }\n}\ncatch(e){\n if(e!==\"ex\")$ERROR('#1: Exception ===\"ex\". Actual: Exception ==='+ e );\n}\n\n\n",
"id": "S12.14_A12_T1"
},
{
"section": "12.14",
"description": "Try statement inside loop, where use continue loop",
"test": "var x;\nvar mycars = new Array();\nmycars[0] = \"Saab\";\nmycars[1] = \"Volvo\";\nmycars[2] = \"BMW\";\n\n// CHECK#1\nvar fin=0;\nvar i=0;\nfor (x in mycars){\n try{\n i+=1;\n continue;\n }\n catch(er1){}\n finally{\n fin=1;\n }\n fin=-1;\n}\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(i!==3){\n $ERROR('#1.2: \"try{continue} catch finally\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nfor (x in mycars){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n continue;\n }\n finally{\n fin2=1;\n }\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==3){\n $ERROR('#2.1: \"try catch{continue} finally\" must work correctly');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\nfor (x in mycars){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n continue;\n }\n fin3=0;\n}\nif(c3!==3){\n $ERROR('#3.1: \"finally\" block must be evaluated');\n}\nif(fin3!==1){\n $ERROR('#3.2: \"try catch finally{continue}\" must work correctly');\n}\n\n// CHECK#4\nvar fin=0;\nfor (x in mycars){\n try{\n continue;\n }\n finally{\n fin=1;\n }\n fin=-1;\n}\nif(fin!==1){\n $ERROR('#4: \"finally\" block must be evaluated at \"try{continue} finally\" construction');\n}\n\n// CHECK#5\nvar c5=0;\nfor (x in mycars){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c5+=1;\n continue;\n }\n c5+=12;\n}\nif(c5!==3){\n $ERROR('#5: \"try catch{continue}\" must work correctly');\n}\n\n// CHECK#6\nvar c6=0,fin6=0;\nfor (x in mycars){\n try{\n c6+=1;\n throw \"ex1\";\n }\n finally{\n fin6=1;\n continue;\n }\n fin6=-1;\n}\nif(fin6!==1){\n $ERROR('#6.1: \"finally\" block must be evaluated');\n}\nif(c6!==3){\n $ERROR('#6.2: \"try finally{continue}\" must work correctly');\n}\n",
"id": "S12.14_A12_T2"
},
{
"section": "12.14",
"description": "Try statement inside loop, where use break",
"test": "var x;\nvar mycars = new Array();\nmycars[0] = \"Saab\";\nmycars[1] = \"Volvo\";\nmycars[2] = \"BMW\";\n\n// CHECK#1\nvar c1=0,fin=0;\nfor (x in mycars){\n try{\n c1+=1;\n break;\n }\n catch(er1){\n c1+=1;\n }\n finally{\n fin=1;\n }\n fin=-1;\n c1+=2;\n};\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==1){\n $ERROR('#1.2: \"try{break}catch finally\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nfor (x in mycars){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n fin2=1;\n }\n c2+=2;\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==1){\n $ERROR('#2.2: \"try catch{break} finally\" must work correctly');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\nfor (x in mycars){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n break;\n }\n c3+=2;\n fin3=0;\n}\nif(fin3!==1){\n $ERROR('#3.1: \"finally\" block must be evaluated');\n}\nif(c3!==1){\n $ERROR('#3.2: \"try catch finally{break}\" must work correctly');\n}\n\n// CHECK#4\nvar c4=0,fin4=0;\nfor (x in mycars){\n try{\n c4+=1;\n break;\n }\n finally{\n fin4=1;\n }\n fin4=-1;\n c4+=2;\n}\nif(fin4!==1){\n $ERROR('#4.1: \"finally\" block must be evaluated');\n}\nif(c4!==1){\n $ERROR('#4.2: \"try{break} finally\" must work correctly');\n}\n\n// CHECK#5\nvar c5=0;\nfor (x in mycars){\n try{\n throw \"ex1\";\n c5++;\n }\n catch(er1){\n break;\n c5++;\n }\n c5++;\n}\nif(c5!==0){\n $ERROR('#5: \"try catch{break}\" must work correctly');\n}\n\n// CHECK#6\nvar c6=0;\nfor (x in mycars){\n try{\n c6+=1;\n break;\n }\n catch(er1){}\n c6+=2;\n}\nif(c6!==1){\n $ERROR('#6: \"try{break} catch\" must work correctly');\n}\n\n// CHECK#7\nvar c7=0,fin7=0;\ntry{\n for (x in mycars){\n try{\n c7+=1;\n throw \"ex1\";\n }\n finally{\n fin7=1;\n break;\n }\n fin7=-1;\n c7+=2;\n }\n}\ncatch(ex1){\n c7=10;\n}\nif(fin7!==1){\n $ERROR('#7.1: \"finally\" block must be evaluated');\n}\nif(c7!==1){\n $ERROR('#7.2: \"try finally{break}\" must work correctly');\n}\n",
"id": "S12.14_A12_T3"
},
{
"section": "12.14",
"description": "Try statement inside loop, where combinate using break and continue",
"test": "var x;\nvar mycars = new Array();\nmycars[0] = \"Saab\";\nmycars[1] = \"Volvo\";\nmycars[2] = \"BMW\";\n\n// CHECK#1\nvar c1=0,fin=0;\nfor (x in mycars){\n try{\n c1+=1;\n break;\n }\n catch(er1){}\n finally{\n fin=1;\n continue;\n }\n fin=-1;\n c1+=2;\n}\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==3){\n $ERROR('#1.2: \"try{break} catch finally{continue}\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\nfor (x in mycars){\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n \tfin2=1;\n \tcontinue;\n }\n c2+=2;\n fin2=-1;\n}\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==3){\n $ERROR('#2.2: \"try catch{break} finally{continue}\" must work correctly');\n}\n",
"id": "S12.14_A12_T4"
},
{
"section": "12.14",
"description": "Using try/catch syntax construction",
"test": "// CHECK#1\nfunction myFunction1(){\n try{\n return 1;\n }\n catch(err){\n \t$ERROR('#1.1: \"return 1\" inside function does not lead to throwing exception');\n return 0;\n }\n return 2;\n}\nvar x1=myFunction1();\nif(x1!==1){\n $ERROR('#1.2: x1===1. Actual: x1==='+x1);\n}\n\n// CHECK#2\nfunction myFunction2(){\n try{\n throw \"exc\";\n return 1;\n }catch(err){ \t\n return 2;\n }\n return 3;\n}\nvar x2=myFunction2();\nif (x2!==2){\n $ERROR('#2: x2===2. Actual: x2==='+x2);\n}\n\n// CHECK#3\nfunction myFunction3(){\n try{\n return someValue;\n }catch(err){ \t\n return 1;\n }\n return 2;\n}\nvar x3=myFunction3();\nif (x3!==1){\n $ERROR('#3: x3===1. Actual: x3==='+x3);\n}\n\n// CHECK#4\nfunction myFunction4(){\n try{\n throw \"ex1\";\n return 1;\n }catch(err){\n throw \"ex2\"\n return 0;\n }\n return 2;\n}\ntry{\n var x4=myFunction4();\n $ERROR('#4.1: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if(e===\"ex1\"){\n $ERROR('#4.2: Exception !==\"ex1\". Actual: catch previous exception');\n }\n if(e!==\"ex2\"){\n $ERROR('#4.3: Exception ===\"ex2\". Actual: Exception ==='+ e );\n }\n}\n",
"id": "S12.14_A13_T1"
},
{
"section": "12.14",
"description": "Using try/finally syntax construction",
"test": "// CHECK#1\nvar c1=0;\nfunction myFunction1(){\n try{\n return 1;\n }finally{\n c1=1;\n }\n return 2;\n}\nvar x1=myFunction1();\nif(x1!==1){\n $ERROR('#1.1: x1===1. Actual: x1==='+x1);\n}\nif (c1!==1){\n $ERROR('#1.2: \"finally\" block must be evaluated');\n}\n\n// CHECK#2\nvar c2=0;\nfunction myFunction2(){\n try{\n throw \"exc\";\n return 1;\n }finally{\n c2=1;\n }\n return 2;\n}\ntry{\n var x2=myFunction2();\n $ERROR('#2.1: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if (c2!==1){\n $ERROR('#2.2: \"finally\" block must be evaluated');\n }\n}\n\n// CHECK#3\nvar c3=0;\nfunction myFunction3(){\n try{\n return someValue;\n }finally{\n c3=1;\n }\n return 2;\n}\ntry{\n var x3=myFunction3();\n $ERROR('#3.1: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if (c3!==1){\n $ERROR('#3.2: \"finally\" block must be evaluated');\n }\n}\n\n// CHECK#4\nvar c4=0;\nfunction myFunction4(){\n try{\n return 1;\n }finally{\n c4=1;\n throw \"exc\";\n return 0;\n }\n return 2;\n}\ntry{\n var x4=myFunction4();\n $ERROR('#4.2: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if (c4!==1){\n $ERROR('#4.3: \"finally\" block must be evaluated');\n }\n}\n\n// CHECK#5\nvar c5=0;\nfunction myFunction5(){\n try{\n return 1;\n }finally{\n c5=1;\n return someValue;\n return 0;\n }\n return 2;\n}\ntry{\n var x5=myFunction5();\n $ERROR('#5.2: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if (c5!==1){\n $ERROR('#5.3: \"finally\" block must be evaluated');\n }\n}\n\n// CHECK#6\nvar c6=0;\nfunction myFunction6(){\n try{\n throw \"ex1\";\n return 1;\n }finally{\n c6=1;\n throw \"ex2\";\n return 2;\n }\n return 3;\n}\ntry{\n var x6=myFunction6();\n $ERROR('#6.1: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if(e===\"ex1\"){\n $ERROR('#6.2: Exception !==\"ex1\". Actual: catch previous exception');\n }\n if(e!==\"ex2\"){\n $ERROR('#6.3: Exception !==\"ex1\". Actual: '+e);\n }\n if (c6!==1){\n $ERROR('#6.4: \"finally\" block must be evaluated');\n }\n}\n\n// CHECK#7\nvar c7=0;\nfunction myFunction7(){\n try{\n return 1;\n }finally{\n c7=1;\n return 2;\n }\n return 3;\n}\nvar x7=myFunction7();\nif(x7!==2){\n $ERROR('#7.1: \"catch\" block must be evaluated');\n}\nif (c7!==1){\n $ERROR('#7.2: \"finally\" block must be evaluated');\n}\n\n// CHECK#8\nvar c8=0;\nfunction myFunction8(){\n try{\n throw \"ex1\";\n }finally{\n c8=1;\n return 2;\n }\n return 3;\n}\ntry{\n var x8=myFunction8();\n}\ncatch(ex1){\n c8=10;\n}\nif (c8!==1){\n $ERROR('#8: \"finally\" block must be evaluated');\n}\n",
"id": "S12.14_A13_T2"
},
{
"section": "12.14",
"description": "Using try/catch/finally syntax construction",
"test": "// CHECK#1\nvar c1=0;\nfunction myFunction1(){\n try{\n return 1;\n }catch(err){\n $ERROR('#1.1: \"return 1\" inside function does not lead to throwing exception');\n return 0;\n }finally{\n c1=1;\n }\n return 2;\n}\nvar x1=myFunction1();\nif(x1!==1){\n $ERROR('#1.3: x1===1. Actual: x1==='+x1);\n}\nif (c1!==1){\n $ERROR('#1.4: \"finally\" block must be evaluated');\n}\n\n// CHECK#2\nvar c2=0;\nfunction myFunction2(){\n try{\n throw \"exc\";\n return 1;\n }catch(err){ \t\n return 0;\n }finally{\n c2=1;\n }\n return 2;\n}\nvar x2=myFunction2();\nif (c2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif (x2!==0){\n $ERROR('#2.2: x2===0. Actual: x2==='+x2);\n}\n\n// CHECK#3\nvar c3=0;\nfunction myFunction3(){\n try{\n return someValue;\n }catch(err){ \t\n return 1;\n }finally{\n c3=1;\n }\n return 2;\n}\nvar x3=myFunction3();\nif (c3!==1){\n $ERROR('#3.1: \"finally\" block must be evaluated');\n}\nif (x3!==1){\n $ERROR('#3.2: x3===1. Actual: x3==='+x3);\n}\n\n// CHECK#4\nvar c4=0;\nfunction myFunction4(){\n try{\n throw \"ex1\";\n return 1;\n }catch(err){\n throw \"ex2\"\n return 0;\n }finally{\n c4=1;\n }\n return 2;\n}\ntry{\n var x4=myFunction4();\n $ERROR('#4.1: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if(e===\"ex1\"){\n $ERROR('#4.2: Exception !== \"ex1\". Actual: catch previous exception');\n }\n if(e!==\"ex2\"){\n $ERROR('#4.3: Exception === \"ex2\". Actual: Exception ==='+ e );\n }\n if (c4!==1){\n $ERROR('#4.4: \"finally\" block must be evaluated');\n }\t\n}\n\n// CHECK#5\nvar c5=0;\nfunction myFunction5(){\n try{\n throw \"ex1\";\n return 1;\n }catch(err){\n return 0;\n }finally{\n c5=1;\n throw \"ex2\";\n }\n return 2;\n}\ntry{\n var x5=myFunction5();\n $ERROR('#5.1: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if(e===\"ex1\"){\n $ERROR('#5.2: Exception !== \"ex1\". Actual: catch previous exception');\n }\n if(e!==\"ex2\"){\n $ERROR('#5.3: Exception === \"ex2\". Actual: Exception ==='+ e );\n }\n if (c5!==1){\n $ERROR('#5.4: \"finally\" block must be evaluated');\n } \t\n}\n\n// CHECK#6\nvar c6=0;\nfunction myFunction6(){\n try{\n throw \"ex1\";\n return 1;\n }catch(err){\n throw \"ex2\";\n return 0;\n }finally{\n c6=1;\n throw \"ex3\";\n }\n return 2;\n}\ntry{\n var x6=myFunction6();\n $ERROR('#6.1: Throwing exception inside function lead to throwing exception outside this function');\n}\ncatch(e){\n if(e===\"ex1\"){\n $ERROR('#6.2: Exception !== \"ex1\". Actual: catch previous exception');\n }\n if(e===\"ex2\"){\n $ERROR('#6.3: Exception !== \"ex2\". Actual: catch previous exception');\n }\n if(e!==\"ex3\"){\n $ERROR('#6.4: Exception === \"ex3\". Actual: Exception ==='+ e );\n }\t\n if(c6!==1) $ERROR('#6.5: \"finally\" block must be evaluated');\n}\n\n// CHECK#7\nvar c7=0;\nfunction myFunction7(){\n try{\n throw \"ex1\";\n return 1;\n }catch(err){\n throw \"ex2\";\n return 0;\n }finally{\n c7=1;\n return 2;\n }\n return 3;\n}\ntry{\n var x7=myFunction7();\n if(x7!==2) $ERROR('#7.1: x7===2. Actual: x7==='+x7);\n}\ncatch(e){}\nif(c7!==1) $ERROR('#7.2: \"finally\" block must be evaluated');\n",
"id": "S12.14_A13_T3"
},
{
"section": "12.14",
"description": "Using try/catch/finally in With and With in try/catch/finally",
"strict_mode_negative": "SyntaxError",
"test": "var myObj = {p1: 'a',\n p2: 'b',\n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';}\n}\n\n// CHECK#1\ntry{\n with(myObj){\n throw \"ex\";\n }\n}\ncatch(e){\n if (e!==\"ex\") $ERROR('#1: Exception ===\"ex\". Actual: Exception ==='+ e );\n}\n\n// CHECK#2\nwith(myObj){\n try{\n throw p1;\n }\n catch(e){\n if (e!==\"a\") $ERROR('#2.1: Exception ===\"a\". Actual: Exception ==='+ e );\n p1='pass';\n }\n}\nif(myObj.p1!=='pass') $ERROR('#2.2: \"throw p1\" lead to throwing exception');\n\n// CHECK#3\nwith(myObj){\n try{\n p1='fail';\n throw p2;\n }\n catch(e){\n if (e!==\"b\") $ERROR('#3.1: Exception ===\"b\". Actual: Exception ==='+ e );\n p1='pass';\n }\n finally{\n p2='pass';\n }\n}\nif(myObj.p1!=='pass') $ERROR('#3.2: \"throw p2\" lead to throwing exception');\nif(myObj.p2!=='pass') $ERROR('#3.3: \"finally\" block must be evaluated');\n\n// CHECK#4\nmyObj.p1='fail';\ntry{\n with(myObj){\n try{\n throw p3;\n }\n finally{\n p1='pass';\n }\n }\n}\ncatch(e){}\nif(myObj.p1!=='pass') $ERROR('#4: \"finally\" block must be evaluated');\n",
"id": "S12.14_A14",
"strict_only": ""
},
{
"section": "12.14",
"description": "Insert try/catch/finally to switch statement",
"test": "// CHECK#1\nfunction SwitchTest1(value){\n var result = 0;\n try{ \n switch(value) {\n case 1:\n result += 4;\n throw result;\n break;\n default:\n result += 32;\n break;\n case 4:\n result += 64;\n throw \"ex\";\n }\n return result;\n }\n catch(e){\t\n if ((value===1)&&(e!==4)) $ERROR('#1.1: Exception ===4. Actual: Exception ==='+ e );\n if ((value===4)&&(e!==\"ex\")) $ERROR('#1.2: Exception ===\"ex\". Actual: Exception ==='+ e );\n }\n finally{\n return result;\n }\n}\nif (SwitchTest1(1)!==4) $ERROR('#1.3: SwitchTest1(1)===4. Actual: SwitchTest1(1)==='+ SwitchTest1(1) );\nif (SwitchTest1(4)!==64) $ERROR('#1.4: SwitchTest1(4)===64. Actual: SwitchTest1(4)==='+ SwitchTest1(4) );\n\n// CHECK#2\nvar c2=0;\nfunction SwitchTest2(value){\n var result = 0;\n switch(value) {\n case 0:\n try{ \n result += 2;\n break;\n }\n finally{\n c2=1;\n }\n case 1:\n result += 4;\n break;\n default:\n result += 32;\n break;\n }\n return result;\n}\nif (SwitchTest2(1)!==4) $ERROR('#2.1: SwitchTest1(1)===4. Actual: SwitchTest1(1)==='+ SwitchTest1(1) );\nif (c2===1) $ERROR('#2.2: Evaluate finally block');\nif (SwitchTest2(0)!==2) $ERROR('#2.3: SwitchTest1(0)===2. Actual: SwitchTest1(0)==='+ SwitchTest1(0) );\nif (c2!==1) $ERROR('#2.4: \"finally\" block must be evaluated');\n\n// CHECK#3\nfunction SwitchTest3(value){\n var result = 0;\n switch(value) {\n case 0:\n try{ \n result += 2;\n throw \"ex\";\n }\n finally{\n break;\n }\n default:\n result += 32;\n break;\n }\n return result;\n}\ntry{\n var x3=SwitchTest3(0);\n if (x3!==2) $ERROR('#3.1: x3===2. Actual: x3==='+x3);\n}\ncatch(e){\n $ERROR('#3.2: Catching exception inside function does not lead to throwing exception outside this function');\n}\n",
"id": "S12.14_A15"
},
{
"section": "12.14",
"description": "Checking if pure \"try\" syntax construction passes",
"negative": "",
"test": "// CHECK#1\ntry\n",
"id": "S12.14_A16_T1"
},
{
"section": "12.14",
"description": "Catch: \"catch (Identifier ) Block\"",
"negative": "",
"test": "// CHECK#1\ntry{}\ncatch(){}\nfinally{}\n\n\n",
"id": "S12.14_A16_T10"
},
{
"section": "12.14",
"description": "Catch and Finally are placed into the Block of \"try\" (whitle expected outside)",
"negative": "",
"test": "// CHECK#1\ntry{\n {\n }\n catch(e){}\n finally{}\n}\n\n",
"id": "S12.14_A16_T11"
},
{
"section": "12.14",
"description": "Embedded \"try\" statements followed by two \"catch\" statements",
"negative": "",
"test": "// CHECK#1\ntry\n{\n try\n {\n }\n}\ncatch(e1){}\ncatch(e2){}\n\n\n",
"id": "S12.14_A16_T12"
},
{
"section": "12.14",
"description": "Catch: \"catch (Identifier ) Block\". Checking if execution of \"22\" passes at the place of Identifier of \"catch\"",
"negative": "",
"test": "// CHECK#1\ntry\n{\n}\ncatch(\"22\")\n{\n}\n\n\n\n",
"id": "S12.14_A16_T13"
},
{
"section": "12.14",
"description": "Checking if passing argument to \"try\" statement fails",
"negative": "",
"test": "// CHECK#1\ntry(e1){\t\n}\ncatch(e){}\n\n\n\n",
"id": "S12.14_A16_T14"
},
{
"section": "12.14",
"description": "Finally: \"finally Block\". Checking if passing argument to \"try\" statement fails",
"negative": "",
"test": "// CHECK#1\ntry{\t\n}\nfinally(e){}\n\n\n\n\n",
"id": "S12.14_A16_T15"
},
{
"section": "12.14",
"description": "Checking if execution of \"catch\" with no \"try\" fails",
"negative": "",
"test": "// CHECK#1\ncatch\n",
"id": "S12.14_A16_T2"
},
{
"section": "12.14",
"description": "Checking if execution of \"finally\" with no \"try\" fails",
"negative": "",
"test": "// CHECK#1\nfinally\n",
"id": "S12.14_A16_T3"
},
{
"section": "12.14",
"description": "Catch: \"catch (Identifier ) Block\". Checking if execution of \"catch\" that takes no arguments fails",
"negative": "",
"test": "// CHECK#1\ntry{}\ncatch{}\n",
"id": "S12.14_A16_T4"
},
{
"section": "12.14",
"description": "Catch: \"catch (Identifier ) Block\". Checking if execution of \"catch\" with no Block fails",
"negative": "",
"test": "// CHECK#1\ntry{}\ncatch()\n",
"id": "S12.14_A16_T5"
},
{
"section": "12.14, 12.1",
"description": "Block: \"{ StatementList }\". Checking if execution of \"try{ catch{}{}\" fails",
"negative": "",
"test": "// CHECK#1\ntry{\ncatch(){}\n",
"id": "S12.14_A16_T6"
},
{
"section": "12.14, 12.1",
"description": "Block: \"{ StatementList }\". Checking if execution of \"try{} catch(){\" fails",
"negative": "",
"test": "// CHECK#1\ntry{}\ncatch(){\n\n",
"id": "S12.14_A16_T7"
},
{
"section": "12.14, 12.1",
"description": "Block: \"{ StatementList }\". Catch: \"catch (Identifier ) Block\". Checking if execution of \"try{} catch(){finally{}\" fails",
"negative": "",
"test": "// CHECK#1\ntry{}\ncatch(){\nfinally{}\n\n\n",
"id": "S12.14_A16_T8"
},
{
"section": "12.14",
"description": "Checking if execution of \"catch(){} finally{}\" fails",
"negative": "",
"test": "// CHECK#1\ncatch(){}\nfinally{}\n\n\n",
"id": "S12.14_A16_T9"
},
{
"section": "12.14",
"description": "Creating exceptions within constructor",
"test": "var i=1;\nfunction Integer( value, exception ) {\n try{\n this.value = checkValue( value );\n if(exception) $ERROR('#'+i+'.1: Must be exception');\n }\n catch(e){\n this.value = e.toString();\n if(!exception) $ERROR('#'+i+'.2: Don`t must be exception');\n }\n i++;\n}\n\nfunction checkValue(value){\n if(Math.floor(value)!=value||isNaN(value)){\n throw (INVALID_INTEGER_VALUE +\": \" + value);\n }\n else{\n return value;\n }\n}\n\n// CHECK#1\nnew Integer(13, false);\n// CHECK#2\nnew Integer(NaN, true);\n// CHECK#3\nnew Integer(0, false);\n// CHECK#4\nnew Integer(Infinity, false);\n// CHECK#5\nnew Integer(-1.23, true);\n// CHECK#6\nnew Integer(Math.LN2, true);\n",
"id": "S12.14_A17"
},
{
"section": "12.14, 12.13",
"description": "Catching undefined",
"test": "// CHECK#1\ntry{\n throw undefined;\n}\ncatch(e){\n if (e!==undefined) $ERROR('#1: Exception === undefined. Actual: '+e);\n}\n",
"id": "S12.14_A18_T1"
},
{
"section": "12.14, 12.13",
"description": "Catching null",
"test": "// CHECK#1\ntry{\n throw null;\n}\ncatch(e){\n if (e!==null) $ERROR('#1: Exception ===null. Actual: '+e);\n}\n",
"id": "S12.14_A18_T2"
},
{
"section": "12.14, 12.13",
"description": "Catching boolean",
"test": "// CHECK#1\ntry{\n throw true;\n}\ncatch(e){\n if (e!==true) $ERROR('#1: Exception ===true. Actual: Exception ==='+ e );\n}\n\n// CHECK#2\ntry{\n throw false;\n}\ncatch(e){\n if (e!==false) $ERROR('#2: Exception ===false. Actual: Exception ==='+ e );\n}\n\n// CHECK#3\nvar b=false;\ntry{\n throw b;\n}\ncatch(e){\n if (e!==false) $ERROR('#3: Exception ===false. Actual: Exception ==='+ e );\n}\n\n// CHECK#4\nvar b=true;\ntry{\n throw b;\n}\ncatch(e){\n if (e!==true) $ERROR('#4: Exception ===true. Actual: Exception ==='+ e );\n}\n\n// CHECK#5\nvar b=true;\ntry{\n throw b&&false;\n}\ncatch(e){\n if (e!==false) $ERROR('#5: Exception ===false. Actual: Exception ==='+ e );\n}\n\n// CHECK#5\nvar b=true;\ntry{\n throw b||false;\n}\ncatch(e){\n if (e!==true) $ERROR('#6: Exception ===true. Actual: Exception ==='+ e );\n}\n",
"id": "S12.14_A18_T3"
},
{
"section": "12.14, 12.13",
"description": "Catching string",
"test": "// CHECK#1\ntry{\n throw \"exception #1\";\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#1: Exception ===\"exception #1\". Actual: Exception ==='+ e );\n}\n\n// CHECK#2\ntry{\n throw \"exception\"+\" #1\";\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#2: Exception ===\"exception #1\". Actual: Exception ==='+ e );\n}\n\n// CHECK#3\nvar b=\"exception #1\";\ntry{\n throw b;\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#3: Exception ===\"exception #1\". Actual: Exception ==='+ e );\n}\n\n// CHECK#4\nvar a=\"exception\";\nvar b=\" #1\";\ntry{\n throw a+b;\n}\ncatch(e){\n if (e!==\"exception #1\") $ERROR('#4: Exception ===\"exception #1\". Actual: Exception ==='+ e );\n}\n",
"id": "S12.14_A18_T4"
},
{
"section": "12.14, 12.13",
"description": "Catching Number",
"test": "// CHECK#1\ntry{\n throw 13;\n}\ncatch(e){\n if (e!==13) $ERROR('#1: Exception ===13. Actual: Exception ==='+ e );\n}\n\n// CHECK#2\ntry{\n throw 10+3;\n}\ncatch(e){\n if (e!==13) $ERROR('#2: Exception ===13. Actual: Exception ==='+ e );\n}\n\n// CHECK#3\nvar b=13;\ntry{\n throw b;\n}\ncatch(e){\n if (e!==13) $ERROR('#3: Exception ===13. Actual: Exception ==='+ e );\n}\n\n// CHECK#4\nvar a=3;\nvar b=10;\ntry{\n throw a+b;\n}\ncatch(e){\n if (e!==13) $ERROR('#4: Exception ===13. Actual: Exception ==='+ e );\n}\n\n// CHECK#5\ntry{\n throw 2.13;\n}\ncatch(e){\n if (e!==2.13) $ERROR('#5: Exception ===2.13. Actual: Exception ==='+ e );\n}\n\n// CHECK#6\nvar ex=2/3;\ntry{\n throw 2/3;\n}\ncatch(e){\n if (e!==ex) $ERROR('#6: Exception ===2/3. Actual: Exception ==='+ e );\n}\n\n// CHECK#7\ntry{\n throw NaN;\n}\ncatch(e){\n if (!isNaN(e)) $ERROR('#7: Exception is NaN');\n}\n\n// CHECK#8\ntry{\n throw +Infinity;\n}\ncatch(e){\n if (e!==+Infinity) $ERROR('#8: Exception ===+Infinity. Actual: Exception ==='+ e );\n}\n\n// CHECK#9\ntry{\n throw -Infinity;\n}\ncatch(e){\n if (e!==-Infinity) $ERROR('#9: Exception ===-Infinity. Actual: Exception ==='+ e );\n}\n\n// CHECK#10\ntry{\n throw +0;\n}\ncatch(e){\n if (e!==+0) $ERROR('#10: Exception ===+0. Actual: Exception ==='+ e );\n}\n\n// CHECK#11\ntry{\n throw -0;\n}\ncatch(e){\n if (e!==-0) $ERROR('#11: Exception ===-0. Actual: Exception ==='+ e );\n}\n",
"id": "S12.14_A18_T5"
},
{
"section": "12.14, 12.13",
"description": "Catching Object",
"test": "var myObj = {p1: 'a', \n p2: 'b', \n p3: 'c',\n value: 'myObj_value',\n valueOf : function(){return 'obj_valueOf';},\n parseInt : function(){return 'obj_parseInt';},\n NaN : 'obj_NaN',\n Infinity : 'obj_Infinity',\n eval : function(){return 'obj_eval';},\n parseFloat : function(){return 'obj_parseFloat';},\n isNaN : function(){return 'obj_isNaN';},\n isFinite : function(){return 'obj_isFinite';},\n i:7,\n}\n\ntry{\n throw myObj;\n}\ncatch(e){\t\n// CHECK#1\n if (e.p1!==\"a\") $ERROR('#1: e.p1===\"a\". Actual: e.p1==='+ e.p1 );\n// CHECK#2\n if (e.value!=='myObj_value') $ERROR('#2: e.value===\\'myObj_value\\'. Actual: e.value==='+ e.value );\n// CHECK#3\n if (e.eval()!=='obj_eval') $ERROR('#3: e.eval()===\\'obj_eval\\'. Actual: e.eval()==='+ e.eval() );\n}\n\n// CHECK#4\nmyObj.i=6;\ntry{\n throw myObj;\n}\ncatch(e){}\nif (myObj.i!==6) $ERROR('#4: Handling of catch must be correct');\n\n// CHECK#5\nmyObj.i=6;\ntry{\n throw myObj;\n}\ncatch(e){\n e.i=10;\n}\nif (myObj.i!==10) $ERROR('#5: Handling of catch must be correct');\n",
"id": "S12.14_A18_T6"
},
{
"section": "12.14, 12.13",
"description": "Catching Array",
"test": "var mycars = new Array();\nmycars[0] = \"Saab\";\nmycars[1] = \"Volvo\";\nmycars[2] = \"BMW\";\n\nvar mycars2 = new Array();\nmycars2[0] = \"Mercedes\";\nmycars2[1] = \"Jeep\";\nmycars2[2] = \"Suzuki\";\n\n// CHECK#1\ntry{\n throw mycars;\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars[i]) $ERROR('#1.'+i+': Exception['+i+']===mycars['+i+']. Actual: Exception['+i+']==='+ e[i] );\n }\n}\n\n// CHECK#2\ntry{\n throw mycars.concat(mycars2);\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars[i]) $ERROR('#2.'+i+': Exception['+i+']===mycars['+i+']. Actual: Exception['+i+']==='+ e[i] );\n }\n for (var i=3;i<6;i++){\n if (e[i]!==mycars2[i-3]) $ERROR('#2.'+i+': Exception['+i+']===mycars2['+i+']. Actual: Exception['+i+']==='+ e[i] );\n }\n}\n\n// CHECK#3\ntry{\n throw new Array(\"Mercedes\",\"Jeep\",\"Suzuki\");\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars2[i]) $ERROR('#3.'+i+': Exception['+i+']===mycars2['+i+']. Actual: Exception['+i+']==='+ e[i]);\n }\n}\n\n// CHECK#4\ntry{\n throw mycars.concat(new Array(\"Mercedes\",\"Jeep\",\"Suzuki\"));\n}\ncatch(e){\n for (var i=0;i<3;i++){\n if (e[i]!==mycars[i]) $ERROR('#4.'+i+': Exception['+i+']===mycars['+i+']. Actual: Exception['+i+']==='+ e[i] );\n }\n for (var i=3;i<6;i++){\n if (e[i]!==mycars2[i-3]) $ERROR('#4.'+i+': Exception['+i+']===mycars2['+(i-3)+']. Actual: Exception['+i+']==='+ e[i]);\n }\n}\n",
"id": "S12.14_A18_T7"
},
{
"section": "12.14, 15.11, 16",
"description": "Testing try/catch syntax construction",
"test": "// CHECK#1\ntry{\n throw (Error(\"hello\"));\n}\ncatch(e){\n if (e.toString()!==\"Error: hello\") $ERROR('#1: Exception.toString()===\"Error: hello\". Actual: Exception is '+e);\n}\n\n// CHECK#2\ntry{\n throw (new Error(\"hello\"));\n}\ncatch(e){\n if (e.toString()!==\"Error: hello\") $ERROR('#2: Exception.toString()===\"Error: hello\". Actual: Exception is '+e);\n}\n\n// CHECK#3\nvar c3=0;\ntry{\n throw EvalError(1);\n}\ncatch(e){\n if (e.toString()!==\"EvalError: 1\") $ERROR('#3: Exception.toString()===\"EvalError: 1\". Actual: Exception is '+e);\n}\n\n// CHECK#4\ntry{\n throw RangeError(1);\n}\ncatch(e){\n if (e.toString()!==\"RangeError: 1\") $ERROR('#4: Exception.toString()===\"RangeError: 1\". Actual: Exception is '+e);\n}\n\n// CHECK#5\ntry{\n throw ReferenceError(1);\n}\ncatch(e){\n if (e.toString()!==\"ReferenceError: 1\") $ERROR('#5: Exception.toString()===\"ReferenceError: 1\". Actual: Exception is '+e);\n}\n\n// CHECK#6\nvar c6=0;\ntry{\n throw TypeError(1);\n}\ncatch(e){\n if (e.toString()!==\"TypeError: 1\") $ERROR('#6: Exception.toString()===\"TypeError: 1\". Actual: Exception is '+e);\n}\n\n// CHECK#7\ntry{\n throw URIError(\"message\", \"fileName\", \"1\"); \n}\ncatch(e){\n if (e.toString()!==\"URIError: message\") $ERROR('#7: Exception.toString()===\"URIError: message\". Actual: Exception is '+e);\n}\n",
"id": "S12.14_A19_T1"
},
{
"section": "12.14",
"description": "Testing try/catch/finally syntax construction",
"test": "var fin=0;\n// CHECK#1\ntry{\n throw (Error(\"hello\"));\n}\ncatch(e){\n if (e.toString()!==\"Error: hello\") $ERROR('#1.1: Exception.toString()===\"Error: hello\". Actual: Exception is '+e);\n}\nfinally{\n fin=1;\n}\nif (fin!==1) $ERROR('#1.2: \"finally\" block must be evaluated'); \n\n// CHECK#2\nfin=0;\ntry{\n throw (new Error(\"hello\"));\n}\ncatch(e){\n if (e.toString()!==\"Error: hello\") $ERROR('#2.1: Exception.toString()===\"Error: hello\". Actual: Exception is '+e);\n}\nfinally{\n fin=1;\n}\nif (fin!==1) $ERROR('#2.2: \"finally\" block must be evaluated'); \n\n// CHECK#3\nfin=0;\nvar c3=0;\ntry{\n throw EvalError(1);\n}\ncatch(e){\n if (e.toString()!==\"EvalError: 1\") $ERROR('#3.1: Exception.toString()===\"EvalError: 1\". Actual: Exception is '+e);\n}\nfinally{\n fin=1;\n}\nif (fin!==1) $ERROR('#3.2: \"finally\" block must be evaluated'); \n\n// CHECK#4\nfin=0;\ntry{\n throw RangeError(1);\n}\ncatch(e){\n if (e.toString()!==\"RangeError: 1\") $ERROR('#4.1: Exception.toString()===\"RangeError: 1\". Actual: Exception is '+e);\n}\nfinally{\n fin=1;\n}\nif (fin!==1) $ERROR('#4.2: \"finally\" block must be evaluated'); \n\n// CHECK#5\nfin=0;\ntry{\n throw ReferenceError(1);\n}\ncatch(e){\n if (e.toString()!==\"ReferenceError: 1\") $ERROR('#5.1: Exception.toString()===\"ReferenceError: 1\". Actual: Exception is '+e);\n}\nfinally{\n fin=1;\n}\nif (fin!==1) $ERROR('#5.2: \"finally\" block must be evaluated'); \n\n// CHECK#6\nfin=0;\ntry{\n throw TypeError(1);\n}\ncatch(e){\n if (e.toString()!==\"TypeError: 1\") $ERROR('#6.1: Exception.toString()===\"TypeError: 1\". Actual: Exception is '+e);\n}\nfinally{\n fin=1;\n}\nif (fin!==1) $ERROR('#6.2: \"finally\" block must be evaluated'); \n\n// CHECK#7\nfin=0;\ntry{\n throw URIError(\"message\", \"fileName\", \"1\"); \n}\ncatch(e){\n if (e.toString()!==\"URIError: message\") $ERROR('#7.1: Exception.toString()===\"URIError: message\". Actual: Exception is '+e);\n}\nfinally{\n fin=1;\n}\nif (fin!==1) $ERROR('#7.2: \"finally\" block must be evaluated'); \n",
"id": "S12.14_A19_T2"
},
{
"section": "12.14",
"description": "Checking if execution of \"catch\" catches an exception thrown with \"throw\"",
"test": "// CHECK#1\ntry {\n throw \"catchme\";\t\n $ERROR('#1: throw \"catchme\" lead to throwing exception');\n}\ncatch(e){}\n\n// CHECK#2\nvar c2=0;\ntry{\n try{\n throw \"exc\";\n $ERROR('#2.1: throw \"exc\" lead to throwing exception');\n }finally{\n c2=1;\n }\n}\ncatch(e){\n if (c2!==1){\n $ERROR('#2.2: \"finally\" block must be evaluated');\n }\n}\n \n// CHECK#3\nvar c3=0;\ntry{\n throw \"exc\";\n $ERROR('#3.1: throw \"exc\" lead to throwing exception');\n}\ncatch(err){ \t\n var x3=1;\n}\nfinally{\n c3=1;\n}\nif (x3!==1){\n $ERROR('#3.2: \"catch\" block must be evaluated');\n} \nif (c3!==1){\n $ERROR('#3.3: \"finally\" block must be evaluated');\n}\n",
"id": "S12.14_A2"
},
{
"section": "12.14",
"description": "Checking if execution of \"catch\" catches system exceptions",
"test": "// CHECK#1\ntry{\n y;\n $ERROR('#1: \"y\" lead to throwing exception');\n}\ncatch(e){}\n\n// CHECK#2\nvar c2=0;\ntry{\n try{\n someValue;\n $ERROR('#3.1: \"someValues\" lead to throwing exception');\n }\n finally{\n c2=1;\n }\n}\ncatch(e){\n if (c2!==1){\n $ERROR('#3.2: \"finally\" block must be evaluated');\n }\n}\n\n// CHECK#3\nvar c3=0,x3=0;\ntry{\n x3=someValue;\n $ERROR('#3.1: \"x3=someValues\" lead to throwing exception');\n}\ncatch(err){ \t\n x3=1;\n}\nfinally{\n c3=1;\n}\nif (x3!==1){\n $ERROR('#3.2: \"catch\" block must be evaluated');\n}\nif (c3!==1){\n $ERROR('#3.3: \"finally\" block must be evaluated');\n}\n",
"id": "S12.14_A3"
},
{
"section": "12.14",
"description": "Checking if deleting an exception fails",
"strict_mode_negative": "SyntaxError",
"test": "// CHECK#1\ntry {\n throw \"catchme\";\n $ERROR('#1.1: throw \"catchme\" lead to throwing exception');\n}\ncatch (e) {\n if (delete e){\n $ERROR('#1.2: Exception has DontDelete property');\n }\n if (e!==\"catchme\") {\n $ERROR('#1.3: Exception === \"catchme\". Actual: Exception ==='+ e );\n }\n}\n\n// CHECK#2\ntry {\n throw \"catchme\";\n $ERROR('#2.1: throw \"catchme\" lead to throwing exception');\n}\ncatch(e){}\ntry{\n e;\n $ERROR('#2.2: Deleting catching exception after ending \"catch\" block');\n}\ncatch(err){}\n",
"id": "S12.14_A4",
"strict_only": ""
},
{
"section": "12.14",
"description": "Checking \"catch\" catches the Identifier in appropriate way",
"test": "// CHECK#1\ntry {\n throw \"catchme\";\t\n throw \"dontcatchme\";\n $ERROR('#1.1: throw \"catchme\" lead to throwing exception');\n}\ncatch (e) {\n if(e===\"dontcatchme\"){\n $ERROR('#1.2: Exception !== \"dontcatchme\"');\n }\n if (e!==\"catchme\") {\n $ERROR('#1.3: Exception === \"catchme\". Actual: Exception ==='+ e );\n }\n}\n\n// CHECK#2\nfunction SwitchTest1(value){\n var result = 0;\n try{ \n switch(value) {\n case 1:\n result += 4;\n throw result;\n break;\n case 4:\n result += 64;\n throw \"ex\";\n }\n return result;\n }\n catch(e){\t\n if ((value===1)&&(e!==4)) $ERROR('#2.1: Exception === 4. Actual: '+e);\n if ((value===4)&&(e!==\"ex\"))$ERROR('#2.2: Exception === \"ex\". Actual: '+e);\n }\n finally{\n return result;\n }\n}\nif (SwitchTest1(1)!==4) $ERROR('#2.3: \"finally\" block must be evaluated');\nif (SwitchTest1(4)!==64)$ERROR('#2.4: \"finally\" block must be evaluated');\n",
"id": "S12.14_A5"
},
{
"section": "12.14",
"description": "Executing sequence of \"try\" statements, using counters with varying values within",
"test": "// CHECK#1\nvar c1=0;\ntry {\n c1+=1;\n y;\n $ERROR('#1.1: \"y\" lead to throwing exception');\n}\ncatch (e) {\n c1*=2;\n}\nif (c1!==2){\n $ERROR('#1.2: Sequence evaluation of commands try/catch is 1. try, 2. catch');\t\n}\n\n// CHECK#2\nvar c2=0;\ntry{\n c2+=1;\n}\nfinally{\n c2*=2;\n}\nif (c2!==2){\n $ERROR('#2: Sequence evaluation of commands try/finally is 1. try, 2. finally');\n}\n\n// CHECK#3\nvar c3=0;\ntry{\n c3=1;\n z;\n}\ncatch(err){\n c3*=2;\n}\nfinally{\n c3+=1;\n}\nif (c3!==3){\n $ERROR('#3: Sequence evaluation of commands try/catch/finally(with exception) is 1. try, 2. catch, 3. finally');\n}\t\n\n// CHECK#4\nvar c4=0;\ntry{\n c4=1;\n}\ncatch(err){\n c4*=3;\n}\nfinally{\n c4+=1;\n}\nif (c4!==2){\n $ERROR('#4: Sequence evaluation of commands try/catch/finally(without exception) is 1. try, 2. finally');\n}\t\n",
"id": "S12.14_A6"
},
{
"section": "12.14",
"description": "Checking if the production of nested TryStatement statements evaluates correct",
"test": "// CHECK#1\ntry{\n try{\n throw \"ex2\";\n }\n catch(er2){\n if (er2!==\"ex2\")\n $ERROR('#1.1: Exception === \"ex2\". Actual: Exception ==='+ e );\n throw \"ex1\";\n }\n }\n catch(er1){\n if (er1!==\"ex1\") $ERROR('#1.2: Exception === \"ex1\". Actual: '+er1);\n if (er1===\"ex2\") $ERROR('#1.3: Exception !== \"ex2\". Actual: catch previous embedded exception');\n}\n\n// CHECK#2\ntry{\n throw \"ex1\";\n}\ncatch(er1){\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1===\"ex1\") $ERROR('#2.1: Exception !== \"ex1\". Actual: catch previous catching exception');\n if (er1!==\"ex2\") $ERROR('#2.2: Exception === \"ex2\". Actual: Exception ==='+ er1 );\n }\n if (er1!==\"ex1\") $ERROR('#2.3: Exception === \"ex1\". Actual: Exception ==='+ er1 );\n if (er1===\"ex2\") $ERROR('#2.4: Exception !== \"ex2\". Actual: catch previous catching exception');\n}\n\n// CHECK#3\ntry{\n throw \"ex1\";\n}\ncatch(er1){\n if (er1!==\"ex1\") $ERROR('#3.1: Exception ===\"ex1\". Actual: Exception ==='+ er1 );\n}\nfinally{\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1===\"ex1\") $ERROR('#3.2: Exception !==\"ex1\". Actual: catch previous embedded exception');\n if (er1!==\"ex2\") $ERROR('#3.3: Exception ===\"ex2\". Actual: Exception ==='+ er1 );\n }\n}\n\n// CHECK#4\nvar c4=0;\ntry{\n throw \"ex1\";\n}\ncatch(er1){\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1===\"ex1\") $ERROR('#4.1: Exception !==\"ex1\". Actual: catch previous catching exception');\n if (er1!==\"ex2\") $ERROR('#4.2: Exception ===\"ex2\". Actual: Exception ==='+ er1 );\n }\n if (er1!==\"ex1\") $ERROR('#4.3: Exception ===\"ex1\". Actual: Exception ==='+ er1 );\n if (er1===\"ex2\") $ERROR('#4.4: Exception !==\"ex2\". Actual: Catch previous embedded exception');\n}\nfinally{\n c4=1;\n}\nif (c4!==1) $ERROR('#4.5: \"finally\" block must be evaluated');\n\n// CHECK#5\nvar c5=0;\ntry{\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1!==\"ex2\") $ERROR('#5.1: Exception ===\"ex2\". Actual: Exception ==='+ er1 );\n }\n throw \"ex1\";\n}\ncatch(er1){\n if (er1!==\"ex1\") $ERROR('#5.2: Exception ===\"ex1\". Actual: Exception ==='+ er1 );\n if (er1===\"ex2\") $ERROR('#5.3: Exception !==\"ex2\". Actual: catch previous embedded exception');\n}\nfinally{\n c5=1;\n}\nif (c5!==1) $ERROR('#5.4: \"finally\" block must be evaluated');\n\n// CHECK#6\nvar c6=0;\ntry{\n try{\n throw \"ex1\";\n }\n catch(er1){\n if (er1!==\"ex1\") $ERROR('#6.1: Exception ===\"ex1\". Actual: Exception ==='+ er1 );\n }\n}\nfinally{\n c6=1;\t\t\n}\nif (c6!==1) $ERROR('#6.2: \"finally\" block must be evaluated');\n\n// CHECK#7\nvar c7=0;\ntry{\n try{\n throw \"ex1\";\n }\n finally{\n try{\n c7=1;\n throw \"ex2\";\n }\n catch(er1){\n if (er1!==\"ex2\") $ERROR('#7.1: Exception ===\"ex2\". Actual: Exception ==='+ er1 );\n if (er1===\"ex1\") $ERROR('#7.2: Exception !==\"ex1\". Actual: catch previous embedded exception');\n c7++;\n }\n }\n}\ncatch(er1){\n if (er1!==\"ex1\") $ERROR('#7.3: Exception ===\"ex1\". Actual: Exception ==='+ er1 );\n}\nif (c7!==2) $ERROR('#7.4: \"finally\" block must be evaluated');\n",
"id": "S12.14_A7_T1"
},
{
"section": "12.14",
"description": "Checking if the production of nested TryStatement statements evaluates correct",
"test": "// CHECK#1\ntry{\n try{\n throw \"ex2\";\n }\n finally{\n throw \"ex1\";\n }\n}\ncatch(er1){\n if (er1!==\"ex1\") $ERROR('#1.2: Exception === \"ex1\". Actual: Exception ==='+er1 );\n if (er1===\"ex2\") $ERROR('#1.3: Exception !== \"ex2\". Actual: catch previous embedded exception');\n}\n\n// CHECK#2\ntry{\n try{\n throw \"ex1\";\n }\n catch(er1){\n if (er1!==\"ex1\") $ERROR('#2.1: Exception === \"ex1\". Actual: Exception ==='+er1 );\n try{\n throw \"ex2\";\n }\n finally{\n throw \"ex3\";\n }\n $ERROR('#2.2: throw \"ex1\" lead to throwing exception');\n }\n}\ncatch(er1){\n if (er1!==\"ex3\") $ERROR('#2.3: Exception === \"ex3\". Actual: Exception ==='+er1 );\n}\n\n// CHECK#3\ntry{\n try{\n throw \"ex1\";\n }\n catch(er1){\n if (er1!==\"ex1\") $ERROR('#3.1: Exception === \"ex1\". Actual: Exception ==='+er1 );\n }\n finally{\n try{\n throw \"ex2\";\n }\n finally{\n throw \"ex3\";\n }\n }\t\n}\ncatch(er1){\n if (er1!==\"ex3\") $ERROR('#3.2: Exception === \"ex3\". Actual: Exception ==='+er1 );\n}\n\n// CHECK#4\nvar c4=0;\ntry{\n try{\n throw \"ex1\";\n }\n catch(er1){\n if (er1!==\"ex1\") $ERROR('#4.1: Exception === \"ex1\". Actual: Exception ==='+er1 );\n try{\n throw \"ex2\";\n }\n finally{\n throw \"ex3\";\n }\n }\n finally{\n c4=1;\n }\n}\ncatch(er1){\n if (er1!==\"ex3\") $ERROR('#4.2: Exception === \"ex3\". Actual: Exception ==='+er1 );\n}\nif (c4!==1) $ERROR('#4.3: \"finally\" block must be evaluated');\n\n// CHECK#5\nvar c5=0;\ntry{\n try{\n throw \"ex2\";\n }\n finally{\n throw \"ex3\";\n }\n throw \"ex1\";\n}\ncatch(er1){\n if (er1!==\"ex3\") $ERROR('#5.1: Exception === \"ex3\". Actual: Exception ==='+er1 );\n if (er1===\"ex2\") $ERROR('#5.2: Exception !== \"ex2\". Actual: catch previous embedded exception');\n if (er1===\"ex1\") $ERROR('#5.3: Exception !==\"ex1\". Actual: catch previous embedded exception');\n}\nfinally{\n c5=1;\n}\nif (c5!==1) $ERROR('#5.4: \"finally\" block must be evaluated');\n\n// CHECK#6\nvar c6=0;\ntry{\n try{\n try{\n throw \"ex1\";\n }\n finally{\n throw \"ex2\";\n }\n }\n finally{\n c6=1;\n }\n}\ncatch(er1){\n if (er1!==\"ex2\") $ERROR('#6.1: Exception === \"ex2\". Actual: Exception ==='+er1 );\n}\nif (c6!==1) $ERROR('#6.2: \"finally\" block must be evaluated');\n\n// CHECK#7\nvar c7=0;\ntry{\n try{\n throw \"ex1\";\n }\n finally{\n try{\n c7=1;\n throw \"ex2\";\n }\n finally{\n c7++;\n throw \"ex3\";\n }\n }\n}\ncatch(er1){\n if (er1!==\"ex3\") $ERROR('#7.1: Exception === \"ex3\". Actual: Exception ==='+er1 );\n}\nif (c7!==2) $ERROR('#7.2: Embedded \"try/finally\" blocks must be evaluated');\n",
"id": "S12.14_A7_T2"
},
{
"section": "12.14",
"description": "Checking if the production of nested TryStatement statements evaluates correct",
"test": "// CHECK#1\ntry{\n try{\n throw \"ex2\";\n }\n catch(er2){\n if (er2!==\"ex2\") $ERROR('#1.1: Exception === \"ex2\". Actual: Exception ==='+er2);\n throw \"ex1\";\n }\n finally{\n throw \"ex3\";\n }\n}\ncatch(er1){\n if (er1!==\"ex3\") $ERROR('#1.2: Exception === \"ex3\". Actual: Exception ==='+er1);\n if (er1===\"ex2\") $ERROR('#1.3: Exception !==\"ex2\". Actual: catch previous catched exception');\n if (er1===\"ex1\") $ERROR('#1.4: Exception !==\"ex1\". Actual: catch previous embedded exception');\n}\n\n// CHECK#2\nvar c2=0;\ntry{\n throw \"ex1\";\n}\ncatch(er1){\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1===\"ex1\") $ERROR('#2.1: Exception !==\"ex1\". Actual: catch previous catched exception');\n if (er1!==\"ex2\") $ERROR('#2.2: Exception === \"ex2\". Actual: Exception ==='+er1);\n }\n finally{\n c2=1;\n }\n if (er1!==\"ex1\") $ERROR('#2.3: Exception === \"ex1\". Actual: Exception ==='+er1);\n if (er1===\"ex2\") $ERROR('#2.4: Exception !== \"ex2\". Actual: catch previous embedded exception');\n}\nif (c2!==1)\t$ERROR('#2.5: \"finally\" block must be evaluated');\n\n// CHECK#3\nvar c3=0;\ntry{\n throw \"ex1\";\n}\ncatch(er1){\n if (er1!==\"ex1\") $ERROR('#3.1: Exception === \"ex1\". Actual: Exception ==='+er1);\n}\nfinally{\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1===\"ex1\") $ERROR('#3.2: Exception !==\"ex1\". Actual: catch previous catched exception');\n if (er1!==\"ex2\") $ERROR('#3.3: Exception === \"ex2\". Actual: Exception ==='+er1);\n }\n finally{\n c3=1;\n }\n}\nif (c3!==1)\t$ERROR('#3.4: \"finally\" block must be evaluated');\n\n// CHECK#4\nvar c4=0;\ntry{\n try{\n throw \"ex1\";\n }\n catch(er1){\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1===\"ex1\") $ERROR('#4.1: Exception !==\"ex2\". Actual: catch previous catched exception');\n if (er1!==\"ex2\") $ERROR('#4.2: Exception === \"ex2\". Actual: Exception ==='+er1);\n }\n finally{\n c4=2;\n throw \"ex3\";\n }\n if (er1!==\"ex1\") $ERROR('#4.3: Exception === \"ex2\". Actual: Exception ==='+er1);\n if (er1===\"ex2\") $ERROR('#4.4: Exception !==\"ex2\". Actual: catch previous catched exception');\n if (er1===\"ex3\") $ERROR('#4.5: Exception !==\"ex3\". Actual: Catch previous embedded exception');\n }\n finally{\n c4*=2;\n }\n}\ncatch(er1){}\nif (c4!==4) $ERROR('#4.6: \"finally\" block must be evaluated');\n\n// CHECK#5\nvar c5=0;\ntry{\n try{\n throw \"ex2\";\n }\n catch(er1){\n if (er1!==\"ex2\") $ERROR('#5.1: Exception === \"ex2\". Actual: Exception ==='+er1);\n }\n finally{\n throw \"ex3\";\n }\n throw \"ex1\";\n}\ncatch(er1){\n if (er1!==\"ex3\") $ERROR('#5.2: Exception === \"ex3\". Actual: Exception ==='+er1);\n if (er1===\"ex2\") $ERROR('#5.3: Exception !==\"ex2\". Actual: catch previous catched exception');\n if (er1===\"ex1\") $ERROR('#5.4: Exception !==\"ex1\". Actual: catch previous embedded exception');\n}\nfinally{\n c5=1;\n}\nif (c5!==1) $ERROR('#5.5: \"finally\" block must be evaluated');\n\n// CHECK#6\nvar c6=0;\ntry{\n try{\n throw \"ex1\";\n }\n catch(er1){\n if (er1!==\"ex1\") $ERROR('#6.1: Exception === \"ex1\". Actual: Exception ==='+er1);\n }\n finally{\n c6=2;\n }\n}\nfinally{\n c6*=2;\n}\nif (c6!==4) $ERROR('#6.2: \"finally\" block must be evaluated');\n\n// CHECK#7\nvar c7=0;\ntry{\n try{\n throw \"ex1\";\n }\n finally{\n try{\n c7=1;\n throw \"ex2\";\n }\n catch(er1){\n if (er1!==\"ex2\") $ERROR('#7.1: Exception === \"ex2\". Actual: Exception ==='+er1);\n if (er1===\"ex1\") $ERROR('#7.2: Exception !==\"ex2\". Actual: catch previous catched exception');\n c7++;\n }\n finally{\n c7*=2;\n }\n }\n}\ncatch(er1){\n if (er1!==\"ex1\") $ERROR('#7.3: Exception === \"ex1\". Actual: Exception ==='+er1);\n}\nif (c7!==4) $ERROR('#7.4: \"finally\" block must be evaluated');\n",
"id": "S12.14_A7_T3"
},
{
"section": "12.14",
"description": "Throwing exception within an \"if\" statement",
"test": "// CHECK#1\nvar c1=1;\ntry{\n if(c1===1){\n throw \"ex1\";\n $ERROR('#1.1: throw \"ex1\" lead to throwing exception');\n }\n $ERROR('#1.2: throw \"ex1\" inside the \"if\" statement lead to throwing exception');\n}\ncatch(er1){\t\n if (er1!==\"ex1\") $ERROR('#1.3: Exception ===\"ex1\". Actual: Exception ==='+er1);\n}\n\n// CHECK#2\nvar c2=1;\nif(c2===1){\n try{\n throw \"ex1\";\n $ERROR('#2.1: throw \"ex1\" lead to throwing exception');\n }\n catch(er1){\n if(er1!=\"ex1\") $ERROR('#2.2: Exception ===\"ex1\". Actual: Exception ==='+er1);\n }\n}\n",
"id": "S12.14_A8"
},
{
"section": "12.14",
"description": "Loop within a \"try\" Block, from where exception is thrown",
"test": "// CHECK#1\nvar i=0;\ntry{\n do{\n if(i===5) throw i;\n i++;\n }\n while(i<10);\n}\ncatch(e){\n if(e!==5)$ERROR('#1: Exception ===5. Actual: Exception ==='+ e );\n}\n",
"id": "S12.14_A9_T1"
},
{
"section": "12.14",
"description": "\"try\" statement within a loop, the statement contains \"continue\" statement",
"test": "// CHECK#1\nvar c1=0,fin=0;\ndo{\n try{\n c1+=1;\n continue;\n }\n catch(er1){}\n finally{\n fin=1;\n }\n fin=-1;\n}\nwhile(c1<2);\nif(fin!==1){\n $ERROR('#1: \"finally\" block must be evaluated at \"try{continue} catch finally\" construction');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\ndo{\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n continue;\n }\n finally{\n fin2=1;\n }\n fin2=-1;\n}\nwhile(c2<2);\nif(fin2!==1){\n $ERROR('#2: \"finally\" block must be evaluated at \"try catch{continue} finally\" construction');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\ndo{\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n continue;\n }\n fin3=0;\n}\nwhile(c3<2);\nif(fin3!==1){\n $ERROR('#3: \"finally\" block must be evaluated at \"try catch finally{continue}\" construction');\n}\n\n// CHECK#4\nvar c4=0,fin4=0;\ndo{\n try{\n c4+=1;\n continue;\n }\n finally{\n fin4=1;\n }\n fin4=-1;\n}\nwhile(c4<2);\nif(fin4!==1){\n $ERROR('#4: \"finally\" block must be evaluated at \"try{continue} finally\" construction');\n}\n\n// CHECK#5\nvar c5=0;\ndo{\n try{\n throw \"ex1\";\n }\n catch(er1){\n c5+=1;\n continue;\n }\n}\nwhile(c5<2);\nif(c5!==2){\n $ERROR('#5: \"try catch{continue}\" must work correctly');\n}\n\n// CHECK#6\nvar c6=0,fin6=0;\ndo{\n try{\n c6+=1;\n throw \"ex1\"\n }\n finally{\n fin6=1;\n continue;\n }\n fin6=-1;\n}\nwhile(c6<2);\nif(fin6!==1){\n $ERROR('#6.1: \"finally\" block must be evaluated');\n}\nif(c6!==2){\n $ERROR('#6.2: \"try finally{continue}\" must work correctly');\n}\n",
"id": "S12.14_A9_T2"
},
{
"section": "12.14",
"description": "\"try\" statement within a loop, the statement contains \"break\" statement",
"test": "// CHECK#1\nvar c1=0,fin=0;\ndo{\n try{\n c1+=1;\n break;\n }\n catch(er1){}\n finally{\n fin=1;\n }\n fin=-1;\n c1+=2;\n}\nwhile(c1<2);\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==1){\n $ERROR('#1.2: \"try{break}catch finally\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\ndo{\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n fin2=1;\n }\n c2+=2;\n fin2=-1;\n}\nwhile(c2<2);\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==1){\n $ERROR('#2.2: \"try catch{break} finally\" must work correctly');\n}\n\n// CHECK#3\nvar c3=0,fin3=0;\ndo{\n try{\n throw \"ex1\";\n }\n catch(er1){\n c3+=1;\n }\n finally{\n fin3=1;\n break;\n }\n c3+=2;\n fin3=0;\n}\nwhile(c3<2);\nif(fin3!==1){\n $ERROR('#3.1: \"finally\" block must be evaluated');\n}\nif(c3!==1){\n $ERROR('#3.2: \"try catch finally{break}\" must work correctly');\n}\n\n// CHECK#4\nvar c4=0,fin4=0;\ndo{\n try{\n c4+=1;\n break;\n }\n finally{\n fin4=1;\n }\n fin4=-1;\n c4+=2;\n}\nwhile(c4<2);\nif(fin4!==1){\n $ERROR('#4.1: \"finally\" block must be evaluated');\n}\nif(c4!==1){\n $ERROR('#4.2: \"try{break} finally\" must work correctly');\n}\n\n// CHECK#5\nvar c5=0;\ndo{\n try{\n throw \"ex1\";\n }\n catch(er1){\n break;\n }\n}\nwhile(c5<2);\nif(c5!==0){\n $ERROR('#5: \"try catch{break}\" must work correctly');\n}\n\n// CHECK#6\nvar c6=0;\ndo{\n try{\n c6+=1;\n break;\n }\n catch(er1){}\n c6+=2;\n}\nwhile(c6<2);\nif(c6!==1){\n $ERROR('#6: \"try{break} catch\" must work correctly');\n}\n\n// CHECK#7\nvar c7=0,fin7=0;\ntry{\n do{\n try{\n c7+=1;\n throw \"ex1\";\n }\n finally{\n fin7=1;\n break;\n }\n fin7=-1;\n c7+=2;\n }\n while(c7<2);\n}\ncatch(ex1){\n c7=10;\n}\nif(fin7!==1){\n $ERROR('#7.1: \"finally\" block must be evaluated');\n}\nif(c7!==1){\n $ERROR('#7.2: try finally{break} error');\n}\n",
"id": "S12.14_A9_T3"
},
{
"section": "12.14",
"description": "\"try\" statement within a loop, the statement contains \"continue\" and \"break\" statements",
"test": "// CHECK#1\nvar c1=0,fin=0;\ndo{\n try{\n c1+=1;\n break;\n }\n catch(er1){}\n finally{\n fin=1;\n continue;\n }\n fin=-1;\n c1+=2;\n}\nwhile(c1<2);\nif(fin!==1){\n $ERROR('#1.1: \"finally\" block must be evaluated');\n}\nif(c1!==2){\n $ERROR('#1.2: \"try{break} catch finally{continue}\" must work correctly');\n}\n\n// CHECK#2\nvar c2=0,fin2=0;\ndo{\n try{\n throw \"ex1\";\n }\n catch(er1){\n c2+=1;\n break;\n }\n finally{\n fin2=1;\n continue;\n }\n c2+=2;\n fin2=-1;\n}\nwhile(c2<2);\nif(fin2!==1){\n $ERROR('#2.1: \"finally\" block must be evaluated');\n}\nif(c2!==2){\n $ERROR('#2.2: \"try catch{break} finally{continue}\" must work correctly');\n}\n",
"id": "S12.14_A9_T4"
},
{
"section": "12.14",
"description": "Checking if exceptions are thrown correctly from wherever of loop body",
"test": "// CHECK#1\nvar c=0, i=0;\nvar fin=0;\ndo{\n i+=1;\n try{\n if(c===0){\n throw \"ex1\";\n $ERROR('#1.1: throw \"ex1\" lead to throwing exception');\n }\n c+=2;\n if(c===1){\n throw \"ex2\";\n $ERROR('#1.2: throw \"ex2\" lead to throwing exception');\n }\n }\n catch(er1){\n c-=1;\n continue;\n $ERROR('#1.3: \"try catch{continue} finally\" must work correctly');\n }\n finally{\n fin+=1;\n }\n}\nwhile(i<10);\nif(fin!==10){\n $ERROR('#1.4: \"finally\" block must be evaluated');\n}\n\n",
"id": "S12.14_A9_T5"
}
]
}
}

View File

@ -0,0 +1,41 @@
{
"testCollection": {
"name": "12.1_Block",
"numTests": 5,
"tests": [
{
"section": "12.1",
"description": "Trying to declare function at the Block statement",
"negative": "SyntaxError",
"test": "\"use strict\";\n{\n function __func(){}\n}\n",
"id": "S12.1_A1"
},
{
"section": "12.1",
"description": "Throwing exception within a Block",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tx();\n\t$ERROR('#1: \"x()\" lead to throwing exception');\n} catch (e) {\n\t$PRINT(e.message);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry {\n throw \"catchme\";\t\n $ERROR('#2: throw \"catchme\" lead to throwing exception');\n} catch (e) {\n\tif (e!==\"catchme\") {\n\t\t$ERROR('#2.1: Exception === \"catchme\". Actual: Exception ==='+ e );\n\t}\n}\n\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.1_A2"
},
{
"section": "12.1",
"description": "Checking if execution of \"y={__func}()\" fails",
"negative": "",
"test": "function __func(){};\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ny={__func}();\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.1_A4_T1"
},
{
"section": "12.1",
"description": "Checking if execution of \"y={x}\" fails",
"negative": "",
"test": "x=1;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ny={x};\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.1_A4_T2"
},
{
"section": "12.1",
"description": "Throwing exceptions within embedded/sequence Blocks",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tthrow 1;\n throw 2;\n throw 3;\n $ERROR('1.1: throw 1 lead to throwing exception');\n} catch (e) {\n\tif (e!==1) {\n\t\t$ERROR('#1.2: Exception === 1. Actual: Exception ==='+ e);\n\t}\n}\n////////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry {\n\t{\n\t throw 1;\n throw 2;\n }\n throw 3;\n $ERROR('#2.1: throw 1 lead to throwing exception');\n} catch (e) {\n\tif (e!==1) {\n\t\t$ERROR('#2.2: Exception === 1. Actual: Exception ==='+ e);\n\t}\n}\n////////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\ntry {\n\tthrow 1;\n {\n throw 2;\n throw 3;\n }\n $ERROR('#3.1: throw 1 lead to throwing exception');\n} catch (e) {\n\tif (e!==1) {\n\t\t$ERROR('#3.2: Exception === 1. Actual: Exception ==='+ e);\n\t}\n}\n////////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.1_A5"
}
]
}
}

View File

@ -0,0 +1,146 @@
{
"testCollection": {
"name": "12.2.1",
"numTests": 18,
"tests": [
{
"id": "12.2.1-1-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-1-s.js",
"description": "eval - a function declaring a var named 'eval' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('function foo() { var eval; }');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-10-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-10-s.js",
"description": "Strict Mode: an indirect eval assigning into 'eval' does not throw",
"test": "assertTrue((function testcase() {\n 'use strict';\n var s = eval;\n s('eval = 42;');\n return true;\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-11",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-11.js",
"description": "arguments as var identifier in eval code is allowed",
"test": "assertTrue((function testcase() {\n eval(\"var arguments;\");\n return true;\n }).call(this));\n"
},
{
"id": "12.2.1-12-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-12-s.js",
"description": "arguments as local var identifier throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('function foo() { var arguments;}');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-12",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-12.js",
"description": "arguments as local var identifier is allowed",
"test": "assertTrue((function testcase() {\n eval(\"(function (){var arguments;})\");\n return true;\n }).call(this));\n"
},
{
"id": "12.2.1-13-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-13-s.js",
"description": "arguments assignment throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('function foo() { arguments = 42; }; foo()');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-2-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-2-s.js",
"description": "eval - a function assigning into 'eval' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('function foo() { eval = 42; }; foo()');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-3-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-3-s.js",
"description": "eval - a function expr declaring a var named 'eval' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('(function () { var eval; })');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-34-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-34-s.js",
"description": "'for(var eval in ...) {...}' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('for (var eval in null) {};');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-35-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-35-s.js",
"description": "'for(var eval = 42 in ...) {...}' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('for (var eval = 42 in null) {};');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-36-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-36-s.js",
"description": "'for(var arguments in ...) {...}' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('for (var arguments in null) {};');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-37-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-37-s.js",
"description": "'for(var arguments = 42 in ...) {...}' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('for (var arguments = 42 in null) {};');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-4-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-4-s.js",
"description": "eval - a function expr assigning into 'eval' throws a SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('(function () { eval = 42; })()');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-5-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-5-s.js",
"description": "Strict Mode - a Function declaring var named 'eval' does not throw SyntaxError",
"test": "assertTrue((function testcase() {\n 'use strict';\n Function('var eval;');\n return true;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "12.2.1-6-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-6-s.js",
"description": "eval - a Function assigning into 'eval' will not throw any error if contained within strict mode and its body does not start with strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n \n var f = Function('eval = 42;');\n f();\n return true;\n }).call(this));\n",
"strict_only": ""
},
{
"id": "12.2.1-7-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-7-s.js",
"description": "eval - a direct eval declaring a var named 'eval' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('var eval;');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError);\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-8-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-8-s.js",
"description": "eval - a direct eval assigning into 'eval' throws SyntaxError in strict mode",
"test": "assertTrue((function testcase() {\n 'use strict';\n\n try {\n eval('eval = 42;');\n return false;\n }\n catch (e) {\n return (e instanceof SyntaxError) ;\n }\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
},
{
"id": "12.2.1-9-s",
"path": "TestCases/chapter12/12.2/12.2.1/12.2.1-9-s.js",
"description": "Strict Mode: an indirect eval declaring a var named 'eval' does not throw",
"test": "assertTrue((function testcase() {\n 'use strict';\n var s = eval;\n s('var eval;');\n return true;\n }).call(this));\n",
"precondition": "(fnSupportsStrict())",
"strict_only": ""
}
]
}
}

View File

@ -0,0 +1,136 @@
{
"testCollection": {
"name": "12.2_Variable_Statement",
"numTests": 20,
"tests": [
{
"section": "12.2",
"description": "Creating variables after entering the execution scope",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\t__x = __x;\n __y = __x ? \"good fellow\" : \"liar\"; // __y assigned to \"liar\" since __x undefined\n __z = __z === __x ? 1 : 0; // __z assigned to 1 since both __x and __z are undefined\n} catch (e) {\n\t$ERROR('#1: Using declarated variable before it declaration is admitted');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry{\n __something__undefined = __something__undefined;\n $ERROR('#2: \"__something__undefined = __something__undefined\" lead to throwing exception');\n} catch(e){\n $PRINT(e.message);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif ((__y !== \"liar\")&(__z !== 1)) {\n\t$ERROR('#3: (__y === \"liar\") and (__z === 1). Actual: __y ==='+__y+' and __z ==='+__z );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar __x, __y = true, __z = __y ? \"smeagol\" : \"golum\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (!__y&!(__z = \"smeagol\")) {\n\t$ERROR('#4: A variable with an Initialiser is assigned the value of its AssignmentExpression when the VariableStatement is executed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A1"
},
{
"section": "12.2",
"description": "Declaring variable within a \"for\" IterationStatement",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\t__ind=__ind;\n} catch (e) {\n $ERROR('#1: var inside \"for\" is admitted '+e.message);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nfor (var __ind;;){\n break;\n}\n",
"id": "S12.2_A10"
},
{
"section": "12.2",
"description": "Changing variable value using property attributes",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nthis['__declared__var'] = \"baloon\";\nif (this['__declared__var'] !== \"baloon\") {\n\t$ERROR('#1: this[\\'__declared__var\\'] === \"baloon\". Actual: this[\\'__declared__var\\'] ==='+ this['__declared__var'] );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__declared__var !== \"baloon\") {\n\t$ERROR('#2: __declared__var === \"baloon\". Actual: __declared__var ==='+ __declared__var );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar __declared__var;\n",
"id": "S12.2_A11"
},
{
"section": "12.2",
"description": "Declaring variable within \"do-while\" statement",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tx=x;\n} catch (e) {\n\t$ERROR('#1: Declaration variable inside \"do-while\" statement is admitted');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\ndo var x; while (false);\n",
"id": "S12.2_A12"
},
{
"section": "12.2",
"description": "Checking if deleting global variables that have the attributes {DontDelete} fails",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (delete(__variable)) {\n\t$ERROR('#1: delete(__variable)===false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (delete(this[\"__variable\"])) {\n\t$ERROR('#2: delete(this[\"__variable\"])===false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\nvar __variable;\nvar __variable = \"defined\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (delete(__variable) | delete(this[\"__variable\"])) {\n\t$ERROR('#3: (delete(__variable) | delete(this[\"__variable\"]))===false' );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif ((__variable !== \"defined\")|(this[\"__variable\"] !==\"defined\")) {\n\t$ERROR('#4: __variable === \"defined\" and this[\"__variable\"] ===\"defined\"');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.2_A2"
},
{
"section": "12.2",
"description": "Using Global scope and Function scope together",
"test": "var __var = \"OUT\";\n\n(function(){\n var __var =\"IN\";\n\t(function(){__var = \"INNER_SPACE\";})();\n\t(function(){var __var = \"INNER_SUN\";})();\n\t//////////////////////////////////////////////////////////////////////////////\n\t//CHECK#1\n if (__var !== \"INNER_SPACE\") {\n \t$ERROR('#1: __var === \"INNER_SPACE\". Actual: __var ==='+ __var );\n }\n\t//\n\t//////////////////////////////////////////////////////////////////////////////\n})();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__var !== \"OUT\") {\n\t$ERROR('#2: __var === \"OUT\". Actual: __var ==='+ __var );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n(function(){\n __var =\"IN\";\n\t(function(){__var = \"INNERED\"})();\n\t(function(){var __var = \"INNAGER\"})();\n\t//////////////////////////////////////////////////////////////////////////////\n\t//CHECK#3\n if (__var!==\"INNERED\") {\n \t$ERROR('#3: __var===\"INNERED\". Actual: __var==='+ __var );\n }\n\t//\n\t//////////////////////////////////////////////////////////////////////////////\n})();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (__var!==\"INNERED\") {\n\t$ERROR('#4: __var===\"INNERED\". Actual: __var==='+ __var );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A3"
},
{
"section": "12.2",
"description": "Create and use unicode characters in variable Identifier",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\t__var=__var;\n} catch (e) {\n\t$ERROR('#1: Unicode characters in variable Identifier allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar \\u005f\\u005f\\u0076\\u0061\\u0072 = 1;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__var !== 1) {\n\t$ERROR('#2: __var === 1. Actual: __var ==='+ __var );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A4"
},
{
"section": "12.2",
"description": "Executing eval(\"var x\")",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\tx=x;\n\t$ERROR('#1: \"x=x\" lead to throwing exception');\n}catch(e){\n\t$PRINT(e.message);\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\neval(\"var x\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry{\n\tx=x;\n}catch(e){\n\t$ERROR('#2: VariableDeclaration inside Eval statement is initialized when program reaches the eval statement '+e.message);\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A5"
},
{
"section": "12.2",
"description": "Declaring variable within \"try-catch\" statement",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\tintry__var=intry__var;\n}catch(e){\n\t$ERROR('#1: Variable declaration inside \"try\" block is admitted');\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry{\n\tincatch__var=incatch__var;\n}catch(e){\n\t$ERROR('#2: Variable declaration inside \"catch\" block is admitted');\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\ntry{\n var intry__var;\n}catch(e){\n var incatch__var;\n};\n",
"id": "S12.2_A6_T1"
},
{
"section": "12.2",
"description": "Declaring variables within \"try-catch\" statement",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\tintry__intry__var=intry__intry__var;\n\tintry__incatch__var=intry__incatch__var;\n\tincatch__intry__var=incatch__intry__var;\n\tincatch__incatch__var=incatch__incatch__var;\n}catch(e){\n\t$ERROR('#1: Variable declaration inside \"try-catch\" block is admitted');\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\ntry{\n try {\n \tvar intry__intry__var;\n } catch (e) {\n \tvar intry__incatch__var;\n }\n}catch(e){\n try {\n \tvar incatch__intry__var;\n } catch (e) {\n var incatch__incatch__var;\n }\n \n};\n",
"id": "S12.2_A6_T2"
},
{
"section": "12.2",
"description": "Declaring variable within \"for\" statement",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\tinfor_var = infor_var;\n}catch(e){\n\t$ERROR('#1: Variable declaration inside \"for\" loop is admitted');\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\nfor (;;){\n break;\n var infor_var;\n}\n",
"id": "S12.2_A7"
},
{
"section": "12.2",
"description": "Checking if execution of \"var x += 1\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x += 1;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A8_T1"
},
{
"section": "12.2",
"description": "Checking if execution of \"var x | true\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x | true;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A8_T2"
},
{
"section": "12.2",
"description": "Checking if execution of \"var x && 1\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x && 1;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A8_T3"
},
{
"section": "12.2",
"description": "Checking if execution of \"var x++\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x++;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A8_T4"
},
{
"section": "12.2",
"description": "Checking if execution of \"var --x\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar --x;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.2_A8_T5"
},
{
"section": "12.2",
"description": "Checking if execution of \"var x*1\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x*1;\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.2_A8_T6"
},
{
"section": "12.2",
"description": "Checking if execution of \"var x>>1\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x>>1;\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.2_A8_T7"
},
{
"section": "12.2",
"description": "Checking if execution of \"var x in __arr\" fails",
"negative": "",
"test": "__arr = [];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x in __arr;\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.2_A8_T8"
},
{
"section": "12.2",
"description": "Enumerating property attributes of \"this\" and then searching for the declared variable",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor (__prop in this){\n if (__prop === \"__declared__var\")\n enumed=true;\n}\nif (!(enumed)) {\n\t$ERROR('#1: When using property attributes, {DontEnum} not used');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nvar __declared__var;\n",
"id": "S12.2_A9"
}
]
}
}

View File

@ -0,0 +1,14 @@
{
"testCollection": {
"name": "12.3_Empty_Statement",
"numTests": 1,
"tests": [
{
"section": "12.3",
"description": ": Using EmptyStatement ;;",
"test": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;; ;;;;;; ;; ;; ;;;;;; ;;;;;;;; ;; ;; ;;;;;\n;;;;; ;; ;;;; ;;;; ;; ;; ;; ;; ;; ;;;;;\n;;;;; ;;;; ;; ;;;; ;; ;;;;;; ;; ;;;; ;;;;;\n;;;;; ;; ;; ;; ;; ;; ;; ;; ;;;;;\n;;;;; ;;;;;; ;; ;; ;; ;; ;; ;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n",
"id": "S12.3_A1"
}
]
}
}

View File

@ -0,0 +1,27 @@
{
"testCollection": {
"name": "12.4_Expression_Statement",
"numTests": 3,
"tests": [
{
"section": "12.4",
"description": "Checking if execution of \"function(){}()\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfunction(){}();\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.4_A1"
},
{
"section": "12.4",
"description": "Checking by using eval \"(eval(\"x+1+x==1\"))\"",
"test": "x=1;\n\n__evaluated = eval(\"x+1+x==1\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__evaluated !== false) {\n\t$ERROR('#1: __evaluated === false. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__evaluated = eval(\"1+1+1==1\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== false) {\n\t$ERROR('#2: __evaluated === false. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.4_A2_T1"
},
{
"section": "12.4",
"description": "Checking by using eval(eval(x), where x is any string)",
"test": "x=\"5+1|0===0\";\n\n__evaluated = eval(x);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__evaluated !== 7) {\n\t$ERROR('#1: __evaluated === 7. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__evaluated = eval(\"2*\"+x+\">-1\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== 11) {\n\t$ERROR('#2: __evaluated === 11. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.4_A2_T2"
}
]
}
}

View File

@ -0,0 +1,160 @@
{
"testCollection": {
"name": "12.5_The_if_Statement",
"numTests": 24,
"tests": [
{
"section": "12.5",
"description": "Using \"if\" without \"else\" construction",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n\nif(0)\n\t$ERROR('#1: 0 in expression is evaluated to false ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(false)\n $ERROR('#2: false in expression is evaluated to false ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(null)\n\t$ERROR('#3: null in expression is evaluated to false ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(undefined)\n\t$ERROR('#4: undefined in expression is evaluated to false ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#5\nif(\"\")\n $ERROR('#5: empty string in expression is evaluated to false ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#6\nif(NaN)\n $ERROR('#5: NaN in expression is evaluated to false ');\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A1.1_T1"
},
{
"section": "12.5",
"description": "Using \"if/else\" construction",
"test": "var c=0;\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(0)\n\t$ERROR('#1.1: 0 in expression is evaluated to false ');\nelse\n c++;\nif (c!=1) $ERROR('#1.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(false)\n $ERROR('#2.1: false in expression is evaluated to false ');\nelse\n c++;\nif (c!=2) $ERROR('#2.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(null)\n\t$ERROR('#3.1: null in expression is evaluated to false ');\nelse\n c++;\nif (c!=3) $ERROR('#3.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(undefined)\n\t$ERROR('#4.1: undefined in expression is evaluated to false ');\nelse\n c++;\nif (c!=4) $ERROR('#4.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#5\nif(\"\")\n $ERROR('#5.1: empty string in expression is evaluated to false ');\nelse\n c++;\nif (c!=5) $ERROR('#5.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#6\nif(NaN)\n $ERROR('#6.1: NaN in expression is evaluated to false ');\nelse\n c++;\nif (c!=6) $ERROR('#6.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A1.1_T2"
},
{
"section": "12.5",
"description": "Using \"if\" without \"else\" construction",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(!(new Number(1)))\n\t$ERROR('#1: new 1 in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(!(new Boolean(true)))\n\t$ERROR('#2: new true in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(!(new String(\"1\")))\n\t$ERROR('#3: new \"1\" in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(!(new String(\"A\")))\n\t$ERROR('#4: new \"A\" in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#5\nif(!(new Boolean(false)))\n $ERROR('#2: new false in expression is evaluated to true ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#6\nif(!(new Number(NaN)))\n $ERROR('#6: new NaN in expression is evaluated to true ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#7\nif(!(new Number(null)))\n $ERROR('#7: new null in expression is evaluated to true ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#8\nif(!(new String(undefined)))\n $ERROR('#8: new undefined in expression is evaluated to true ');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#9\nif(!(new String(\"\")))\n $ERROR('#9: new empty string in expression is evaluated to true ');\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A1.2_T1"
},
{
"section": "12.5",
"description": "Using \"if/else\" construction",
"test": "var c=0;\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(!(new Number(1)))\n\t$ERROR('#1.1: new 1 in expression is evaluated to true');\nelse\n c++;\nif (c!=1) $ERROR('#1.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(!(new Boolean(true)))\n\t$ERROR('#2.1: new true in expression is evaluated to true');\nelse\n c++;\nif (c!=2) $ERROR('#2.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(!(new String(\"1\")))\n\t$ERROR('#3.1: new \"1\" in expression is evaluated to true');\nelse\n c++;\nif (c!=3) $ERROR('#3.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(!(new String(\"A\")))\n\t$ERROR('#4.1: new \"A\" in expression is evaluated to true');\nelse\n c++;\nif (c!=4) $ERROR('#4.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#5\nif(!(new Boolean(false)))\n $ERROR('#5.1: new false in expression is evaluated to true ');\nelse\n c++;\nif (c!=5) $ERROR('#5.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#6\nif(!(new Number(NaN)))\n $ERROR('#6.1: new NaN in expression is evaluated to true ');\nelse\n c++;\nif (c!=6) $ERROR('#6.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#7\nif(!(new Number(null)))\n $ERROR('#7.1: new null in expression is evaluated to true ');\nelse\n c++;\nif (c!=7) $ERROR('#7.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#8\nif(!(new String(undefined)))\n $ERROR('#8.1: new undefined in expression is evaluated to true ');\nelse\n c++;\nif (c!=8) $ERROR('#8.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#9\nif(!(new String(\"\")))\n $ERROR('#9.1: new empty string in expression is evaluated to true ');\nelse\n c++;\nif (c!=9) $ERROR('#9.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A1.2_T2"
},
{
"section": "12.5",
"description": ": Using function expession(function __func(){return 0;}) inside the \"if\" expression ;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nif(function __func(){return 0;}){\n ;\n}else {\n $ERROR('#1: Function expession inside the \"if\" expression is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A10_T1"
},
{
"section": "12.5",
"description": ": Using function expession \"function __func(){return 0;}()\" within \"if\" expression;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nif(function __func(){return 0;}()){\n $ERROR('#1: Function expession inside the if expression is allowed');\n}else {\n ;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A10_T2"
},
{
"section": "12.5",
"description": "Checking if execution of \"if({1})\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nif({1})\n {\n ;\n }else\n {\n ;\n }\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A11"
},
{
"section": "12.5",
"description": "Using embedded \"if/else\" into \"if/else\" constructions",
"test": "//CHECK# 1\nif(true)\n if (false)\n $ERROR('#1.1: At embedded \"if/else\" constructions engine must select right branches');\n else\n ;\nelse \n if (true)\n $ERROR('#1.2: At embedded \"if/else\" constructions engine must select right branches');\n else\n $ERROR('#1.3: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 2\nif(true)\n if (true)\n ;\n else\n $ERROR('#2.1: At embedded \"if/else\" constructions engine must select right branches');\nelse \n if (true)\n $ERROR('#2.2: At embedded \"if/else\" constructions engine must select right branches');\n else\n $ERROR('#2.3: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 3\nif(false)\n if (true)\n $ERROR('#3.1: At embedded \"if/else\" constructions engine must select right branches');\n else\n $ERROR('#3.2: At embedded \"if/else\" constructions engine must select right branches');\nelse \n if (true)\n ;\n else\n $ERROR('#3.3: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 4\nif(false)\n if (true)\n $ERROR('#4.1: At embedded \"if/else\" constructions engine must select right branches');\n else\n $ERROR('#4.2: At embedded \"if/else\" constructions engine must select right branches');\nelse \n if (false)\n $ERROR('#4.3: At embedded \"if/else\" constructions engine must select right branches');\n else\n ;\n",
"id": "S12.5_A12_T1"
},
{
"section": "12.5",
"description": "Using embedded \"if\" into \"if/else\" constructions",
"test": "//CHECK# 1\nif(true){\n if (false)\n $ERROR('#1.1: At embedded \"if/else\" constructions engine must select right branches');\n}\nelse{ \n if (true)\n $ERROR('#1.2: At embedded \"if/else\" constructions engine must select right branches');\n}\n\n//CHECK# 2\nif(true){\n if (true)\n ;\n}\nelse{ \n if (true)\n $ERROR('#2.2: At embedded \"if/else\" constructions engine must select right branches');\n}\n\n//CHECK# 3\nif(false){\n if (true)\n $ERROR('#3.1: At embedded \"if/else\" constructions engine must select right branches');\n}\nelse{ \n if (true)\n ;\n}\n\n//CHECK# 4\nif(false){\n if (true)\n $ERROR('#4.1: At embedded \"if/else\" constructions engine must select right branches');\n}\nelse{ \n if (false)\n $ERROR('#4.3: At embedded \"if/else\" constructions engine must select right branches');\n}\n",
"id": "S12.5_A12_T2"
},
{
"section": "12.5",
"description": "Using embedded \"if/else\" into \"if\" without \"else\" constructions",
"test": "//CHECK# 1\nif(true)\n if (false)\n $ERROR('#1.1: At embedded \"if/else\" constructions engine must select right branches');\n else\n ;\n\n//CHECK# 2\nif(true)\n if (true)\n ;\n else\n $ERROR('#2.1: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 3\nif(false)\n if (true)\n $ERROR('#3.1: At embedded \"if/else\" constructions engine must select right branches');\n else\n $ERROR('#3.2: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 4\nif(false)\n if (true)\n $ERROR('#4.1: At embedded \"if/else\" constructions engine must select right branches');\n else\n $ERROR('#4.2: At embedded \"if/else\" constructions engine must select right branches');\n",
"id": "S12.5_A12_T3"
},
{
"section": "12.5",
"description": "Using embedded \"if\" into \"if\" constructions",
"test": "//CHECK# 1\nif(true)\n if (false)\n $ERROR('#1.1: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 2\nvar c=0;\nif(true)\n if (true)\n c=2;\nif (c!==2)\n $ERROR('#2: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 3\nif(false)\n if (true)\n $ERROR('#3.1: At embedded \"if/else\" constructions engine must select right branches');\n\n//CHECK# 4\nif(false)\n if (true)\n $ERROR('#4.1: At embedded \"if/else\" constructions engine must select right branches');\n",
"id": "S12.5_A12_T4"
},
{
"section": "12.5",
"description": "Using \"if\" without \"else\" construction",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(!(1))\n\t$ERROR('#1: 1 in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(!(true))\n\t$ERROR('#2: true in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(!(\"1\"))\n\t$ERROR('#3: \"1\" in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(!(\"A\"))\n\t$ERROR('#4: \"A\" in expression is evaluated to true');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.5_A1_T1"
},
{
"section": "12.5",
"description": "Using \"if/else\" construction",
"test": "var c=0;\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif(!(1))\n\t$ERROR('#1.1: 1 in expression is evaluated to true');\nelse\n c++;\nif (c!=1) $ERROR('#1.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif(!(true))\n\t$ERROR('#2.1: true in expression is evaluated to true');\nelse\n c++;\nif (c!=2) $ERROR('#2.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif(!(\"1\"))\n\t$ERROR('#3.1: \"1\" in expression is evaluated to true');\nelse\n c++;\nif (c!=3) $ERROR('#3.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif(!(\"A\"))\n\t$ERROR('#4.1: \"A\" in expression is evaluated to true');\nelse\n c++;\nif (c!=4) $ERROR('#4.2: else branch don`t execute');\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.5_A1_T2"
},
{
"section": "12.5",
"description": "Checking by using eval \"eval(\"true\")\"",
"negative": "",
"test": "if (eval(\"true\")) $FAIL('#1: In the \"if\" Statement eval as Expression is admitted');\n",
"id": "S12.5_A2"
},
{
"section": "12.5",
"description": "The Expression is \"(function(){throw 1})()\"",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tif ((function(){throw 1})()) abracadabra\n} catch (e) {\n\tif (e !== 1) {\n\t\t$ERROR('#1: Exception === 1. Actual: Exception ==='+ e);\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry {\n\tif ((function(){throw 1})()) abracadabra; else blablachat;\n} catch (e) {\n\tif (e !== 1) {\n\t\t$ERROR('#2: Exception === 1. Actual: Exception ==='+ e);\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.5_A3"
},
{
"section": "12.5",
"description": "The first statement is \"(function(){throw \"instatement\"})()\"",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tif (true) (function(){throw \"instatement\"})();\n\t$FAIL(\"#1 failed\")\n} catch (e) {\n\tif (e !== \"instatement\") {\n\t\t$ERROR('#1: Exception === \"instatement\". Actual: Exception ==='+ e);\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry {\n\tif (false) (function(){throw \"truebranch\"})(); (function(){throw \"missbranch\"})();\n\t$FAIL(\"#2 failed\")\n} catch (e) {\n\tif (e !== \"missbranch\") {\n\t\t$ERROR('#2: Exception === \"missbranch\". Actual: Exception ==='+ e);\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.5_A4"
},
{
"section": "12.5",
"description": ": The \"if\" Expression is \"function __func(){throw \"FunctionExpression\";}\";",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\t__func=__func;\n\t$ERROR('#1: \"__func=__func\" lead to throwing exception');\n} catch (e) {\n\t;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry {\n\tif(function __func(){throw \"FunctionExpression\";}) (function(){throw \"TrueBranch\"})(); else (function(){\"MissBranch\"})();\n} catch (e) {\n\tif (e !== \"TrueBranch\") {\n\t\t$ERROR('#2: Exception ===\"TrueBranch\". Actual: Exception ==='+ e);\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\ntry {\n\t__func=__func;\n\t$ERROR('#3: \"__func=__func\" lead to throwing exception');\n} catch (e) {\n\t;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.5_A5"
},
{
"section": "12.5",
"description": "Checking if execution of \"if true\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif true;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A6_T1"
},
{
"section": "12.5",
"description": "Checking if execution of \"if false\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif false;\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.5_A6_T2"
},
{
"section": "12.5",
"description": ": Checking by using eval \"eval(\"if(1);\"))\";",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tvar __evaluated = eval(\"if(1);\");\n\tif (__evaluated !== undefined) {\n\t\t$ERROR('#1: __evaluated === undefined. Actual: __evaluated ==='+ __evaluated );\n\t}\n\n} catch (e) {\n\t$ERROR('#1.1: \"__evaluated = eval(\"if(1);\")\" does not lead to throwing exception');\n\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A7"
},
{
"section": "12.5",
"description": "Checking if execution of \"if()\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif();\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.5_A8"
},
{
"section": "12.5",
"description": "Declaring function within an \"if\" statement",
"negative": "SyntaxError",
"test": "\"use strict\";\nif (true) {\n function __func(){};\n} else {\n function __func(){};\n}\n",
"id": "S12.5_A9_T1"
},
{
"section": "12.5",
"description": "Declaring function within an \"if\" that is declared within the strict function",
"negative": "SyntaxError",
"test": "(function(){\n\"use strict\";\n\nif (true) {\n function __func(){};\n} else {\n function __func(){};\n}\n\n});\n",
"id": "S12.5_A9_T2"
},
{
"section": "12.5",
"description": "Declaring function within an \"if\" statement that is declared within the function declaration",
"negative": "",
"test": "function(){\n\nif (true) {\n function __func(){};\n} else {\n function __func(){};\n}\n\n};\n",
"id": "S12.5_A9_T3"
}
]
}
}

View File

@ -0,0 +1,181 @@
{
"testCollection": {
"name": "12.6.1_The_do_while_Statement",
"numTests": 27,
"tests": [
{
"section": "12.6.1",
"description": "Evaluating various Expressions",
"test": "var __in__do;\n\ndo __in__do=1; while ( false );\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do!==1) {\n\t$ERROR('#1: false evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\ndo __in__do=2; while ( 0 );\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__in__do!==2) {\n\t$ERROR('#2: 0 evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\ndo __in__do=3; while ( \"\" );\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__in__do!==3) {\n\t$ERROR('#3: \"\" evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A1"
},
{
"section": "12.6.1, 13",
"description": "Also this a test on FunctionExpression",
"test": "var check = 0;\ndo { \n if(typeof(f) === \"function\"){\n check = -1; \n break; \n } else {\n check = 1; \n break; \n }\n} while(function f(){});\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (check !== 1) {\n\t$ERROR('#1: FunctionExpression within a \"do-while\" statement is allowed, but no function with the given name will appear in the global context');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A10"
},
{
"section": "12.6.1",
"description": "Checking if execution of \"do {} while({})\" passes",
"test": "do {\n var __in__do=1;\n if(__in__do)break;\n} while({});\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do !== 1) {\n\t$ERROR('#1: \"{}\" in do-while expression evaluates to true');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A11"
},
{
"section": "12.6.1",
"description": ": Checking if execution of \"do var x=1; var y =2; while (0)\" fails;",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo var x=1; var y =2; while (0);\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A12"
},
{
"section": "12.6.1, 13",
"description": "Declaring function within a \"do-while\" loop",
"negative": "SyntaxError",
"test": "\"use strict\";\ndo{\n function __func(){};\n} while(0);\n",
"id": "S12.6.1_A13_T1"
},
{
"section": "12.6.1, 13",
"description": "Declaring a function within a \"do-while\" loop that is within a strict function",
"negative": "SyntaxError",
"test": "(function(){\n\"use strict\";\ndo{\n function __func(){};\n}while(0);\n\n});\n",
"id": "S12.6.1_A13_T2"
},
{
"section": "12.6.1, 13",
"description": "Declaring a function within a \"do-while\" loop that is within a function declaration itself",
"negative": "",
"test": "function(){\n\ndo{\n function __func(){};\n}while(0);\n\n};\n",
"id": "S12.6.1_A13_T3"
},
{
"section": "12.6.1, 13",
"description": ": Using FunctionExpression \"function __func(){return 0;}\" as an Expression;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\ndo{\n var __reached = 1;\n break;\n}while(function __func(){return 0;});\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__reached !== 1) {\n\t$ERROR('#2: function expession inside of do-while expression is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A14_T1"
},
{
"section": "12.6.1",
"description": ": Using FunctionExpression \"function __func(){return 0;}()\" as an Expression;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\ndo{\n var __reached = 1;\n break;\n}while(function __func(){return 0;}());\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__reached !== 1) {\n\t$ERROR('#2: function expession inside of do-while expression is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A14_T2"
},
{
"section": "12.6.1",
"description": "Using \"{0}\" Block as an Expression",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\ndo{\n ;\n}while({0});\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A15"
},
{
"section": "12.6.1",
"description": "Evaluating Statement with error Expression",
"test": "try {\n\tdo __in__do = \"reached\"; while (abbracadabra);\n\t$ERROR('#1: \\'do __in__do = \"reached\"; while (abbracadabra)\\' lead to throwing exception');\n} catch (e) {}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do !== \"reached\") {\n\t$ERROR('#1.1: __in__do === \"reached\". Actual: __in__do ==='+ __in__do );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.6.1_A2"
},
{
"section": "12.6.1",
"description": ": Using eval \"eval(\"do __in__do=1; while (false)\")\";",
"test": "__evaluated = eval(\"do __in__do=1; while (false)\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nif (__in__do !== 1) {\n\t$ERROR('#1: __in__do === 1. Actual: __in__do ==='+ __in__do );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== 1) {\n\t$ERROR('#2: __evaluated === 1. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A3"
},
{
"section": "12.6.1, 12.8",
"description": "Using \"break\" within a \"do-while\" loop",
"test": "do {\n __in__do__before__break=\"reached\"; \n break; \n __in__do__after__break=\"where am i\";\n} while(2===1);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do__before__break !== \"reached\") {\n\t$ERROR('#1: __in__do__before__break === \"reached\". Actual: __in__do__before__break ==='+ __in__do__before__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (typeof __in__do__after__break !== \"undefined\") {\n\t$ERROR('#2: typeof __in__do__after__break === \"undefined\". Actual: typeof __in__do__after__break ==='+ typeof __in__do__after__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A4_T1"
},
{
"section": "12.6.1, 12.8",
"description": "\"break\" and VariableDeclaration within a \"do-while\" statement",
"test": "do_out : do {\n var __in__do__before__break=\"black\";\n do_in : do {\n var __in__do__IN__before__break=\"hole\";\n break do_in; \n var __in__do__IN__after__break=\"sun\";\n } while (0);\n var __in__do__after__break=\"won't you come\";\n} while(2==1);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)) {\n\t$ERROR('#1: (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)===true. Actual: (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)==='+ (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break) );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A4_T2"
},
{
"section": "12.6.1, 12.2, 12.8",
"description": "\"break\" and VariableDeclaration within a \"do-while\" statement",
"test": "do_out : do {\n var __in__do__before__break=\"once\";\n do_in : do {\n var __in__do__IN__before__break=\"in\";\n break do_out;\n var __in__do__IN__after__break=\"the\";\n } while (0);\n var __in__do__after__break=\"lifetime\";\n} while(2===1);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&!__in__do__after__break)) {\n\t$ERROR('#1: (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&!__in__do__after__break)===true. Actual: (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&!__in__do__after__break)==='+ (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&!__in__do__after__break) );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A4_T3"
},
{
"section": "12.6.1, 12.8",
"description": "\"break\" and VariableDeclaration within a \"do-while\" statement",
"test": "do_out : do {\n var __in__do__before__break=\"reached\";\n do_in : do {\n var __in__do__IN__before__break=\"reached\";\n break;\n var __in__do__IN__after__break=\"where am i\";\n } while (0);\n var __in__do__after__break=\"where am i\";\n} while(2===1);\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)) {\n\t$ERROR('#1: (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)===true. Actual: (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)==='+ (__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break) );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.1_A4_T4"
},
{
"section": "12.6.1, 12.8",
"description": "Using labeled \"break\" in order to continue a loop",
"test": "//CHECK#1\nvar i=0;\nwoohoo:{\n do{\n i++;\n if ( ! (i < 10) ) {\n break woohoo;\n $ERROR('#1.1: \"break woohoo\" must break loop');\n }\n } while ( true );\n if (i!==10) $ERROR('#1.2: i===10. Actual: i==='+ i );\n}\n",
"id": "S12.6.1_A4_T5"
},
{
"section": "12.6.1",
"description": "Using eval",
"test": "__evaluated = eval(\"do {__in__do__before__break=1; break; __in__do__after__break=2;} while(0)\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do__before__break !== 1) {\n\t$ERROR('#1: __in__do__before__break === 1. Actual: __in__do__before__break ==='+ __in__do__before__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (typeof __in__do__after__break !== \"undefined\") {\n\t$ERROR('#2: typeof __in__do__after__break === \"undefined\". Actual: typeof __in__do__after__break ==='+ typeof __in__do__after__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__evaluated !== 1) {\n\t$ERROR('#3: __evaluated === 1. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A5"
},
{
"section": "12.6.1",
"description": "Checking if execution of \"do{} while 1\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo break; while 1;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A6_T1"
},
{
"section": "12.6.1",
"description": "Checking if execution of \"do{} while 0\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo break; while 0;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A6_T2"
},
{
"section": "12.6.1",
"description": "Checking if execution of \"do{}while true\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo break; while true;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A6_T3"
},
{
"section": "12.6.1",
"description": "Checking if execution of \"do{}while false\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo break; while false;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A6_T4"
},
{
"section": "12.6.1",
"description": "Checking if execution of \"do{}while ''\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo break; while '';\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A6_T5"
},
{
"section": "12.6.1",
"description": "Checking if execution of \"do{}while 'hood'\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo break; while 'hood';\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A6_T6"
},
{
"section": "12.6.1",
"description": "Using eval",
"test": "var __condition=0\n\n__evaluated = eval(\"do eval(\\\"__condition++\\\"); while (__condition<5)\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__condition !== 5) {\n\t$ERROR('#1: The \"do-while\" statement is evaluted according to the Standard ');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== 4) {\n\t$ERROR('#2: The \"do-while\" statement returns (normal, V, empty)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.1_A7"
},
{
"section": "12.6.1",
"description": "Using eval",
"test": "var __condition = 0, __odds=0;\n\n__evaluated = eval(\"do { __condition++; if (((''+__condition/2).split('.')).length>1) continue; __odds++;} while(__condition < 10)\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__odds !== 5) {\n\t$ERROR('#1: __odds === 5. Actual: __odds ==='+ __odds );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== 4) {\n\t$ERROR('#2: __evaluated === 4. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.1_A8"
},
{
"section": "12.6.1",
"description": "Throwing system exception whithin a \"do-while\" loop",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tdo {\n\t var x = 1; \n\t abaracadabara;\n\t} while(0);\n\t$ERROR('#1: \"abbracadabra\" lead to throwing exception');\n\n} catch (e) {}\n\nif (x !== 1) {\n\t$ERROR('#1.1: x === 1. Actual: x ==='+ x );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.1_A9"
}
]
}
}

View File

@ -0,0 +1,174 @@
{
"testCollection": {
"name": "12.6.2_The_while_statement",
"numTests": 26,
"tests": [
{
"section": "12.6.2",
"description": "Evaluating various Expressions",
"test": "var __in__do;\n\nwhile ( false ) __in__do=1;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do !== undefined) {\n\t$ERROR('#1: false evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nwhile ( 0 ) __in__do=2;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__in__do !== undefined) {\n\t$ERROR('#2: 0 evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nwhile ( \"\" ) __in__do=3;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__in__do !== undefined) {\n\t$ERROR('#3: empty string evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nwhile ( null ) __in__do=4;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (__in__do !== undefined) {\n\t$ERROR('#4: null evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\nwhile ( undefined ) __in__do=35;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#5\nif (__in__do !== undefined) {\n\t$ERROR('#5: undefined evaluates to false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A1"
},
{
"section": "12.6.2, 13.2",
"description": "Testing FunctionExpression too",
"test": "var check=0;\nwhile(function f(){}){ \n if(typeof(f) === \"function\") {\n check = -1;\n break; \n } else {\n check = 1;\n break; \n }\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (check !== 1) {\n\t$ERROR('#1: FunctionExpression inside while construction expression allowed but function not declare');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A10"
},
{
"section": "12.6.2",
"description": "Checking if execution of \"while({}){}\" passes",
"test": "while({}){\n var __in__do=1;\n if(__in__do)break;\n};\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do !== 1) {\n\t$ERROR('#1: \"{}\" in while expression evaluates to true');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A11"
},
{
"section": "12.6.2",
"description": "Checking if declaring a function within a \"while\" Statement leads to an exception",
"negative": "",
"test": "while(0){\n function __func(){};\n};\n",
"id": "S12.6.2_A13_T1"
},
{
"section": "12.6.2",
"description": "Checking if declaring a function within a \"while\" Statement that is in a function call leads to an exception",
"negative": "",
"test": "(function(){\n\nwhile(0){\n function __func(){};\n};\n\n})();\n",
"id": "S12.6.2_A13_T2"
},
{
"section": "12.6.2",
"description": "Checking if declaring a function within a \"while\" Statement that is in a function body leads to an exception",
"negative": "",
"test": "function(){\n\nwhile(0){\n function __func(){};\n};\n\n};\n",
"id": "S12.6.2_A13_T3"
},
{
"section": "12.6.2",
"description": ": Using \"function __func(){return 0;}\" as an Expression;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nwhile(function __func(){return 0;}){\n var __reached = 1;\n break;\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__reached !== 1) {\n\t$ERROR('#2: function expression inside of while expression is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A14_T1"
},
{
"section": "12.6.2",
"description": "Using function call as an Expression",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nwhile(function __func(){return 1;}()){\n var __reached = 1;\n break;\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__reached !== 1) {\n\t$ERROR('#2: function expression inside of while expression is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A14_T2"
},
{
"section": "12.6.2",
"description": "Expression is \"{0}\"",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nwhile({1}){\n break ;\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A15"
},
{
"section": "12.6.2",
"description": "Evaluating Statement with error Expression",
"test": "try {\n\twhile ((function(){throw 1})()) __in__while = \"reached\"; \n\t$ERROR('#1: \\'while ((function(){throw 1})()) __in__while = \"reached\"\\' lead to throwing exception');\n} catch (e) {\n\tif (e !== 1) {\n\t\t$ERROR('#1: Exception === 1. Actual: Exception ==='+e);\n\t}\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (typeof __in__while !== \"undefined\") {\n\t$ERROR('#1.1: typeof __in__while === \"undefined\". Actual: typeof __in__while ==='+typeof __in__while);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.6.2_A2"
},
{
"section": "12.6.2",
"description": "Using eval",
"test": "var __in__do;\n\n__evaluated = eval(\"while (false) __in__do=1;\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nif (__in__do !== undefined) {\n\t$ERROR('#1: __in__do === undefined. Actual: __in__do ==='+ __in__do );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== undefined) {\n\t$ERROR('#2: __evaluated === undefined. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A3"
},
{
"section": "12.6.2, 12.8",
"description": "\"break\" within a \"while\" Statement",
"test": "while(1===1){\n __in__do__before__break=\"reached\"; \n break;\n __in__do__after__break=\"where am i\";\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do__before__break !== \"reached\") {\n\t$ERROR('#1: __in__do__before__break === \"reached\". Actual: __in__do__before__break ==='+ __in__do__before__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (typeof __in__do__after__break !== \"undefined\") {\n\t$ERROR('#2: typeof __in__do__after__break === \"undefined\". Actual: typeof __in__do__after__break ==='+ typeof __in__do__after__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A4_T1"
},
{
"section": "12.6.2",
"description": "\"break\" and VariableDeclaration within a \"while\" Statement",
"test": "do_out : while(1===1) {\n if (__in__do__before__break) break;\n var __in__do__before__break=\"black\";\n do_in : while (1) {\n var __in__do__IN__before__break=\"hole\";\n break do_in; \n var __in__do__IN__after__break=\"sun\";\n } ;\n var __in__do__after__break=\"won't you come\";\n};\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)) {\n\t$ERROR('#1: Break inside do-while is allowed as its described at standard');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A4_T2"
},
{
"section": "12.6.2, 12.2",
"description": "\"break\" and VariableDeclaration within a \"while\" Statement",
"test": "do_out : while(1===1) {\n if (__in__do__before__break) break;\n var __in__do__before__break=\"once\";\n do_in : while (1) {\n var __in__do__IN__before__break=\"in\";\n break do_out;\n var __in__do__IN__after__break=\"the\";\n } ;\n var __in__do__after__break=\"lifetime\";\n} ;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&!__in__do__after__break)) {\n\t$ERROR('#1: Break inside do-while is allowed as its described at standard');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A4_T3"
},
{
"section": "12.6.2",
"description": "\"break\" and VariableDeclaration within a \"while\" Statement",
"test": "do_out : while(1===1) {\n if(__in__do__before__break)break;\n var __in__do__before__break=\"can't\";\n do_in : while (1) {\n var __in__do__IN__before__break=\"get\";\n break;\n var __in__do__IN__after__break=\"no\";\n } ;\n var __in__do__after__break=\"Satisfaction\";\n} ;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!(__in__do__before__break&&__in__do__IN__before__break&&!__in__do__IN__after__break&&__in__do__after__break)) {\n\t$ERROR('#1: Break inside do-while is allowed as its described at standard');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.2_A4_T4"
},
{
"section": "12.6.2",
"description": "Using labeled \"break\" in order to continue a \"while\" loop",
"test": "//CHECK#1\nvar i=0;\nwoohoo:{\n while(true){\n i++;\n if ( ! (i < 10) ) {\n break woohoo;\n $ERROR('#1.1: \"break woohoo\" must break loop');\n }\n }\n if (i!==10) $ERROR('#1.2: i===10. Actual: i==='+ i );\n}\n",
"id": "S12.6.2_A4_T5"
},
{
"section": "12.6.2",
"description": "Using eval",
"test": "__evaluated = eval(\"while(1) {__in__do__before__break=1; break; __in__do__after__break=2;}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__in__do__before__break !== 1) {\n\t$ERROR('#1: __in__do__before__break === 1. Actual: __in__do__before__break ==='+ __in__do__before__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (typeof __in__do__after__break !== \"undefined\") {\n\t$ERROR('#2: typeof __in__do__after__break === \"undefined\". Actual: typeof __in__do__after__break ==='+ typeof __in__do__after__break );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__evaluated !== 1) {\n\t$ERROR('#3: __evaluated === 1. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A5"
},
{
"section": "12.6.2",
"description": "Checking if execution of \"while 1 break\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwhile 1 break;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A6_T1"
},
{
"section": "12.6.2",
"description": "Checking if execution of \"while 0 break\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwhile 0 break;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A6_T2"
},
{
"section": "12.6.2",
"description": "Checking if execution of \"while true break\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwhile true break;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A6_T3"
},
{
"section": "12.6.2",
"description": "Checking if execution of \"while false break\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwhile false break;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A6_T4"
},
{
"section": "12.6.2",
"description": "Checking if execution of \"while '' break\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwhile '' break;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A6_T5"
},
{
"section": "12.6.2",
"description": "Checking if execution of \"while 'hood' break\" fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nwhile 'hood' break;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A6_T6"
},
{
"section": "12.6.2",
"description": "using eval",
"test": "var __condition=0\n\n__evaluated = eval(\"while (__condition<5) eval(\\\"__condition++\\\");\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__condition !== 5) {\n\t$ERROR('#1: The \"while\" statement is evaluated as described in the Standard');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== 4) {\n\t$ERROR('#2: The \"while\" statement returns (normal, V, empty)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.2_A7"
},
{
"section": "12.6.2",
"description": "using eval",
"test": "var __condition = 0, __odds=0;\n\n__evaluated = eval(\"while(__condition < 10) { __condition++; if (((''+__condition/2).split('.')).length>1) continue; __odds++;}\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__odds !== 5) {\n\t$ERROR('#1: __odds === 5. Actual: __odds ==='+ __odds );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__evaluated !== 4) {\n\t$ERROR('#2: __evaluated === 4. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.2_A8"
},
{
"section": "12.6.2",
"description": "Throwing system exception inside \"while\" loop",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\twhile(x!=1) {\n\t var x = 1; \n\t abaracadabara;\n\t};\n\t$ERROR('#1: \"abbracadabra\" lead to throwing exception');\n\n} catch (e) {}\n\nif (x !== 1) {\n\t$ERROR('#1.1: while statement evaluates as is, without syntax checks');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.2_A9"
}
]
}
}

View File

@ -0,0 +1,134 @@
{
"testCollection": {
"name": "12.6.3",
"numTests": 21,
"tests": [
{
"id": "12.6.3_2-3-a-ii-1",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-1.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is an Object with value false",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var obj = { value: false };\n for (var i = 0; obj; ) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-10",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-10.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a String object (value is '1')",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var strObj = new String(\"1\");\n for (var i = 0; strObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-11",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-11.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is undefined",
"test": "assertTrue((function testcase() {\n var count = 0;\n for (var i = 0; undefined;) {\n count++;\n }\n return count === 0;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-12",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-12.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is null",
"test": "assertTrue((function testcase() {\n var count = 0;\n for (var i = 0; null;) {\n count++;\n }\n return count === 0;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-13",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-13.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a boolean (value is false)",
"test": "assertTrue((function testcase() {\n var count = 0;\n for (var i = 0; false;) {\n count++;\n }\n return count === 0;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-14",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-14.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a number (value is NaN)",
"test": "assertTrue((function testcase() {\n var count = 0;\n for (var i = 0; NaN;) {\n count++;\n }\n return count === 0;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-15",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-15.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a number (value is +0)",
"test": "assertTrue((function testcase() {\n var count = 0;\n for (var i = 0; +0;) {\n count++;\n }\n return count === 0;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-16",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-16.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a number (value is -0)",
"test": "assertTrue((function testcase() {\n var count = 0;\n for (var i = 0; -0;) {\n count++;\n }\n return count === 0;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-17",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-17.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a number (value is a positive)",
"test": "assertTrue((function testcase() {\n var accessed = false;\n for (var i = 0; 2;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-18",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-18.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a string (value is empty string)",
"test": "assertTrue((function testcase() {\n var count = 0;\n for (var i = 0; \"\";) {\n count++;\n }\n return count === 0;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-19",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-19.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a string (value is 'undefined')",
"test": "assertTrue((function testcase() {\n var accessed = false;\n for (var i = 0; \"undefined\";) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-2",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-2.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a Boolean object",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var boolObj = new Boolean(false);\n for (var i = 0; boolObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-20",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-20.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a string (value is 'null')",
"test": "assertTrue((function testcase() {\n var accessed = false;\n for (var i = 0; \"null\";) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-21",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-21.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a string (value is '1')",
"test": "assertTrue((function testcase() {\n var accessed = false;\n for (var i = 0; \"1\";) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-3",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-3.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a Number object (value is NaN)",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var numObj = new Number(NaN);\n for (var i = 0; numObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-4",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-4.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a Number object (value is +0)",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var numObj = new Number(+0);\n for (var i = 0; numObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-5",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-5.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a Number object (value is -0)",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var numObj = new Number(-0);\n for (var i = 0; numObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-6",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-6.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a Number object (value is a positive)",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var numObj = new Number(12);\n for (var i = 0; numObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-7",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-7.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a String object (value is empty string)",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var strObj = new String(\"\");\n for (var i = 0; strObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-8",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-8.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a String object (value is 'undefined')",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var strObj = new String(\"undefined\");\n for (var i = 0; strObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
},
{
"id": "12.6.3_2-3-a-ii-9",
"path": "TestCases/chapter12/12.6/12.6.3/12.6.3_2-3-a-ii-9.js",
"description": "The for Statement - (normal, V, empty) will be returned when first Expression is a String object (value is 'null')",
"test": "assertTrue((function testcase() {\n var accessed = false;\n var strObj = new String(\"null\");\n for (var i = 0; strObj;) {\n accessed = true;\n break;\n }\n return accessed;\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,259 @@
{
"testCollection": {
"name": "12.6.3_The_for_Statement",
"numTests": 39,
"tests": [
{
"section": "12.6.3",
"description": "Breaking an infinite loop by throwing exception",
"test": "var __in__for = 0;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor (;;){\n //__in__for++;\n if(++__in__for>100)throw 1;\n}\n} catch (e) {\n\tif (e !== 1) {\n\t\t$ERROR('#1: for {;;} is admitted and leads to infinite loop');\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__in__for !== 101) {\n\t$ERROR('#2: __in__for === 101. Actual: __in__for ==='+ __in__for );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.3_A1"
},
{
"section": "12.6.3",
"description": "Checking if executing nested \"var-loops\" nine blocks depth is evaluated properly",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\t__in__deepest__loop=__in__deepest__loop;\n} catch (e) {\n\t$ERROR('#1: \"__in__deepest__loop=__in__deepest__loop\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry {\n\tindex0=index0;\n} catch (e) {\n\t$ERROR('#2: \"index0=index0\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\ntry {\n\tindex1=index1;\n} catch (e) {\n\t$ERROR('#3: \"index1=index1\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\ntry {\n\tindex4=index4;\n} catch (e) {\n\t$ERROR('#4: \"index4=index4\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#5\ntry {\n\tindex5=index5;\n} catch (e) {\n\t$ERROR('#4: \"index5=index5\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#6\ntry {\n\tindex7=index7;\n} catch (e) {\n\t$ERROR('#6: \"index7=index7\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#7\ntry {\n\tindex8=index8;\n} catch (e) {\n\t$ERROR('#7: \"index8=index8\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nfor( var index0=0; index0<=1; index0++) {\n\tfor(var index1=0; index1<=index0; index1++) {\n\t\tfor( index2=0; index2<=index1; index2++) {\n\t\t\tfor( index3=0; index3<=index2; index3++) {\n\t\t\t\tfor(var index4=0; index4<=index3; index4++) {\n\t\t\t\t\tfor(var index5=0; index5<=index4; index5++) {\n\t\t\t\t\t\tfor( index6=0; index6<=index5; index6++) {\n\t\t\t\t\t\t\tfor(var index7=0; index7<=index6; index7++) {\n\t\t\t\t\t\t\t\tfor(var index8=0; index8<=index1; index8++) {\n\t\t\t\t\t\t\t\t\tvar __in__deepest__loop;\n\t\t\t\t\t\t\t\t\t__str+=\"\"+index0+index1+index2+index3+index4+index5+index6+index7+index8+'\\n';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str!== \"000000000\\n100000000\\n110000000\\n110000001\\n111000000\\n111000001\\n111100000\\n111100001\\n111110000\\n111110001\\n111111000\\n111111001\\n111111100\\n111111101\\n111111110\\n111111111\\n\") {\n\t$ERROR('#2: __str === \"000000000\\\\n100000000\\\\n110000000\\\\n110000001\\\\n111000000\\\\n111000001\\\\n111100000\\\\n111100001\\\\n111110000\\\\n111110001\\\\n111111000\\\\n111111001\\\\n111111100\\\\n111111101\\\\n111111110\\\\n111111111\\\\n\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A10.1"
},
{
"section": "12.6.3",
"description": "Checking if executing nested \"var-loops\" nine blocks depth is evaluated properly",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\ntry {\n\t__in__deepest__loop=__in__deepest__loop;\n} catch (e) {\n\t$ERROR('#1: \"__in__deepest__loop=__in__deepest__loop\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nfor( index0=0; index0<=1; index0++) {\n\tfor( index1=0; index1<=index0; index1++) {\n\t\tfor( index2=0; index2<=index1; index2++) {\n\t\t\tfor( index3=0; index3<=index2; index3++) {\n\t\t\t\tfor( index4=0; index4<=index3; index4++) {\n\t\t\t\t\tfor( index5=0; index5<=index4; index5++) {\n\t\t\t\t\t\tfor( index6=0; index6<=index5; index6++) {\n\t\t\t\t\t\t\tfor( index7=0; index7<=index6; index7++) {\n\t\t\t\t\t\t\t\tfor( index8=0; index8<=index1; index8++) {\n\t\t\t\t\t\t\t\t\tvar __in__deepest__loop;\n\t\t\t\t\t\t\t\t\t__str+=\"\"+index0+index1+index2+index3+index4+index5+index6+index7+index8+'\\n';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str!== \"000000000\\n100000000\\n110000000\\n110000001\\n111000000\\n111000001\\n111100000\\n111100001\\n111110000\\n111110001\\n111111000\\n111111001\\n111111100\\n111111101\\n111111110\\n111111111\\n\") {\n\t$ERROR('#2: __str === \"000000000\\\\n100000000\\\\n110000000\\\\n110000001\\\\n111000000\\\\n111000001\\\\n111100000\\\\n111100001\\\\n111110000\\\\n111110001\\\\n111111000\\\\n111111001\\\\n111111100\\\\n111111101\\\\n111111110\\\\n111111111\\\\n\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A10"
},
{
"section": "12.6.3",
"description": "Using \"continue\" in order to continue a loop",
"test": "__str=\"\"\n\nfor(var index=0; index<10; index+=1) {\n\tif (index<5)continue;\n\t__str+=index;\n}\n\nif (__str!==\"56789\") {\n\t$ERROR('#1: __str === \"56789\". Actual: __str ==='+ __str );\n}\n",
"id": "S12.6.3_A11.1_T1"
},
{
"section": "12.6.3",
"description": "Embedded loops",
"test": "__str=\"\";\n\nouter : for(var index=0; index<4; index+=1) {\n nested : for(var index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n == 6)continue nested;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__str !== \"001011202122303133\") {\n\t$ERROR('#1: __str === \"001011202122303133\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(var index=0; index<4; index+=1) {\n nested : for(var index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n == 6)continue outer;\n\t__str+=\"\"+index+index_n;\n } \n}\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str !== \"0010112021223031\") {\n\t$ERROR('#2: __str === \"0010112021223031\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(var index=0; index<4; index+=1) {\n nested : for(var index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n == 6)continue ;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__str !== \"001011202122303133\") {\n\t$ERROR('#3: __str === \"001011202122303133\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A11.1_T2"
},
{
"section": "12.6.3",
"description": "Trying to continue non-existent label",
"negative": "",
"test": "__str=\"\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nouter:for(var index=0;index<4;index+=1){\n nested:for(var index_n=0;index_n<=index;index_n++){\n if(index*index_n == 6)continue nonexist;\n __str+=\"\"+index+index_n;\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A11.1_T3"
},
{
"section": "12.6.3",
"description": "Simple test of continue loop with using \"continue\"",
"test": "__str=\"\"\n\nfor(index=0; index<10; index+=1) {\n\tif (index<5)continue;\n\t__str+=index;\n}\n\nif (__str!==\"56789\") {\n\t$ERROR('#1: __str === \"56789\". Actual: __str ==='+ __str );\n}\n",
"id": "S12.6.3_A11_T1"
},
{
"section": "12.6.3",
"description": "Embedded loops",
"test": "__str=\"\";\n\nouter : for(index=0; index<4; index+=1) {\n nested : for(index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n == 6)continue nested;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__str !== \"001011202122303133\") {\n\t$ERROR('#1: __str === \"001011202122303133\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(index=0; index<4; index+=1) {\n nested : for(index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n == 6)continue outer;\n\t__str+=\"\"+index+index_n;\n } \n}\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str !== \"0010112021223031\") {\n\t$ERROR('#2: __str === \"0010112021223031\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(index=0; index<4; index+=1) {\n nested : for(index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n == 6)continue ;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__str !== \"001011202122303133\") {\n\t$ERROR('#3: __str === \"001011202122303133\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A11_T2"
},
{
"section": "12.6.3",
"description": "Trying to continue non-existent label",
"negative": "",
"test": "__str=\"\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nouter:for(index=0;index<4;index+=1){\n nested:for(index_n=0;index_n<=index;index_n++){\n if(index*index_n == 6)continue nonexist;\n __str+=\"\"+index+index_n;\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A11_T3"
},
{
"section": "12.6.3",
"description": "Breaking a loop with \"break\"",
"test": "__str=\"\"\n\nfor(var index=0; index<10; index+=1) {\n\tif (index>5)break;\n\t__str+=index;\n}\n\nif (__str!==\"012345\") {\n\t$ERROR('#1: __str === \"012345\". Actual: __str ==='+ __str );\n}\n",
"id": "S12.6.3_A12.1_T1"
},
{
"section": "12.6.3",
"description": "Embedded loops",
"test": "__str=\"\";\n\nouter : for(var index=0; index<4; index+=1) {\n nested : for(var index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n >= 4)break nested;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__str !== \"00101120213031\") {\n\t$ERROR('#1: __str === \"00101120213031\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(var index=0; index<4; index+=1) {\n nested : for(var index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n >= 4)break outer;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str !== \"0010112021\") {\n\t$ERROR('#2: __str === \"0010112021\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(var index=0; index<4; index+=1) {\n nested : for(var index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n >= 4)break ;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__str !== \"00101120213031\") {\n\t$ERROR('#3: __str === \"00101120213031\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A12.1_T2"
},
{
"section": "12.6.3",
"description": "Trying to break non-existent label",
"negative": "",
"test": "__str=\"\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nouter:for(var index=0;index<4;index+=1){\n nested:for(var index_n=0;index_n<=index;index_n++){\n if(index*index_n >= 4)break nonexist;\n __str+=\"\"+index+index_n;\n }\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A12.1_T3"
},
{
"section": "12.6.3",
"description": "Breaking a loop with \"break\"",
"test": "__str=\"\"\n\nfor(index=0; index<10; index+=1) {\n\tif (index>5)break;\n\t__str+=index;\n}\n\nif (__str!==\"012345\") {\n\t$ERROR('#1:__str === \"012345\". Actual: __str ==='+__str );\n}\n",
"id": "S12.6.3_A12_T1"
},
{
"section": "12.6.3",
"description": "Embedded loops",
"test": "__str=\"\";\n\nouter : for(index=0; index<4; index+=1) {\n nested : for(index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n >= 4)break nested;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__str !== \"00101120213031\") {\n\t$ERROR('#1: __str === \"00101120213031\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(index=0; index<4; index+=1) {\n nested : for(index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n >= 4)break outer;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str !== \"0010112021\") {\n\t$ERROR('#2: __str === \"0010112021\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n__str=\"\";\n\nouter : for(index=0; index<4; index+=1) {\n nested : for(index_n=0; index_n<=index; index_n++) {\n\tif (index*index_n >= 4)break ;\n\t__str+=\"\"+index+index_n;\n } \n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (__str !== \"00101120213031\") {\n\t$ERROR('#3: __str === \"00101120213031\". Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A12_T2"
},
{
"section": "12.6.3",
"description": "Trying to break non-existent label",
"negative": "",
"test": "__str=\"\";\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nouter:for(index=0;index<4;index+=1){\n nested:for(index_n=0;index_n<=index;index_n++){\n if(index*index_n >= 4)break nonexist;\n __str+=\"\"+index+index_n;\n }\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A12_T3"
},
{
"section": "12.6.3",
"description": "Declaring variable in \"for\" ExpressionNoIn",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tindex = index;\n} catch (e) {\n\t$ERROR('#1: VariableDeclaration in \"var VariableDeclarationListNoIn\" of for IterationStatement is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\nfor(var index=0; index<6; index++) {\n\t;\n}\n",
"id": "S12.6.3_A13"
},
{
"section": "12.6.3",
"description": "Using +,*,/, as the second Expression",
"test": "//CHECK#1\nfor(var i=0;i<10;i++){}\nif (i!==10)\t$ERROR('#1: i === 10. Actual: i ==='+ i );\n\n//CHECK#2\nvar j=0;\nfor(var i=1;i<10;i*=2){\n\tj++;\n}\nif (i!==16) $ERROR('#2.1: i === 16. Actual: i ==='+ i );\nif (j!==4) $ERROR('#2.2: j === 4. Actual: j ==='+ j );\n\n//CHECK#3\nvar j=0;\nfor(var i=16;i>1;i=i/2){\n j++;\n}\nif (i!==1) $ERROR('#3.1: i === 1. Actual: i ==='+ i );\nif (j!==4) $ERROR('#3.2: j === 4. Actual: j ==='+ j );\n\n//CHECK#4\nvar j=0;\nfor(var i=10;i>1;i--){\n j++;\n}\nif (i!==1) $ERROR('#4.1: i === 1. Actual: i ==='+ i );\nif (j!==9) $ERROR('#4.2: j === 9. Actual: j ==='+ j );\n\n//CHECK#5\nvar j=0;\nfor(var i=2;i<10;i*=i){\n j++;\n}\nif (i!==16) $ERROR('#5.1: i === 16. Actual: i ==='+ i );\nif (j!==2) $ERROR('#5.2: j === 2. Actual: j ==='+ j );\n",
"id": "S12.6.3_A14"
},
{
"section": "12.6.3",
"description": "Statement must be evaluated before second Expression is evaluated",
"test": "//CHECK#1\nfor(var i=0;i<10;i++){\n\ti*=2;\n break;\t\n}\nif (i!==0) $ERROR('#1: i === 0. Actual: i ==='+ i );\n\n//CHECK#2\nfor(var i=0;i<10;i++){\n i*=2;\n if (i===3) $ERROR('#2: i !== 3');\n}\n\n",
"id": "S12.6.3_A15"
},
{
"section": "12.6.3",
"description": "Using \"(function(){throw \"NoInExpression\"})()\" as ExpressionNoIn",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor((function(){throw \"NoInExpression\"})(); ;(function(){throw \"SecondExpression\"})()) {\n\t\tthrow \"Statement\";\n\t}\n\t$ERROR('#1: (function(){throw \"NoInExpression\"})() lead to throwing exception');\n} catch (e) {\n\tif (e !== \"NoInExpression\") {\n\t\t$ERROR('#2: When for (ExpressionNoIn ; ; Expression) Statement is evaluated NoInExpression evaluates first');\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A2.1"
},
{
"section": "12.6.3",
"description": "Using \"(function(){throw \"NoInExpression\"})()\" as ExpressionNoIn",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor((function(){throw \"NoInExpression\"})();;) {\n\t\tthrow \"Statement\";\n\t}\n\t$ERROR('#1: (function(){throw \"NoInExpression\"})() lead to throwing exception');\n} catch (e) {\n\tif (e !== \"NoInExpression\") {\n\t\t$ERROR('#1: When for (ExpressionNoIn ; ; ) Statement is evaluated NoInExpression evaluates first');\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A2.2"
},
{
"section": "12.6.3",
"description": "Using \"(function(){throw \"NoInExpression\"})()\" as ExpressionNoIn",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor((function(){throw \"NoInExpression\";})(); (function(){throw \"FirstExpression\";})(); (function(){throw \"SecondExpression\";})()) {\n\t\tvar in_for = \"reached\";\n\t}\n\t$ERROR('#1: (function(){throw \"NoInExpression\";})() lead to throwing exception');\n} catch (e) {\n\tif (e !== \"NoInExpression\") {\n\t\t$ERROR('#1: When for (ExpressionNoIn ; Expression ; Expression) Statement is evaluated ExpressionNoIn evaluates first');\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (in_for !== undefined) {\n\t$ERROR('#2: in_for === undefined. Actual: in_for ==='+ in_for );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A2"
},
{
"section": "12.6.3",
"description": "Using \"(function(){throw \"FirstExpression\"})()\" as FirstExpression",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor((function(){__in__NotInExpression__ = \"checked\";__in__NotInExpression__2 = \"passed\";})(); (function(){throw \"FirstExpression\"})(); (function(){throw \"SecondExpression\"})()) {\n\t\t__in__for=\"reached\";\n\t}\n\t$ERROR('#1: (function(){throw \"SecondExpression\"} lead to throwing exception');\n} catch (e) {\n\tif (e !== \"FirstExpression\") {\n\t\t$ERROR('#1: When for (ExpressionNoIn ; FirstExpression ; SecondExpression) Statement is evaluated first evaluates ExpressionNoIn then FirstExpression');\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif ((__in__NotInExpression__ !== \"checked\")&(__in__NotInExpression__2!==\"passed\")) {\n\t$ERROR('#2: (__in__NotInExpression__ === \"checked\")&(__in__NotInExpression__2===\"passed\")');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (typeof __in__for !== \"undefined\") {\n\t$ERROR('#3: typeof __in__for === \"undefined\". Actual: typeof __in__for ==='+ typeof __in__for );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A3"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for (var a in arr;1;){}\" fails;",
"negative": "",
"test": "arr = [1,2,3,4,5];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor (var a in arr;1;){\n break;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.3_A4.1"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for (a in arr;1;){}\" fails;",
"negative": "",
"test": "arr = [1,2,3,4,5];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor (a in arr;1;){\n break;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.3_A4_T1"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for (1 in arr;1;){}\" fails;",
"negative": "",
"test": "arr = [1,2,3,4,5];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(1 in arr;1;) {\n break;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.6.3_A4_T2"
},
{
"section": "12.6.3",
"description": ": Using eval \"for(eval(\"i in arr\");1;)\";",
"test": "arr = [1,2,3,4,5];\ni = 1;\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor(eval(\"i in arr\");1;) {break;};\t\n} catch (e) {\t\n\t\t$ERROR('#1.1: for(eval(\"i in arr\");1;) {break;}; does not lead to throwing exception');\t\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry {\n\tfor(eval(\"var i = 1 in arr\");1;) {break;};\t\n} catch (e) {\t\n\t\t$ERROR('#2.1: for(eval(\"var i = 1 in arr\");1;) {break;}; does not lead to throwing exception');\t\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\ntry {\n\tfor(eval(\"1 in arr\");1;) {break;};\n} catch (e) {\t\n\t\t$ERROR('#3.1: for(eval(\"1 in arr\");1;) {break;}; does not lead to throwing exception');\t\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A5"
},
{
"section": "12.6.3",
"description": ": Using \"(function(){throw \"SecondExpression\";})()\" as an Expression;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor(;;(function(){throw \"SecondExpression\";})()){\n var __in__for = \"reached\";\n }\n $ERROR('#1: (function(){throw \"SecondExpression\"}() lead to throwing exception');\n} catch (e) {\n\tif (e !== \"SecondExpression\") {\n\t\t$ERROR('#1: When for ( ; ; Expression) Statement is evaluated Statement evaluates first then Expression evaluates');\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__in__for !== \"reached\") {\n\t$ERROR('#2: __in__for === \"reached\". Actual: __in__for ==='+ __in__for );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A6"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(var index=0; index<10; index++; index--)\" fails;",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(var index=0; index<10; index++; index--);\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A7.1_T1"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(var index=0; index<10; index+=4; index++; index--)\" fails ;",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(var index=0; index<10; index+=4; index++; index--) ;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A7.1_T2"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(index=0; index<10; index++; index--)\" fails;",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(index=0; index<10; index++; index--) ;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A7_T1"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(index=0; index<10; index+=4; index++; index--)\" fails ;",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(index=0; index<10; index+=4; index++; index--) ;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A7_T2"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(var index=0; index<100; {index++; index*2;}) { arr.add(\"\"+index);}\" fails;",
"negative": "",
"test": "var arr = [];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(var index=0; index<100; {index++; index*2;}) {\tarr.add(\"\"+index);};\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A8.1_T1"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(var index=0; {index++;index<100;}; index*2;) { arr.add(\"\"+index);}\" fails;",
"negative": "",
"test": "var arr = [];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(var index=0; {index++;index<100;}; index*2;) {\tarr.add(\"\"+index);};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A8.1_T2"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for({var index=0; index+=1;} index++<=10; index*2;) { arr.add(\"\"+index);}\" fails;",
"negative": "",
"test": "var arr = [];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nfor({var index=0; index+=1;} index++<=10; index*2;) {\tarr.add(\"\"+index);};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A8.1_T3"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(index=0; index<100; {index++; index*2;}) { arr.add(\"\"+index);}\" fails;",
"negative": "",
"test": "var arr = [];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(index=0; index<100; {index++; index*2;}) {\tarr.add(\"\"+index);};\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A8_T1"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for(index=0; {index++;index<100;}; index*2;) { arr.add(\"\"+index);}\" fails;",
"negative": "",
"test": "var arr = [];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor(index=0; {index++;index<100;}; index*2;) {\tarr.add(\"\"+index);};\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A8_T2"
},
{
"section": "12.6.3",
"description": ": Checking if execution of \"for({index=0; index+=1;} index++<=10; index*2;) { arr.add(\"\"+index);}\" fails;",
"negative": "",
"test": "var arr = [];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nfor({index=0; index+=1;} index++<=10; index*2;) {\tarr.add(\"\"+index);};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.3_A8_T3"
},
{
"section": "12.6.3",
"description": "Using eval",
"test": "supreme=5;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#\ntry {\n\tvar __evaluated = eval(\"for(count=0;;) {if (count===supreme)break;else count++; }\");\n\tif (__evaluated !== 4) {\n\t\t$ERROR('#1: __evaluated === 4. Actual: __evaluated ==='+ __evaluated );\n\t}\n} catch (e) {\n\t$ERROR('#1: var __evaluated = eval(\"for(count=0;;) {if (count===supreme)break;else count++; }\"); does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A9.1"
},
{
"section": "12.6.3",
"description": "Using eval",
"test": "supreme=5;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#\ntry {\n\tvar __evaluated = eval(\"for(var count=0;;) {if (count===supreme)break;else count++; }\");\n\tif (__evaluated !== 4) {\n\t\t$ERROR('#1: __evaluated === 4. Actual: __evaluated ==='+ __evaluated );\n\t}\n} catch (e) {\n\t$ERROR('#1: var __evaluated = eval(\"for(var count=0;;) {if (count===supreme)break;else count++; }\"); does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.3_A9"
}
]
}
}

View File

@ -0,0 +1,21 @@
{
"testCollection": {
"name": "12.6.4",
"numTests": 2,
"tests": [
{
"id": "12.6.4-1",
"path": "TestCases/chapter12/12.6/12.6.4/12.6.4-1.js",
"description": "The for-in Statement - a property name must not be visited more than once in any enumeration.",
"test": "assertTrue((function testcase() {\n var obj = { prop1: \"abc\", prop2: \"bbc\", prop3: \"cnn\" };\n\n var countProp1 = 0;\n var countProp2 = 0;\n var countProp3 = 0;\n\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n if (p === \"prop1\") {\n countProp1++;\n }\n if (p === \"prop2\") {\n countProp2++;\n }\n if (p === \"prop3\") {\n countProp3++;\n }\n }\n }\n return countProp1 === 1 && countProp2 === 1 && countProp3 === 1;\n }).call(this));\n"
},
{
"id": "12.6.4-2",
"path": "TestCases/chapter12/12.6/12.6.4/12.6.4-2.js",
"description": "The for-in Statement - the values of [[Enumerable]] attributes are not considered when determining if a property of a prototype object is shadowed by a previous object on the prototype chain",
"test": "assertTrue((function testcase() {\n var obj = {};\n\n var proto = {};\n\n Object.defineProperty(proto, \"prop\", {\n value: \"inheritedValue\",\n enumerable: false,\n configurable: true,\n writable: true\n });\n\n var ConstructFun = function () { };\n ConstructFun.prototype = proto;\n\n var child = new ConstructFun();\n\n Object.defineProperty(child, \"prop1\", {\n value: \"overridedValue1\",\n enumerable: false\n });\n Object.defineProperty(child, \"prop2\", {\n value: \"overridedValue2\",\n enumerable: true\n });\n var accessedProp1 = false;\n var accessedProp2 = false;\n\n for (var p in child) {\n if (child.hasOwnProperty(p)) {\n if (p === \"prop1\") {\n accessedProp1 = true;\n }\n if (p === \"prop2\") {\n accessedProp2 = true;\n }\n }\n }\n return !accessedProp1 && accessedProp2 && child.prop1 === \"overridedValue1\" && child.prop2 === \"overridedValue2\";\n }).call(this));\n",
"precondition": "(fnExists(Object.defineProperty))"
}
]
}
}

View File

@ -0,0 +1,120 @@
{
"testCollection": {
"name": "12.6.4_The_for_in_Statement",
"numTests": 18,
"tests": [
{
"section": "12.6.4",
"description": "Checking if execution of \"for(key in undefined)\" passes",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n\tfor(__key in undefined){\n\t var key=__key;\n\t};\n} catch (e) {\n\t$ERROR('#1: \"for(key in undefined){}\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (key!==undefined) {\n\t$ERROR('#2: key === undefined. Actual: key === '+key);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.6.4_A1"
},
{
"section": "12.6.4",
"description": "Declaring function within a \"for-in\" Statement",
"negative": "",
"test": "for(x in this){\n function __func(){};\n};\n",
"id": "S12.6.4_A13_T1"
},
{
"section": "12.6.4",
"description": "Declaring function within a \"for-in\" Statement that is within a function call",
"negative": "",
"test": "(function(){\n\nfor(x in this){\n function __func(){};\n};\n\n})();\n",
"id": "S12.6.4_A13_T2"
},
{
"section": "12.6.4",
"description": "Declaring function within a \"for-in\" Statement that is within function declaration",
"negative": "",
"test": "function(){\n\nfor(x in this){\n function __func(){};\n};\n\n};\n",
"id": "S12.6.4_A13_T3"
},
{
"section": "12.6.4",
"description": ": Using \"function __func(){return 0;}\" as Expession;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nfor(x in function __func(){return 0;}){\n if (x==\"prototype\") \n var __reached = 1;\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__reached !== 1) {\n\t$ERROR('#2: function expession inside of for-in expression is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.4_A14_T1"
},
{
"section": "12.6.4",
"description": ": Using \"function __func(){return {a:1};}()\" as Expession;",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nfor(x in function __func(){return {a:1};}()){\n var __reached = x;\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__reached !== \"a\") {\n\t$ERROR('#2: function expession inside of for-in expression allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.4_A14_T2"
},
{
"section": "12.6.4",
"description": "Using block within \"for-in\" Expression",
"negative": "",
"test": "var __arr=[1,2,3];\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#\nfor(x in {__arr}){\n break ;\n};\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.4_A15"
},
{
"section": "12.6.4",
"description": "Checking if execution of \"for(key in null)\" passes",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#\ntry {\n\tfor(__key in null){\n\t var key=__key;\n\t};\n} catch (e) {\n\t$ERROR('#1: \"for(__key in null){}\" does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (key!==undefined) {\n\t$ERROR('#2: key === undefined. Actual: key ==='+key);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.4_A2"
},
{
"section": "12.6.4",
"description": "Using an array as an Expression is appropriate. Here Expression is an array of numbers",
"test": "__str=\"\";\n\n__evaluated = eval(\"for(var ind in (arr=[2,1,4,3]))__str+=arr[ind]\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__evaluated !== __str) {\n\t$ERROR('#1: __evaluated === __str. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (!( (__str.indexOf(\"2\")!==-1)&&(__str.indexOf(\"1\")!==-1)&&(__str.indexOf(\"4\")!==-1)&&(__str.indexOf(\"3\")!==-1) )) {\n\t$ERROR('#2: (__str.indexOf(\"2\")!==-1)&&(__str.indexOf(\"1\")!==-1)&&(__str.indexOf(\"4\")!==-1)&&(__str.indexOf(\"3\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.4_A3.1"
},
{
"section": "12.6.4",
"description": "Using an array as an Expression is appropriate. Here Expression is an array of numbers. Eval is used",
"test": "__str=\"\";\n\n__evaluated = eval(\"for(ind in (arr=[2,1,4,3]))__str+=arr[ind]\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__evaluated !== __str) {\n\t$ERROR('#1: __evaluated === __str. Actual: __evaluated ==='+ __evaluated );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (!( (__str.indexOf(\"2\")!==-1)&&(__str.indexOf(\"1\")!==-1)&&(__str.indexOf(\"4\")!==-1)&&(__str.indexOf(\"3\")!==-1) )) {\n\t$ERROR('#2: (__str.indexOf(\"2\")!==-1)&&(__str.indexOf(\"1\")!==-1)&&(__str.indexOf(\"4\")!==-1)&&(__str.indexOf(\"3\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n",
"id": "S12.6.4_A3"
},
{
"section": "12.6.4",
"description": "Using Object as an Expression is appropriate. Eval is used",
"test": "__str=\"\";\n\n__evaluated = eval(\"for(var ind in (hash={2:'b',1:'a',4:'d',3:'c'}))__str+=hash[ind]\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ( !( (__evaluated.indexOf(\"a\")!==-1)& (__evaluated.indexOf(\"b\")!==-1)& (__evaluated.indexOf(\"c\")!==-1)&(__evaluated.indexOf(\"d\")!==-1) ) ) {\n\t$ERROR('#1: (__evaluated.indexOf(\"a\")!==-1)& (__evaluated.indexOf(\"b\")!==-1)& (__evaluated.indexOf(\"c\")!==-1)&(__evaluated.indexOf(\"d\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str !== __evaluated) {\n\t$ERROR('#2: __str === __evaluated. Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n\n",
"id": "S12.6.4_A4.1"
},
{
"section": "12.6.4",
"description": "Using Object as an Expression is appropriate. Eval is used",
"test": "__str=\"\";\n\n__evaluated = eval(\"for(ind in (hash={2:'b',1:'a',4:'d',3:'c'}))__str+=hash[ind]\");\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ( !( (__evaluated.indexOf(\"a\")!==-1)& (__evaluated.indexOf(\"b\")!==-1)& (__evaluated.indexOf(\"c\")!==-1)&(__evaluated.indexOf(\"d\")!==-1) ) ) {\n\t$ERROR('#1: (__evaluated.indexOf(\"a\")!==-1)& (__evaluated.indexOf(\"b\")!==-1)& (__evaluated.indexOf(\"c\")!==-1)&(__evaluated.indexOf(\"d\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__str !== __evaluated) {\n\t$ERROR('#2: __str === __evaluated. Actual: __str ==='+ __str );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n\n\n",
"id": "S12.6.4_A4"
},
{
"section": "12.6.4",
"description": "Using hierarchical Object as an Expression is appropriate. The depth is two",
"test": "__hash__map={a:{aa:1,ab:2,ac:3,ad:4},b:{ba:1,bb:2,bc:3,bd:4},c:{ca:1,cb:2,cc:3,cd:4},d:{da:1,db:2,dc:3,dd:4}};\n\n__arr = \"\";\n\nfor(var __key in __hash__map){\n for (var __ind in __hash__map[__key]){\n __arr+=(\"\" + __ind + __hash__map[__key][__ind]);\n }\n}\n\nif(!(\n(__arr.indexOf(\"aa1\")!==-1)&\n(__arr.indexOf(\"ab2\")!==-1)&\n(__arr.indexOf(\"ac3\")!==-1)&\n(__arr.indexOf(\"ad4\")!==-1)&\n(__arr.indexOf(\"ba1\")!==-1)&\n(__arr.indexOf(\"bb2\")!==-1)&\n(__arr.indexOf(\"bc3\")!==-1)&\n(__arr.indexOf(\"bd4\")!==-1)&\n(__arr.indexOf(\"ca1\")!==-1)&\n(__arr.indexOf(\"cb2\")!==-1)&\n(__arr.indexOf(\"cc3\")!==-1)&\n(__arr.indexOf(\"cd4\")!==-1)&\n(__arr.indexOf(\"da1\")!==-1)&\n(__arr.indexOf(\"db2\")!==-1)&\n(__arr.indexOf(\"dc3\")!==-1)&\n(__arr.indexOf(\"dd4\")!==-1)\n)) $ERROR('#1: The nested for-in Statement applied to hierarchial object works properly as described in the Standard');\n\n\n\n",
"id": "S12.6.4_A5.1"
},
{
"section": "12.6.4",
"description": "Using hierarchical Object as an Expression is appropriate. The depth is two",
"test": "__hash__map={a:{aa:1,ab:2,ac:3,ad:4},b:{ba:1,bb:2,bc:3,bd:4},c:{ca:1,cb:2,cc:3,cd:4},d:{da:1,db:2,dc:3,dd:4}};\n\n__arr = \"\";\n\nfor(__key in __hash__map){\n for (__ind in __hash__map[__key]){\n __arr+=(\"\" + __ind + __hash__map[__key][__ind]);\n }\n}\n\nif(!(\n(__arr.indexOf(\"aa1\")!==-1)&\n(__arr.indexOf(\"ab2\")!==-1)&\n(__arr.indexOf(\"ac3\")!==-1)&\n(__arr.indexOf(\"ad4\")!==-1)&\n(__arr.indexOf(\"ba1\")!==-1)&\n(__arr.indexOf(\"bb2\")!==-1)&\n(__arr.indexOf(\"bc3\")!==-1)&\n(__arr.indexOf(\"bd4\")!==-1)&\n(__arr.indexOf(\"ca1\")!==-1)&\n(__arr.indexOf(\"cb2\")!==-1)&\n(__arr.indexOf(\"cc3\")!==-1)&\n(__arr.indexOf(\"cd4\")!==-1)&\n(__arr.indexOf(\"da1\")!==-1)&\n(__arr.indexOf(\"db2\")!==-1)&\n(__arr.indexOf(\"dc3\")!==-1)&\n(__arr.indexOf(\"dd4\")!==-1)\n)) $ERROR('#1: The nested for-in Statement applied to hierarchial object works properly as described in the Standard');\n\n\n\n",
"id": "S12.6.4_A5"
},
{
"section": "12.6.4",
"description": "Using Object with custom prototype as an Expression is appropriate. The prototype is \"{feat:2,hint:\"protohint\"}\"",
"test": "function FACTORY(){this.prop=1;this.hint=\"hinted\"};\n\nFACTORY.prototype = {feat:2,hint:\"protohint\"};\n\nvar __instance = new FACTORY;\n\n__accum=\"\";\n\nfor (var key in __instance){\n\t__accum+=(key + __instance[key]);\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!((__accum.indexOf(\"prop1\")!==-1)&&(__accum.indexOf(\"feat2\")!==-1)&&(__accum.indexOf(\"hinthinted\")!==-1))) {\n\t$ERROR('#1: (__accum.indexOf(\"prop1\")!==-1)&&(__accum.indexOf(\"feat2\")!==-1)&&(__accum.indexOf(\"hinthinted\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__accum.indexOf(\"hintprotohint\")!==-1) {\n\t$ERROR('#2: __accum.indexOf(\"hintprotohint\") === -1. Actual: __accum.indexOf(\"hintprotohint\") ==='+ __accum.indexOf(\"hintprotohint\") );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.4_A6.1"
},
{
"section": "12.6.4",
"description": "Using Object with custom prototype as an Expression is appropriate. The prototype is \"{feat:2,hint:\"protohint\"}\"",
"test": "function FACTORY(){this.prop=1;this.hint=\"hinted\"};\n\nFACTORY.prototype = {feat:2,hint:\"protohint\"};\n\nvar __instance = new FACTORY;\n\n__accum=\"\";\n\nfor (key in __instance){\n\t__accum+=(key + __instance[key]);\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!((__accum.indexOf(\"prop1\")!==-1)&&(__accum.indexOf(\"feat2\")!==-1)&&(__accum.indexOf(\"hinthinted\")!==-1))) {\n\t$ERROR('#1: (__accum.indexOf(\"prop1\")!==-1)&&(__accum.indexOf(\"feat2\")!==-1)&&(__accum.indexOf(\"hinthinted\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__accum.indexOf(\"hintprotohint\")!==-1) {\n\t$ERROR('#2: __accum.indexOf(\"hintprotohint\") === -1. Actual: __accum.indexOf(\"hintprotohint\") ==='+ __accum.indexOf(\"hintprotohint\") );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.6.4_A6"
},
{
"section": "12.6.4",
"description": "Checking \"for (LeftHandSideExpression in Expression) Statement\" case",
"test": "__obj={aa:1,ba:2,ca:3};\n\n__accum=\"\";\n\nfor (__key in __obj){\n\t\n erasator_T_1000(__obj,\"b\");\n \n\t__accum+=(__key+__obj[__key]);\n\t\n}\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!((__accum.indexOf(\"aa1\")!==-1)&&(__accum.indexOf(\"ca3\")!==-1))) {\n\t$ERROR('#1: (__accum.indexOf(\"aa1\")!==-1)&&(__accum.indexOf(\"ca3\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__accum.indexOf(\"ba2\")!==-1) {\n\t$ERROR('#2: __accum.indexOf(\"ba2\") === -1. Actual: __accum.indexOf(\"ba2\") ==='+ __accum.indexOf(\"ba2\") );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n// erasator is the hash map terminator\nfunction erasator_T_1000(hash_map, charactr){\n\tfor (key in hash_map){\n\t\tif (key.indexOf(charactr)===0) {\n\t\t\tdelete hash_map[key];\n\t\t};\n\t}\n}\n",
"id": "S12.6.4_A7_T1"
},
{
"section": "12.6.4",
"description": "Checking \"for (var VariableDeclarationNoIn in Expression) Statement\" case",
"test": "__obj={aa:1,ba:2,ca:3};\n\n__accum=\"\";\n\nfor (var __key in __obj){\n\t\n erasator_T_1000(__obj,\"b\");\n \n\t__accum+=(__key+__obj[__key]);\n\t\n}\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!((__accum.indexOf(\"aa1\")!==-1)&&(__accum.indexOf(\"ca3\")!==-1))) {\n\t$ERROR('#1: (__accum.indexOf(\"aa1\")!==-1)&&(__accum.indexOf(\"ca3\")!==-1)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (__accum.indexOf(\"ba2\")!==-1) {\n\t$ERROR('#2: __accum.indexOf(\"ba2\") === -1. Actual: __accum.indexOf(\"ba2\") ==='+ __accum.indexOf(\"ba2\") );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n// erasator is the hash map terminator\nfunction erasator_T_1000(hash_map, charactr){\n\tfor (key in hash_map){\n\t\tif (key.indexOf(charactr)===0) {\n\t\t\tdelete hash_map[key];\n\t\t};\n\t}\n}\n",
"id": "S12.6.4_A7_T2"
}
]
}
}

View File

@ -0,0 +1,14 @@
{
"testCollection": {
"name": "12.7",
"numTests": 1,
"tests": [
{
"id": "12.7-1",
"path": "TestCases/chapter12/12.7/12.7-1.js",
"description": "The continue Statement - a continue statement without an identifier may have a LineTerminator before the semi-colon",
"test": "assertTrue((function testcase() {\n var sum = 0;\n for (var i = 1; i <= 10; i++) {\n continue\n ;\n sum += i;\n }\n return sum === 0;\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,126 @@
{
"testCollection": {
"name": "12.7_The_continue_Statement",
"numTests": 18,
"tests": [
{
"section": "12.7",
"description": "Checking if execution of single \"continue\" without any IterationStatement fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x=1;\ncontinue;\nvar y=2;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A1_T1"
},
{
"section": "12.7",
"description": "Checking if single \"continue\" with Label but without any IterationStatement fails",
"negative": "",
"test": "LABEL : x=3.14;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x=1;\ncontinue LABEL;\nvar y=2;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A1_T2"
},
{
"section": "12.7",
"description": "Checking if laballed \"continue\" with no IterationStatement, placed into a block, fails",
"negative": "",
"test": "LABEL : x=3.14;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n{\n var x=1;\n continue LABEL;\n var y=2;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A1_T3"
},
{
"section": "12.7",
"description": "Checking if execution of \"continue\" with no IterationStatement, placed into a block, fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n{\n var x=1;\n continue;\n var y=2;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n",
"id": "S12.7_A1_T4"
},
{
"section": "12.7",
"description": "Checking by using eval, inserting LineTerminator between continue and Identifier",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\teval(\"FOR1 : for(var i=1;i<2;i++){FOR1NESTED : for(var j=1;j<2;j++) { continue\\u000AFOR1; } while(0);}\");\n\tif (j!==2) {\n\t\t$ERROR('#1: Since LineTerminator(U-000A) between continue and Identifier not allowed continue evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#1.1: eval(\"FOR1 : for(var i=1;i<2;i++){FOR1NESTED : for(var j=1;j<2;j++) { continue\\\\u000AFOR1; } while(0);}\") does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry{\n\teval(\"FOR2 : for(var i=1;i<2;i++){FOR2NESTED : for(var j=1;j<2;j++) { continue\\u000DFOR2; } while(0);}\");\n\tif (j!==2) {\n\t\t$ERROR('#2: Since LineTerminator(U-000D) between continue and Identifier not allowed continue evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#2.1: eval(\"FOR2 : for(var i=1;i<2;i++){FOR2NESTED : for(var j=1;j<2;j++) { continue\\\\u000DFOR2; } while(0);}\") does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\ntry{\n\teval(\"FOR3 : for(var i=1;i<2;i++){FOR3NESTED : for(var j=1;j<2;j++) { continue\\u2028FOR3; } while(0);}\");\n\tif (j!==2) {\n\t\t$ERROR('#3: Since LineTerminator(U-2028) between continue and Identifier not allowed continue evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#3.1: eval(\"FOR3 : for(var i=1;i<2;i++){FOR3NESTED : for(var j=1;j<2;j++) { continue\\\\u2028FOR3; } while(0);}\") does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\ntry{\n\teval(\"FOR4 : for(var i=1;i<2;i++){FOR4NESTED : for(var j=1;j<2;j++) { continue\\u2029FOR4; } while(0);}\");\n\tif (j!==2) {\n\t\t$ERROR('#4: Since LineTerminator(U-2029) between continue and Identifier not allowed continue evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#4.1: eval(\"FOR4 : for(var i=1;i<2;i++){FOR4NESTED : for(var j=1;j<2;j++) { continue\\\\u2029FOR4; } while(0);}\"); does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.7_A2"
},
{
"section": "12.7",
"description": "Simple using continue without Identifier and labeled loop",
"test": "LABEL_OUT : var x=0, y=0;\n\nLABEL_DO_LOOP : do {\n LABEL_IN : x=2;\n continue ;\n LABEL_IN_2 : var y=2;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==2)&&(y!==0)) {\n\t$ERROR('#1: x === 2 and y === 0. Actual: x ==='+x+' and y ==='+ y );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A3"
},
{
"section": "12.7",
"description": "Simple using continue Identifier construction",
"test": "LABEL_OUT : var x=0, y=0;\n\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)break;\n continue LABEL_DO_LOOP;\n LABEL_IN_2 : y++;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==1)&&(y!==0)) {\n\t$ERROR('#1: x===1 and y === 0. Actual: x==='+x+' and y ==='+y);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A4_T1"
},
{
"section": "12.7",
"description": "Using embedded and labeled loops, continue to nested loop",
"test": "LABEL_OUT : var x=0, y=0, xx=0, yy=0;\n\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)break;\n LABEL_NESTED_LOOP : do {\n LABEL_IN_NESTED : xx++;\n if(xx===10)break;\n continue LABEL_NESTED_LOOP;\n LABEL_IN_NESTED_2 : yy++;\n } while (0);\n \n LABEL_IN_2 : y++;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==1)&&(y!==1)&&(xx!==1)&(yy!==0)) {\n\t$ERROR('#1: (x===1) and (y===1) and (xx===1) and (yy===0). Actual: x==='+x+' and y==='+y+' and xx==='+xx+' and yy==='+yy );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A4_T2"
},
{
"section": "12.7",
"description": "Using embedded and labeled loops, continue to outer loop",
"test": "LABEL_OUT : var x=0, y=0, xx=0, yy=0;\n\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)break;\n LABEL_NESTED_LOOP : do {\n LABEL_IN_NESTED : xx++;\n if(xx===10)break;\n continue LABEL_DO_LOOP;\n LABEL_IN_NESTED_2 : yy++;\n } while (0);\n \n LABEL_IN_2 : y++;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==1)&&(y!==0)&&(xx!==1)&(yy!==0)) {\n\t$ERROR('#1: (x===1) and (y===0) and (xx===1) and (yy===0). Actual: x==='+x+' and y==='+y+' and xx==='+xx+' and yy==='+yy );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A4_T3"
},
{
"section": "12.7",
"description": "Trying to continue another labeled loop",
"negative": "",
"test": "LABEL_OUT : var x=0, y=0;\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)break;\n continue LABEL_ANOTHER_LOOP;\n LABEL_IN_2 : y++;\n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n",
"id": "S12.7_A5_T1"
},
{
"section": "12.7",
"description": "Identifier is a function name",
"negative": "",
"test": "LABEL_OUT : var x=0, y=0;\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)break;\n continue IN_DO_FUNC;\n LABEL_IN_2 : y++;\n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){};\n",
"id": "S12.7_A5_T2"
},
{
"section": "12.7",
"description": "Identifier is within loop label",
"negative": "",
"test": "LABEL_OUT : var x=0, y=0;\n\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)break;\n continue LABEL_IN;\n LABEL_IN_2 : y++;\n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n",
"id": "S12.7_A5_T3"
},
{
"section": "12.7",
"description": "Using labaled \"continue Identifier\" within a function body",
"negative": "",
"test": "var x=0,y=0;\n\nLABEL1 : do {\n x++;\n (function(){continue LABEL1;})();\n y++;\n} while(0);\n",
"id": "S12.7_A6"
},
{
"section": "12.7",
"description": "Using eval \"eval(\"continue LABEL1\")\"",
"test": "var x=0,y=0;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\tLABEL1 : do {\n x++;\n eval(\"continue LABEL1\");\n y++;\n } while(0);\n\t$ERROR('#1: eval(\"continue LABEL1\") does not lead to throwing exception');\n} catch(e){\n\tif(!(e instanceof SyntaxError)){\n\t\t$ERROR(\"1.1: Appearing of continue within eval statement inside of IterationStatement yields SyntaxError\");\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A7"
},
{
"section": "12.7",
"description": "Checking if execution of \"continue Identifier\" within catch Block fails",
"negative": "",
"test": "var x=0,y=0;\n\ntry{\n\tLABEL1 : do {\n\t\tx++;\n\t\tthrow \"gonna leave it\";\n\t\ty++;\n\t} while(0);\n\t$ERROR('#1: throw \"gonna leave it\" lead to throwing exception');\n} catch(e){\n\tcontinue LABEL2;\n\tLABEL2 : do {\n\t\tx++;\n\t\ty++;\n\t} while(0);\n};\n",
"id": "S12.7_A8_T1"
},
{
"section": "12.7",
"description": "Checking if execution of \"continue\" within catch Block fails",
"negative": "",
"test": "var x=0,y=0;\n\ntry{\n\tLABEL1 : do {\n\t\tx++;\n\t\tthrow \"gonna leave it\";\n\t\ty++;\n\t} while(0);\n\t$ERROR('#1: throw \"gonna leave it\" lead to throwing exception');\n} catch(e){\n\tcontinue;\n\tLABEL2 : do {\n\t\tx++;\n\t\ty++;\n\t} while(0);\n};\n",
"id": "S12.7_A8_T2"
},
{
"section": "12.7",
"description": "Using \"continue Identifier\" within catch Block that is within a loop",
"test": "var x=0,y=0;\n\n(function(){\nFOR : for(;;){\n\ttry{\n\t\tx++;\n\t\tif(x===10)return;\n\t\tthrow 1;\n\t} catch(e){\n\t\tcontinue FOR;\n\t}\t\n}\n})();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (x!==10) {\n\t$ERROR('#1: Continue inside of try-catch nested in loop is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A9_T1"
},
{
"section": "12.7",
"description": "Using \"continue\" within catch Block that is within a loop",
"test": "var x=0,y=0;\n\n(function(){\nFOR : for(;;){\n\ttry{\n\t\tx++;\n\t\tif(x===10)return;\n\t\tthrow 1;\n\t} catch(e){\n\t\tcontinue;\n\t}\t\n}\n})();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (x!==10) {\n\t$ERROR('#1: Continue inside of try-catch nested in loop is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.7_A9_T2"
}
]
}
}

View File

@ -0,0 +1,14 @@
{
"testCollection": {
"name": "12.8",
"numTests": 1,
"tests": [
{
"id": "12.8-1",
"path": "TestCases/chapter12/12.8/12.8-1.js",
"description": "The break Statement - a break statement without an identifier may have a LineTerminator before the semi-colon",
"test": "assertTrue((function testcase() {\n var sum = 0;\n for (var i = 1; i <= 10; i++) {\n if (i === 6) {\n break\n ;\n }\n sum += i;\n }\n return sum === 15;\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,126 @@
{
"testCollection": {
"name": "12.8_The_break_Statement",
"numTests": 18,
"tests": [
{
"section": "12.8",
"description": "Checking if break statement with no loop fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x=1;\nbreak;\nvar y=2;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A1_T1"
},
{
"section": "12.8",
"description": "Checking if break Identifier with no loop fails",
"negative": "",
"test": "LABEL : x=3.14;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x=1;\nbreak LABEL;\nvar y=2;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A1_T2"
},
{
"section": "12.8",
"description": "Checking if break statement with no loop, placed into a block, fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n{\n var x=1;\n break;\n var y=2;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A1_T3"
},
{
"section": "12.8",
"description": "Checking if break Identifier with no loop, placed into a block, fails",
"negative": "",
"test": "LABEL : x=3.14;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n{\n var x=1;\n break LABEL;\n var y=2;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A1_T4"
},
{
"section": "12.8",
"description": "Checking by using eval, inserting LineTerminator between break and Identifier",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\teval(\"FOR1 : for(var i=1;i<2;i++){ LABEL1 : do {var x =1;break\\u000AFOR1;var y=2;} while(0);}\");\n\tif (i!==2) {\n\t\t$ERROR('#1: Since LineTerminator(U-000A) between break and Identifier not allowed break evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#1.1: eval(\"FOR1 : for(var i=1;i<2;i++){ LABEL1 : do {var x =1;break\\\\u000AFOR1;var y=2;} while(0);}\") does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\ntry{\n\teval(\"FOR2 : for(var i=1;i<2;i++){ LABEL2 : do {var x =1;break\\u000DFOR2;var y=2;} while(0);}\");\n\tif (i!==2) {\n\t\t$ERROR('#2: Since LineTerminator(U-000D) between break and Identifier not allowed break evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#2.1: eval(\"FOR2 : for(var i=1;i<2;i++){ LABEL2 : do {var x =1;break\\\\u000DFOR2;var y=2;} while(0);}\") does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\ntry{\n\teval(\"FOR3 : for(var i=1;i<2;i++){ LABEL3 : do {var x =1;break\\u2028FOR3;var y=2;} while(0);}\");\n\tif (i!==2) {\n\t\t$ERROR('#3: Since LineTerminator(U-2028) between break and Identifier not allowed break evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#3.1: eval(\"FOR3 : for(var i=1;i<2;i++){ LABEL3 : do {var x =1;break\\\\u2028FOR3;var y=2;} while(0);}\") does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\ntry{\n\teval(\"FOR4 : for(var i=1;i<2;i++){ LABEL4 : do {var x =1;break\\u2029FOR4;var y=2;} while(0);}\");\n\tif (i!==2) {\n\t\t$ERROR('#4: Since LineTerminator(U-2029) between break and Identifier not allowed break evaluates without label');\n\t}\n} catch(e){\n\t$ERROR('#4.1: eval(\"FOR4 : for(var i=1;i<2;i++){ LABEL4 : do {var x =1;break\\\\u2029FOR4;var y=2;} while(0);}\") does not lead to throwing exception');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n\n",
"id": "S12.8_A2"
},
{
"section": "12.8",
"description": "Using \"break\" without Identifier within labeled loop",
"test": "LABEL_OUT : var x=0, y=0;\n\nLABEL_DO_LOOP : do {\n LABEL_IN : x=2;\n break ;\n LABEL_IN_2 : var y=2;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==2)&&(y!==0)) {\n\t$ERROR('#1: x === 2 and y === 0. Actual: x ==='+x+' and y ==='+y);\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A3"
},
{
"section": "12.8",
"description": "Using \"break Identifier\" within labaeled loop",
"test": "LABEL_OUT : var x=0, y=0;\n(function(){\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)return;\n break LABEL_DO_LOOP;\n LABEL_IN_2 : y++;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n})();\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==1)&&(y!==0)) {\n\t$ERROR('#1: x === 1 and y === 0. Actual: x === '+x+' and y ==='+ y );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A4_T1"
},
{
"section": "12.8",
"description": "Using embedded and labeled loops, breaking to nested loop",
"test": "LABEL_OUT : var x=0, y=0, xx=0, yy=0;\n(function(){\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)return;\n LABEL_NESTED_LOOP : do {\n LABEL_IN_NESTED : xx++;\n if(xx===10)return;\n break LABEL_NESTED_LOOP;\n LABEL_IN_NESTED_2 : yy++;\n } while (0);\n \n LABEL_IN_2 : y++;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n})();\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==1)&&(y!==1)&&(xx!==1)&(yy!==0)) {\n\t$ERROR('#1: x === 1 and y === 1 and xx === 1 and yy === 0. Actual: x==='+x+' and y==='+y+' and xx==='+xx+' and yy==='+yy );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A4_T2"
},
{
"section": "12.8",
"description": "Using embedded and labeled loops, breaking to outer loop",
"test": "LABEL_OUT : var x=0, y=0, xx=0, yy=0;\n(function(){\nLABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)return;\n LABEL_NESTED_LOOP : do {\n LABEL_IN_NESTED : xx++;\n if(xx===10)return;\n break LABEL_DO_LOOP;\n LABEL_IN_NESTED_2 : yy++;\n } while (0);\n \n LABEL_IN_2 : y++;\n \n function IN_DO_FUNC(){}\n} while(0);\n\nLABEL_ANOTHER_LOOP : do {\n ;\n} while(0);\n\nfunction OUT_FUNC(){}\n})();\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif ((x!==1)&&(y!==0)&&(xx!==1)&(yy!==0)) {\n\t$ERROR('#1: x === 1 and y === 0 and xx === 1 and yy === 0. Actual: x==='+x+' and y==='+y+' and xx==='+xx+' and yy==='+yy );\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A4_T3"
},
{
"section": "12.8",
"description": "Checking if breaking another labeled loop fails",
"negative": "",
"test": "(function(){\n LABEL_OUT : var x=0, y=0;\n LABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)\n return;\n break LABEL_ANOTHER_LOOP;\n LABEL_IN_2 : y++;\n function IN_DO_FUNC(){}\n } while(0);\n \n LABEL_ANOTHER_LOOP : do {\n ;\n } while(0);\n \n function OUT_FUNC(){}\n})();\n",
"id": "S12.8_A5_T1"
},
{
"section": "12.8",
"description": "Checking if using function name as an Identifier appears to be invalid",
"negative": "",
"test": "(function(){\n LABEL_OUT : var x=0, y=0;\n LABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)\n return;\n break IN_DO_FUNC;\n LABEL_IN_2 : y++;\n function IN_DO_FUNC(){}\n } while(0);\n \n LABEL_ANOTHER_LOOP : do {\n ;\n } while(0);\n \n function OUT_FUNC(){}\n})();\n",
"id": "S12.8_A5_T2"
},
{
"section": "12.8",
"description": "Checking if using internal loop label as an Identifier appears to be invalid",
"negative": "",
"test": "(function(){\n LABEL_OUT : var x=0, y=0;\n LABEL_DO_LOOP : do {\n LABEL_IN : x++;\n if(x===10)\n return;\n break LABEL_IN;\n LABEL_IN_2 : y++;\n\n function IN_DO_FUNC(){}\n \n } while(0);\n \n LABEL_ANOTHER_LOOP : do {\n ;\n } while(0);\n \n function OUT_FUNC(){}\n \n})();\n",
"id": "S12.8_A5_T3"
},
{
"section": "12.8",
"description": "Checking if using \"break Identifier\" within a function body appears to be invalid",
"negative": "",
"test": "var x=0,y=0;\n\nLABEL1 : do {\n x++;\n (function(){break LABEL1;})();\n y++;\n} while(0);\n",
"id": "S12.8_A6"
},
{
"section": "12.8",
"description": "Using eval \"eval(\"break LABEL1\")\"",
"test": "var x=0,y=0;\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry{\n\tLABEL1 : do {\n x++;\n eval(\"break LABEL1\");\n y++;\n } while(0);\n\t$ERROR('#1: eval(\"break LABEL1\") does not lead to throwing exception');\n} catch(e){\n\tif(!(e instanceof SyntaxError)){\n\t\t$ERROR(\"1.1: Appearing of break within eval statement inside of IterationStatement yields SyntaxError\");\n\t}\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A7"
},
{
"section": "12.8",
"description": "Checking if using \"break Identifier\" from within catch Block appears to be invalid",
"negative": "",
"test": "var x=0,y=0;\n\ntry{\n\tLABEL1 : do {\n\t\tx++;\n\t\tthrow \"gonna leave it\";\n\t\ty++;\n\t} while(0);\n\t$ERROR('#1: throw \"gonna leave it\" lead to throwing exception');\n} catch(e){\n\tbreak LABEL2;\n\tLABEL2 : do {\n\t\tx++;\n\t\ty++;\n\t} while(0);\n}\n\n",
"id": "S12.8_A8_T1"
},
{
"section": "12.8",
"description": "Checking if using \"break Identifier\" from within catch Block appears to be invalid",
"negative": "",
"test": "var x=0,y=0;\n\ntry{\n\tLABEL1 : do {\n\t\tx++;\n\t\tthrow \"gonna leave it\";\n\t\ty++;\n\t} while(0);\n\t$ERROR('#1: throw \"gonna leave it\" lead to throwing exception');\n} catch(e){\n\tbreak;\n\tLABEL2 : do {\n\t\tx++;\n\t\ty++;\n\t} while(0);\n}\n\n",
"id": "S12.8_A8_T2"
},
{
"section": "12.8",
"description": "Using \"continue Identifier\" within \"catch\" statement",
"test": "var x=0,y=0;\n\n(function(){\nFOR : for(;;){\n\ttry{\n\t\tx++;\n\t\tif(x===10)return;\n\t\tthrow 1;\n\t} catch(e){\n\t\tbreak FOR;\n\t}\t\n}\n})();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (x!==1) {\n\t$ERROR('#1: break inside of try-catch nested in loop is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A9_T1"
},
{
"section": "12.8",
"description": "Using \"continue Identifier\" within \"catch\" statement",
"test": "var x=0,y=0;\n\n(function(){\nFOR : for(;;){\n\ttry{\n\t\tx++;\n\t\tif(x===10)return;\n\t\tthrow 1;\n\t} catch(e){\n\t\tbreak ;\n\t}\t\n}\n})();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (x!==1) {\n\t$ERROR('#1: break inside of try-catch nested in loop is allowed');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.8_A9_T2"
}
]
}
}

View File

@ -0,0 +1,14 @@
{
"testCollection": {
"name": "12.9",
"numTests": 1,
"tests": [
{
"id": "12.9-1",
"path": "TestCases/chapter12/12.9/12.9-1.js",
"description": "The return Statement - a return statement without an expression may have a LineTerminator before the semi-colon",
"test": "assertTrue((function testcase() {\n var sum = 0;\n (function innerTest() {\n for (var i = 1; i <= 10; i++) {\n if (i === 6) {\n return\n ;\n }\n sum += i;\n }\n })();\n return sum === 15;\n }).call(this));\n"
}
]
}
}

View File

@ -0,0 +1,102 @@
{
"testCollection": {
"name": "12.9_The_return_Statement",
"numTests": 14,
"tests": [
{
"section": "12.9",
"description": "Checking if execution of \"return\" with no function fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x=1;\nreturn;\nvar y=2;\n",
"id": "S12.9_A1_T1"
},
{
"section": "12.9",
"description": "Checking if execution of \"return (0)\" with no function fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nreturn (0);\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T10"
},
{
"section": "12.9",
"description": "Checking if execution of \"return x\" with no function fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nvar x=1;\nreturn x;\nvar y=2;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T2"
},
{
"section": "12.9",
"description": "Checking if execution of \"return\" within \"try\" statement fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n return 1;\n} catch(e){\n return 1;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T3"
},
{
"section": "12.9",
"description": "Checking if execution of \"return\" with no function fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nreturn;\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T4"
},
{
"section": "12.9",
"description": "Checking if execution of \"return\" with no function, placed into a Block, fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n{\n var x=1;\n return;\n var y=2;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T5"
},
{
"section": "12.9",
"description": "Checking if execution of \"return\" with no function, placed into a loop, fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo {\n var x=1;\n return;\n var y=2;\n} while(0);\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T6"
},
{
"section": "12.9",
"description": "Checking if execution of \"return x\" with no function, placed inside Block, fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n{\n var x=1;\n return x;\n var y=2;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T7"
},
{
"section": "12.9",
"description": "Checking if execution of \"return x\" with no function, placed into a loop, fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ndo {\n var x=1;\n return x;\n var y=2;\n} while(0);\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T8"
},
{
"section": "12.9",
"description": "Checking if execution of \"return\", placed into a catch Block, fails",
"negative": "",
"test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\ntry {\n throw 1;\n} catch(e){\n return e;\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A1_T9"
},
{
"section": "12.9",
"description": "Checking by using eval, inserting LineTerminator between return and Variable",
"test": "//CHECK#1\ntry{\n if (eval(\"(function(){var x = 1;return\\u000Ax;var y=2;})()\") !== undefined) {\n $ERROR(\"#1: LineTerminator(U-000A) between return and Identifier_opt yields return without Identifier_opt\");\t \n }\n} catch(e){\n $ERROR('#1: eval(\"(function(){var x = 1;return\\\\u000Ax;var y=2;})()\") does not lead to throwing exception');\n}\n\n\n\n\n//CHECK#2\ntry{\n if (eval(\"(function(){var x = 1;return\\u000Dx;var y=2;})()\") !== undefined) {\n $ERROR(\"#1: LineTerminator(U-000D) between return and Identifier_opt yields return without Identifier_opt\"); \n }\n} catch(e){\n $ERROR('#2: eval(\"(function(){var x = 1;return\\\\u000Dx;var y=2;})()\") does not lead to throwing exception');\n}\n\n\n\n\n//CHECK#3\ntry{\n if (eval(\"(function(){var x = 1;return\\u2028x;var y=2;})()\") !== undefined) {\n $ERROR(\"#1: LineTerminator(U-2028) between return and Identifier_opt yields return without Identifier_opt\"); \n }\n} catch(e){\n $ERROR('#3: eval(\"(function(){var x = 1;return\\\\u2028x;var y=2;})()\") does not lead to throwing exception');\n}\n\n\n\n\n//CHECK#4\ntry{\n if (eval(\"(function(){var x =1;return\\u2029x;var y=2;})()\") !== undefined) {\n $ERROR(\"#1: LineTerminator(U-2029) between return and Identifier_opt yields return without Identifier_opt\"); \n }\n} catch(e){\n $ERROR('#4: eval(\"(function(){var x =1;return\\\\u2029x;var y=2;})()\") does not lead to throwing exception');\n}\n",
"id": "S12.9_A2"
},
{
"section": "12.9",
"description": "Return without Expression",
"test": "__evaluated = (function (){return;})();\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (__evaluated !== undefined) {\n\t$ERROR('#1: If Expression is omitted, the return value is undefined');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A3"
},
{
"section": "12.9",
"description": "Return very sophisticated expression and function",
"test": "// second derivative \nfunction DD_operator(f, delta){return function(x){return (f(x+delta)-2*f(x)+f(x-delta))/(delta*delta)};}\n\nDDsin = DD_operator(Math.sin, 0.00001);\n\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\n// ((sin(x))')' = -sin(x)\nif (DDsin( Math.PI/2 ) + Math.sin( Math.PI/2 ) > 0.00001) {\n\t$ERROR('#1: return Expression yields to Return (return, GetValue(Evaluate Expression), empty)');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n",
"id": "S12.9_A4"
},
{
"section": "12.9",
"description": "Using code after Return statement",
"test": "//CHECK#1\nvar x1=1;\nfunction myfunc1(){\n\tx1++;\n\treturn;\n\tx1*=2;\n}\nmyfunc1();\nif (x1!==2) $ERROR('#1: x1 === 2. Actual: x1 ==='+ x1 );\n\n//CHECK#2\nvar x2=1;\nfunction myfunc2(){\n x2++;\n return x2;\n x2*=2;\n}\nmyfunc2();\nif (x2!==2) $ERROR('#2: x2 === 2. Actual: x2 ==='+ x2 );\n\n//CHECK#3\nvar x3=1;\nfunction myfunc3(){\n x3++;\n return;\n return x3;\n x3*=2;\n}\nif (myfunc3()!==undefined) $ERROR('#3: myfunc3() === undefined. Actual: myfunc3() ==='+ myfunc3() );\n",
"id": "S12.9_A5"
}
]
}
}

Some files were not shown because too many files have changed in this diff Show More