test262/website/resources/scripts/testcases2/11.10.1_AND_Operator.json

147 lines
21 KiB
JSON

{
"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"
}
]
}
}