aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/11.9.1_The_Equals_Operator.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/11.9.1_The_Equals_Operator.json')
-rw-r--r--website/resources/scripts/testcases2/11.9.1_The_Equals_Operator.json182
1 files changed, 182 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/11.9.1_The_Equals_Operator.json b/website/resources/scripts/testcases2/11.9.1_The_Equals_Operator.json
new file mode 100644
index 000000000..081ff02bf
--- /dev/null
+++ b/website/resources/scripts/testcases2/11.9.1_The_Equals_Operator.json
@@ -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"
+ }
+ ]
+ }
+}