aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.4.4.14.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/15.4.4.14.json')
-rw-r--r--website/resources/scripts/testcases2/15.4.4.14.json1358
1 files changed, 1358 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.4.4.14.json b/website/resources/scripts/testcases2/15.4.4.14.json
new file mode 100644
index 000000000..f84a8278c
--- /dev/null
+++ b/website/resources/scripts/testcases2/15.4.4.14.json
@@ -0,0 +1,1358 @@
+{
+ "testCollection": {
+ "name": "15.4.4.14",
+ "numTests": 193,
+ "tests": [
+ {
+ "id": "15.4.4.14-0-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-1.js",
+ "description": "Array.prototype.indexOf must exist as a function",
+ "test": "assertTrue((function testcase() {\n var f = Array.prototype.indexOf;\n if (typeof(f) === \"function\") {\n return true;\n }\n }).call(this));\n"
+ },
+ {
+ "id": "15.4.4.14-0-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-2.js",
+ "description": "Array.prototype.indexOf has a length property whose value is 1.",
+ "test": "assertTrue((Array.prototype.indexOf.length === 1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-1.js",
+ "description": "Array.prototype.indexOf applied to undefined throws a TypeError",
+ "test": "assertTrue((function testcase() {\n try {\n Array.prototype.indexOf.call(undefined);\n return false;\n }\n catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-10.js",
+ "description": "Array.prototype.indexOf applied to the Math object",
+ "test": "assertTrue((function testcase() {\n try {\n Math[1] = true;\n Math.length = 2;\n return Array.prototype.indexOf.call(Math, true) === 1;\n } finally {\n delete Math[1];\n delete Math.length;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-11.js",
+ "description": "Array.prototype.indexOf applied to Date object",
+ "test": "assertTrue((function testcase() {\n\n var obj = new Date();\n obj.length = 2;\n obj[1] = true;\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-12",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-12.js",
+ "description": "Array.prototype.indexOf applied to RegExp object",
+ "test": "assertTrue((function testcase() {\n\n var obj = new RegExp();\n obj.length = 2;\n obj[1] = true;\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-13",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-13.js",
+ "description": "Array.prototype.indexOf applied to the JSON object",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n try {\n JSON[3] = targetObj;\n JSON.length = 5;\n return Array.prototype.indexOf.call(JSON, targetObj) === 3;\n } finally {\n delete JSON[3];\n delete JSON.length;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-14",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-14.js",
+ "description": "Array.prototype.indexOf applied to Error object",
+ "test": "assertTrue((function testcase() {\n\n var obj = new SyntaxError();\n obj[1] = true;\n obj.length = 2;\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-15",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-15.js",
+ "description": "Array.prototype.indexOf applied to Arguments object",
+ "test": "assertTrue((function testcase() {\n\n function fun() {\n return arguments;\n }\n var obj = fun(1, true, 3);\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-17",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-17.js",
+ "description": "Array.prototype.indexOf applied to the global object",
+ "test": "assertTrue((function testcase() {\n try {\n var oldLen = fnGlobalObject().length;\n fnGlobalObject()[1] = true;\n fnGlobalObject().length = 2;\n return Array.prototype.indexOf.call(fnGlobalObject(), true) === 1;\n } finally {\n delete fnGlobalObject()[1];\n fnGlobalObject().length = oldLen;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-2.js",
+ "description": "Array.prototype.indexOf applied to null throws a TypeError",
+ "test": "assertTrue((function testcase() {\n try {\n Array.prototype.indexOf.call(null);\n return false;\n }\n catch (e) {\n return e instanceof TypeError;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-3.js",
+ "description": "Array.prototype.indexOf applied to boolean primitive",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n try {\n Boolean.prototype[1] = targetObj;\n Boolean.prototype.length = 2;\n\n return Array.prototype.indexOf.call(true, targetObj) === 1;\n } finally {\n delete Boolean.prototype[1];\n delete Boolean.prototype.length;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-4.js",
+ "description": "Array.prototype.indexOf applied to Boolean Object",
+ "test": "assertTrue((function testcase() {\n\n var obj = new Boolean(false);\n obj.length = 2;\n obj[1] = true;\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-5.js",
+ "description": "Array.prototype.indexOf applied to number primitive",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n try {\n Number.prototype[1] = targetObj;\n Number.prototype.length = 2;\n\n return Array.prototype.indexOf.call(5, targetObj) === 1;\n } finally {\n delete Number.prototype[1];\n delete Number.prototype.length;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-6.js",
+ "description": "Array.prototype.indexOf applied to Number object",
+ "test": "assertTrue((function testcase() {\n\n var obj = new Number(-3);\n obj.length = 2;\n obj[1] = true;\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-7.js",
+ "description": "Array.prototype.indexOf applied to string primitive",
+ "test": "assertTrue((Array.prototype.indexOf.call(\"abc\", \"b\") === 1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-8.js",
+ "description": "Array.prototype.indexOf applied to String object",
+ "test": "assertTrue((function testcase() {\n\n var obj = new String(\"null\");\n\n return Array.prototype.indexOf.call(obj, 'l') === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-1-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-9.js",
+ "description": "Array.prototype.indexOf applied to Function object",
+ "test": "assertTrue((function testcase() {\n\n var obj = function (a, b) {\n return a + b;\n };\n obj[1] = true;\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-10-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-1.js",
+ "description": "Array.prototype.indexOf returns -1 for elements not present in array",
+ "test": "assertTrue((function testcase() {\n var a = new Array();\n a[100] = 1;\n a[99999] = \"\"; \n a[10] = new Object();\n a[5555] = 5.5;\n a[123456] = \"str\";\n a[5] = 1E+309;\n if (a.indexOf(1) !== 100 || \n a.indexOf(\"\") !== 99999 ||\n a.indexOf(\"str\") !== 123456 ||\n a.indexOf(1E+309) !== 5 || //Infinity\n a.indexOf(5.5) !== 5555 )\n {\n return false;\n }\n if (a.indexOf(true) === -1 && \n a.indexOf(5) === -1 &&\n a.indexOf(\"str1\") === -1 &&\n a.indexOf(null) === -1 &&\n a.indexOf(new Object()) === -1) \n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-10-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-2.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 and does not access any other properties",
+ "test": "assertTrue((function testcase() {\n var accessed = false;\n var f = {length: 0};\n Object.defineProperty(f,\"0\",{get: function () {accessed = true; return 1;}});\n\n \n var i = Array.prototype.indexOf.call(f,1);\n \n if (i === -1 && accessed==false) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-2-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-1.js",
+ "description": "Array.prototype.indexOf - 'length' is own data property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n var objOne = { 1: true, length: 2 };\n var objTwo = { 2: true, length: 2 };\n return Array.prototype.indexOf.call(objOne, true) === 1 &&\n Array.prototype.indexOf.call(objTwo, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-10.js",
+ "description": "Array.prototype.indexOf - 'length' is inherited accessor property",
+ "test": "assertTrue((function testcase() {\n\n var proto = {};\n Object.defineProperty(proto, \"length\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n var Con = function () {};\n Con.prototype = proto;\n\n var childOne = new Con();\n childOne[1] = true;\n var childTwo = new Con();\n childTwo[2] = true;\n\n return Array.prototype.indexOf.call(childOne, true) === 1 &&\n Array.prototype.indexOf.call(childTwo, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-2-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-11.js",
+ "description": "Array.prototype.indexOf - 'length' is own accessor property without a get function",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 1: true };\n Object.defineProperty(obj, \"length\", {\n set: function () { },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(obj, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-2-12",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-12.js",
+ "description": "Array.prototype.indexOf - 'length' is own accessor property without a get function that overrides an inherited accessor property",
+ "test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Object.prototype, \"length\", {\n get: function () {\n return 20;\n },\n configurable: true\n });\n\n var obj = { 1: 1 };\n Object.defineProperty(obj, \"length\", {\n set: function () { },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(obj, 1) === -1;\n } finally {\n delete Object.prototype.length;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-2-13",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-13.js",
+ "description": "Array.prototype.indexOf - 'length' is inherited accessor property without a get function",
+ "test": "assertTrue((function testcase() {\n\n var proto = {};\n Object.defineProperty(proto, \"length\", {\n set: function () { },\n configurable: true\n });\n\n var Con = function () {};\n Con.prototype = proto;\n\n var child = new Con();\n child[1] = true;\n\n return Array.prototype.indexOf.call(child, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-2-14",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-14.js",
+ "description": "Array.prototype.indexOf - 'length' is undefined property",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: true, 1: true };\n\n return Array.prototype.indexOf.call(obj, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-15",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-15.js",
+ "description": "Array.prototype.indexOf - 'length' is property of the global object",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n try {\n var oldLen = fnGlobalObject().length;\n fnGlobalObject().length = 2;\n\n fnGlobalObject()[1] = targetObj;\n if (Array.prototype.indexOf.call(fnGlobalObject(), targetObj) !== 1) {\n return false;\n }\n\n fnGlobalObject()[1] = {};\n fnGlobalObject()[2] = targetObj;\n\n return Array.prototype.indexOf.call(fnGlobalObject(), targetObj) === -1;\n } finally {\n delete fnGlobalObject()[1];\n delete fnGlobalObject()[2];\n fnGlobalObject().length = oldLen;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-17",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-17.js",
+ "description": "Array.prototype.indexOf applied to Arguments object which implements its own property get method",
+ "test": "assertTrue((function testcase() {\n\n var func = function (a, b) {\n arguments[2] = false;\n return Array.prototype.indexOf.call(arguments, true) === 1 &&\n Array.prototype.indexOf.call(arguments, false) === -1;\n };\n\n return func(0, true);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-18",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-18.js",
+ "description": "Array.prototype.indexOf applied to String object, which implements its own property get method",
+ "test": "assertTrue((function testcase() {\n var str = new String(\"012\");\n try {\n String.prototype[3] = \"3\";\n return Array.prototype.indexOf.call(str, \"2\") === 2 &&\n Array.prototype.indexOf.call(str, \"3\") === -1;\n } finally {\n delete String.prototype[3];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-19",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-19.js",
+ "description": "Array.prototype.indexOf applied to Function object which implements its own property get method",
+ "test": "assertTrue((function testcase() {\n\n var obj = function (a, b) {\n return a + b;\n };\n obj[1] = \"b\";\n obj[2] = \"c\";\n\n return Array.prototype.indexOf.call(obj, obj[1]) === 1 &&\n Array.prototype.indexOf.call(obj, obj[2]) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-2.js",
+ "description": "Array.prototype.indexOf - 'length' is own data property on an Array",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n try {\n Array.prototype[2] = targetObj;\n \n return [0, targetObj].indexOf(targetObj) === 1 &&\n [0, 1].indexOf(targetObj) === -1;\n\n } finally {\n delete Array.prototype[2];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-3.js",
+ "description": "Array.prototype.indexOf - 'length' is own data property that overrides an inherited data property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var proto = { length: 0 };\n\n var Con = function () {};\n Con.prototype = proto;\n\n var child = new Con();\n child.length = 2;\n child[1] = true;\n\n return Array.prototype.indexOf.call(child, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-4.js",
+ "description": "Array.prototype.indexOf - 'length' is own data property that overrides an inherited data property on an Array",
+ "test": "assertTrue((function testcase() {\n\n var targetObj = {};\n var arrProtoLen;\n\n try {\n arrProtoLen = Array.prototype.length;\n Array.prototype.length = 0;\n\n return [0, targetObj].indexOf(targetObj) === 1;\n\n } finally {\n\n Array.prototype.length = arrProtoLen;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-5.js",
+ "description": "Array.prototype.indexOf - 'length' is own data property that overrides an inherited accessor property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n var proto = {};\n Object.defineProperty(proto, \"length\", {\n get: function () {\n return 0;\n },\n configurable: true\n });\n\n var Con = function () {};\n Con.prototype = proto;\n\n var child = new Con();\n \n Object.defineProperty(child, \"length\", {\n value: 2,\n configurable: true\n });\n child[1] = true;\n\n return Array.prototype.indexOf.call(child, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-2-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-6.js",
+ "description": "Array.prototype.indexOf - 'length' is an inherited data property",
+ "test": "assertTrue((function testcase() {\n var proto = { length: 2 };\n\n var Con = function () {};\n Con.prototype = proto;\n\n var childOne = new Con();\n childOne[1] = true;\n var childTwo = new Con();\n childTwo[2] = true;\n\n return Array.prototype.indexOf.call(childOne, true) === 1 &&\n Array.prototype.indexOf.call(childTwo, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-2-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-7.js",
+ "description": "Array.prototype.indexOf - 'length' is own accessor property",
+ "test": "assertTrue((function testcase() {\n var objOne = { 1: true };\n var objTwo = { 2: true };\n Object.defineProperty(objOne, \"length\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n Object.defineProperty(objTwo, \"length\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(objOne, true) === 1 &&\n Array.prototype.indexOf.call(objTwo, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-2-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-8.js",
+ "description": "Array.prototype.indexOf - 'length' is own accessor property that overrides an inherited data property",
+ "test": "assertTrue((function testcase() {\n\n var proto = { length: 0 };\n\n var Con = function () {};\n Con.prototype = proto;\n\n var child = new Con();\n child[1] = true;\n\n Object.defineProperty(child, \"length\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(child, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-2-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-9.js",
+ "description": "Array.prototype.indexOf - 'length' is own accessor property that overrides an inherited accessor property",
+ "test": "assertTrue((function testcase() {\n var proto = {};\n Object.defineProperty(proto, \"length\", {\n get: function () {\n return 0;\n },\n configurable: true\n });\n\n var Con = function () {};\n Con.prototype = proto;\n\n var child = new Con();\n child[1] = true;\n\n Object.defineProperty(child, \"length\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(child, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-3-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-1.js",
+ "description": "Array.prototype.indexOf - value of 'length' is undefined",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: 1, 1: 1, length: undefined };\n\n return Array.prototype.indexOf.call(obj, 1) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-10.js",
+ "description": "Array.prototype.indexOf - value of 'length' is number primitive (value is NaN)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: 0, length: NaN };\n\n return Array.prototype.indexOf.call(obj, 0) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-11.js",
+ "description": "Array.prototype.indexOf - 'length' is a string containing a positive number",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 1: 1, 2: 2, length: \"2\" };\n\n return Array.prototype.indexOf.call(obj, 1) === 1 &&\n Array.prototype.indexOf.call(obj, 2) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-12",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js",
+ "description": "Array.prototype.indexOf - 'length' is a string containing a negative number",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 1: \"true\", 2: \"2\", length: \"-4294967294\" };\n\n return Array.prototype.indexOf.call(obj, \"true\") === 1 &&\n Array.prototype.indexOf.call(obj, \"2\") === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-13",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-13.js",
+ "description": "Array.prototype.indexOf - 'length' is a string containing a decimal number",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 199: true, 200: \"200.59\", length: \"200.59\" };\n\n return Array.prototype.indexOf.call(obj, true) === 199 &&\n Array.prototype.indexOf.call(obj, \"200.59\") === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-14",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js",
+ "description": "Array.prototype.indexOf - 'length' is a string containing +/-Infinity",
+ "test": "assertTrue((function testcase() {\n\n var objOne = { 0: true, 1: true, length: \"Infinity\" };\n var objTwo = { 0: true, 1: true, length: \"+Infinity\" };\n var objThree = { 0: true, 1: true, length: \"-Infinity\" };\n\n return Array.prototype.indexOf.call(objOne, true) === -1 &&\n Array.prototype.indexOf.call(objTwo, true) === -1 &&\n Array.prototype.indexOf.call(objThree, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-15",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-15.js",
+ "description": "Array.prototype.indexOf - 'length' is a string containing an exponential number",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 1: true, 2: \"2E0\", length: \"2E0\" };\n\n return Array.prototype.indexOf.call(obj, true) === 1 &&\n Array.prototype.indexOf.call(obj, \"2E0\") === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-16",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-16.js",
+ "description": "Array.prototype.indexOf - 'length' is a string containing a hex number",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 10: true, 11: \"0x00B\", length: \"0x00B\" };\n\n return Array.prototype.indexOf.call(obj, true) === 10 &&\n Array.prototype.indexOf.call(obj, \"0x00B\") === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-17",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-17.js",
+ "description": "Array.prototype.indexOf - 'length' is a string containing a number with leading zeros",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 1: true, 2: \"0002.0\", length: \"0002.0\" };\n\n return Array.prototype.indexOf.call(obj, true) === 1 &&\n Array.prototype.indexOf.call(obj, \"0002.0\") === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-18",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-18.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a string that can't convert to a number",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: true, 100: true, length: \"one\" };\n\n return Array.prototype.indexOf.call(obj, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-19",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-19.js",
+ "description": "Array.prototype.indexOf - value of 'length' is an Object which has an own toString method.",
+ "test": "assertTrue((function testcase() {\n\n // objects inherit the default valueOf() method from Object\n // that simply returns itself. Since the default valueOf() method\n // does not return a primitive value, ES next tries to convert the object\n // to a number by calling its toString() method and converting the\n // resulting string to a number.\n\n var obj = {\n 1: true,\n 2: 2,\n\n length: {\n toString: function () {\n return '2';\n }\n }\n };\n\n return Array.prototype.indexOf.call(obj, true) === 1 &&\n Array.prototype.indexOf.call(obj, 2) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-2.js",
+ "description": "Array.prototype.indexOf return -1 when 'length' is a boolean (value is true)",
+ "test": "assertTrue((function testcase() {\n var obj = { 0: 0, 1: 1, length: true };\n return Array.prototype.indexOf.call(obj, 0) === 0 &&\n Array.prototype.indexOf.call(obj, 1) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-20",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-20.js",
+ "description": "Array.prototype.indexOf - value of 'length' is an Object which has an own valueOf method.",
+ "test": "assertTrue((function testcase() {\n\n //valueOf method will be invoked first, since hint is Number\n var obj = {\n 1: true,\n 2: 2,\n length: {\n valueOf: function () {\n return 2;\n }\n }\n };\n\n return Array.prototype.indexOf.call(obj, true) === 1 &&\n Array.prototype.indexOf.call(obj, 2) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-21",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-21.js",
+ "description": "Array.prototype.indexOf - 'length' is an object that has an own valueOf method that returns an object and toString method that returns a string",
+ "test": "assertTrue((function testcase() {\n\n var toStringAccessed = false;\n var valueOfAccessed = false;\n\n var obj = {\n 1: true,\n length: {\n toString: function () {\n toStringAccessed = true;\n return '2';\n },\n\n valueOf: function () {\n valueOfAccessed = true;\n return {};\n }\n }\n };\n\n return Array.prototype.indexOf.call(obj, true) === 1 && toStringAccessed && valueOfAccessed;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-22",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-22.js",
+ "description": "Array.prototype.indexOf throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values",
+ "test": "assertTrue((function testcase() {\n\n var toStringAccessed = false;\n var valueOfAccessed = false;\n\n var obj = {\n length: {\n toString: function () {\n toStringAccessed = true;\n return {};\n },\n\n valueOf: function () {\n valueOfAccessed = true;\n return {};\n }\n }\n };\n\n try {\n Array.prototype.indexOf.call(obj);\n return false;\n } catch (e) {\n return toStringAccessed && valueOfAccessed;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-23",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-23.js",
+ "description": "Array.prototype.indexOf uses inherited valueOf method when 'length' is an object with an own toString and inherited valueOf methods",
+ "test": "assertTrue((function testcase() {\n\n var toStringAccessed = false;\n var valueOfAccessed = false;\n\n var proto = {\n valueOf: function () {\n valueOfAccessed = true;\n return 2;\n }\n };\n\n var Con = function () {};\n Con.prototype = proto;\n\n var child = new Con();\n child.toString = function () {\n toStringAccessed = true;\n return 2;\n };\n\n var obj = {\n 1: true,\n length: child\n };\n\n return Array.prototype.indexOf.call(obj, true) === 1 && valueOfAccessed && !toStringAccessed;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-24",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-24.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 122: true, 123: false, length: 123.321 }; //length will be 123 finally\n\n return Array.prototype.indexOf.call(obj, true) === 122 &&\n Array.prototype.indexOf.call(obj, false) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-25",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 1: true, 2: false, length: -4294967294.5 }; //length will be 2 finally\n\n return Array.prototype.indexOf.call(obj, true) === 1 &&\n Array.prototype.indexOf.call(obj, false) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-28",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js",
+ "description": "Array.prototype.indexOf - value of 'length' is boundary value (2^32)",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n var obj = {\n 0: targetObj,\n 4294967294: targetObj,\n 4294967295: targetObj,\n length: 4294967296\n };\n\n return Array.prototype.indexOf.call(obj, targetObj) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-29",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js",
+ "description": "Array.prototype.indexOf - value of 'length' is boundary value (2^32 + 1)",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n var obj = {\n 0: targetObj,\n 1: 4294967297,\n length: 4294967297\n };\n\n return Array.prototype.indexOf.call(obj, targetObj) === 0 &&\n Array.prototype.indexOf.call(obj, 4294967297) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-3.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a number (value is 0)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: true, length: 0 };\n\n return Array.prototype.indexOf.call(obj, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-4.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a number (value is +0)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: true, length: +0 };\n\n return Array.prototype.indexOf.call(obj, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-5.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a number (value is -0)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: true, length: -0 };\n\n return Array.prototype.indexOf.call(obj, true) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-6.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a number (value is positive)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 3: true, 4: false, length: 4 };\n\n return Array.prototype.indexOf.call(obj, true) === 3 &&\n Array.prototype.indexOf.call(obj, false) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a number (value is negative)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 4: true, 5: false, length: 5 - Math.pow(2, 32) };\n\n return Array.prototype.indexOf.call(obj, true) === 4 &&\n Array.prototype.indexOf.call(obj, false) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a number (value is Infinity)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: 0, length: Infinity };\n\n return Array.prototype.indexOf.call(obj, 0) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-3-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-9.js",
+ "description": "Array.prototype.indexOf - value of 'length' is a number (value is -Infinity)",
+ "test": "assertTrue((function testcase() {\n\n var obj = { 0: 0, length: -Infinity };\n\n return Array.prototype.indexOf.call(obj, 0) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-1.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 (empty array)",
+ "test": "assertTrue((function testcase() {\n var i = [].indexOf(42);\n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-10.js",
+ "description": "Array.prototype.indexOf - 'length' is a number of value -6e-1",
+ "test": "assertTrue((function testcase() {\n var targetObj = [];\n var obj = { 0: targetObj, 100: targetObj, length: -6e-1 };\n return Array.prototype.indexOf.call(obj, targetObj) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-11.js",
+ "description": "Array.prototype.indexOf - 'length' is an empty string",
+ "test": "assertTrue((function testcase() {\n var targetObj = [];\n var obj = { 0: targetObj, 100: targetObj, length: \"\" };\n return Array.prototype.indexOf.call(obj, targetObj) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-2.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 ( length overridden to null (type conversion))",
+ "test": "assertTrue((function testcase() {\n \n var i = Array.prototype.indexOf.call({length: null}, 1);\n \n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.lastIndexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-3.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 (length overridden to false (type conversion))",
+ "test": "assertTrue((function testcase() {\n \n var i = Array.prototype.indexOf.call({length: false}, 1);\n \n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.lastIndexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-4.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 (generic 'array' with length 0 )",
+ "test": "assertTrue((function testcase() {\n \n var i = Array.prototype.lastIndexOf.call({length: 0}, 1);\n \n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.lastIndexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-5.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 ( length overridden to '0' (type conversion))",
+ "test": "assertTrue((function testcase() {\n \n var i = Array.prototype.indexOf.call({length: '0'}, 1);\n \n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.lastIndexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-6.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 (subclassed Array, length overridden with obj with valueOf)",
+ "test": "assertTrue((function testcase() {\n \n var i = Array.prototype.indexOf.call({length: { valueOf: function () { return 0;}}}, 1);\n \n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.lastIndexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-7.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 ( length is object overridden with obj w/o valueOf (toString))",
+ "test": "assertTrue((function testcase() {\n\n \n // objects inherit the default valueOf method of the Object object;\n // that simply returns the itself. Since the default valueOf() method\n // does not return a primitive value, ES next tries to convert the object\n // to a number by calling its toString() method and converting the\n // resulting string to a number.\n var i = Array.prototype.indexOf.call({length: { toString: function () { return '0';}}}, 1);\n \n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.lastIndexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-8.js",
+ "description": "Array.prototype.indexOf returns -1 if 'length' is 0 (length is an empty array)",
+ "test": "assertTrue((function testcase() {\n\n \n // objects inherit the default valueOf method of the Object object;\n // that simply returns the itself. Since the default valueOf() method\n // does not return a primitive value, ES next tries to convert the object\n // to a number by calling its toString() method and converting the\n // resulting string to a number.\n //\n // The toString( ) method on Array converts the array elements to strings,\n // then returns the result of concatenating these strings, with commas in\n // between. An array with no elements converts to the empty string, which\n // converts to the number 0. If an array has a single element that is a\n // number n, the array converts to a string representation of n, which is\n // then converted back to n itself. If an array contains more than one element,\n // or if its one element is not a number, the array converts to NaN.\n var i = Array.prototype.indexOf.call({length: [ ]}, 1);\n \n if (i === -1) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.lastIndexOf))"
+ },
+ {
+ "id": "15.4.4.14-4-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-9.js",
+ "description": "Array.prototype.indexOf - 'length' is a number of value 0.1",
+ "test": "assertTrue((function testcase() {\n var targetObj = [];\n var obj = { 0: targetObj, 100: targetObj, length: 0.1 };\n return Array.prototype.indexOf.call(obj, targetObj) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-1.js",
+ "description": "Array.prototype.indexOf when fromIndex is string",
+ "test": "assertTrue((function testcase() {\n var a = [1,2,1,2,1,2];\n if (a.indexOf(2,\"2\") === 3 && // \"2\" resolves to 2 \n a.indexOf(2,\"one\") === 1) { // \"one\" resolves to 0\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-10.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is positive number)",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n return [0, targetObj, 2].indexOf(targetObj, 2) === -1 &&\n [0, 1, targetObj].indexOf(targetObj, 2) === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-11.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is negative number)",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n return [0, targetObj, 2].indexOf(targetObj, -1) === -1 &&\n [0, 1, targetObj].indexOf(targetObj, -1) === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-12",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-12.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is Infinity)",
+ "test": "assertTrue((function testcase() {\n var arr = [];\n arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type\n return arr.indexOf(true, Infinity) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-13",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-13.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is -Infinity)",
+ "test": "assertTrue(([true].indexOf(true, -Infinity) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-14",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-14.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is NaN)",
+ "test": "assertTrue(([true].indexOf(true, NaN) === 0 && [true].indexOf(true, -NaN) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-15",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-15.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a string containing a negative number",
+ "test": "assertTrue(([0, true, 2].indexOf(true, \"-1\") === -1 &&\n [0, 1, true].indexOf(true, \"-1\") === 2));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-16",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-16.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a string containing Infinity",
+ "test": "assertTrue((function testcase() {\n var arr = [];\n arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type\n return arr.indexOf(true, \"Infinity\") === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-17",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-17.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a string containing -Infinity",
+ "test": "assertTrue(([true].indexOf(true, \"-Infinity\") === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-18",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-18.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a string containing an exponential number",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n return [0, 1, targetObj, 3, 4].indexOf(targetObj, \"3E0\") === -1 &&\n [0, 1, 2, targetObj, 4].indexOf(targetObj, \"3E0\") === 3;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-19",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-19.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a string containing a hex number",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n return [0, 1, targetObj, 3, 4].indexOf(targetObj, \"0x0003\") === -1 &&\n [0, 1, 2, targetObj, 4].indexOf(targetObj, \"0x0003\") === 3;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-2.js",
+ "description": "Array.prototype.indexOf when fromIndex is floating point number",
+ "test": "assertTrue((function testcase() {\n var a = new Array(1,2,3);\n if (a.indexOf(3,0.49) === 2 && // 0.49 resolves to 0\n a.indexOf(1,0.51) === 0 && // 0.51 resolves to 0\n a.indexOf(1,1.51) === -1) { // 1.01 resolves to 1\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-20",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-20.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' which is a string containing a number with leading zeros",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n return [0, 1, targetObj, 3, 4].indexOf(targetObj, \"0003.10\") === -1 &&\n [0, 1, 2, targetObj, 4].indexOf(targetObj, \"0003.10\") === 3;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-21",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-21.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is an Object, which has an own toString method",
+ "test": "assertTrue((function testcase() {\n\n // objects inherit the default valueOf() method from Object\n // that simply returns itself. Since the default valueOf() method\n // does not return a primitive value, ES next tries to convert the object\n // to a number by calling its toString() method and converting the\n // resulting string to a number.\n var fromIndex = {\n toString: function () {\n return '1';\n }\n };\n\n return [0, true].indexOf(true, fromIndex) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-22",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-22.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is an Object, which has an own valueOf method",
+ "test": "assertTrue((function testcase() {\n\n var fromIndex = {\n valueOf: function () {\n return 1;\n }\n };\n\n\n return [0, true].indexOf(true, fromIndex) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-23",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-23.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is an object that has an own valueOf method that returns an object and toString method that returns a string",
+ "test": "assertTrue((function testcase() {\n\n var toStringAccessed = false;\n var valueOfAccessed = false;\n\n var fromIndex = {\n toString: function () {\n toStringAccessed = true;\n return '1';\n },\n\n valueOf: function () {\n valueOfAccessed = true;\n return {};\n }\n };\n\n return [0, true].indexOf(true, fromIndex) === 1 && toStringAccessed && valueOfAccessed;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-24",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-24.js",
+ "description": "Array.prototype.indexOf throws TypeError exception when value of 'fromIndex' is an object with toString and valueOf methods that don�t return primitive values",
+ "test": "assertTrue((function testcase() {\n\n var toStringAccessed = false;\n var valueOfAccessed = false;\n var fromIndex = {\n toString: function () {\n toStringAccessed = true;\n return {};\n },\n\n valueOf: function () {\n valueOfAccessed = true;\n return {};\n }\n };\n\n try {\n [0, true].indexOf(true, fromIndex);\n return false;\n } catch (e) {\n return toStringAccessed && valueOfAccessed;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-25",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-25.js",
+ "description": "Array.prototype.indexOf uses inherited valueOf method when value of 'fromIndex' is an object with an own toString and inherited valueOf methods",
+ "test": "assertTrue((function testcase() {\n\n var toStringAccessed = false;\n var valueOfAccessed = false;\n\n var proto = {\n valueOf: function () {\n valueOfAccessed = true;\n return 1;\n }\n };\n\n var Con = function () {};\n Con.prototype = proto;\n\n var child = new Con();\n child.toString = function () {\n toStringAccessed = true;\n return 2;\n };\n\n return [0, true].indexOf(true, child) === 1 && valueOfAccessed && !toStringAccessed;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-26",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-26.js",
+ "description": "Array.prototype.indexOf - side effects produced by step 2 are visible when an exception occurs",
+ "test": "assertTrue((function testcase() {\n var stepTwoOccurs = false;\n var stepFiveOccurs = false;\n\n var obj = {};\n\n Object.defineProperty(obj, \"length\", {\n get: function () {\n stepTwoOccurs = true;\n if (stepFiveOccurs) {\n throw new Error(\"Step 5 occurred out of order\");\n }\n return 20;\n },\n configurable: true\n });\n\n var fromIndex = {\n valueOf: function () {\n stepFiveOccurs = true;\n return 0;\n }\n };\n\n try {\n Array.prototype.indexOf.call(obj, undefined, fromIndex);\n return stepTwoOccurs && stepFiveOccurs;\n } catch (ex) {\n return false;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-5-27",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-27.js",
+ "description": "Array.prototype.indexOf - side effects produced by step 3 are visible when an exception occurs",
+ "test": "assertTrue((function testcase() {\n var stepThreeOccurs = false;\n var stepFiveOccurs = false;\n\n var obj = {};\n\n Object.defineProperty(obj, \"length\", {\n get: function () {\n return {\n valueOf: function () {\n stepThreeOccurs = true;\n if (stepFiveOccurs) {\n throw new Error(\"Step 5 occurred out of order\");\n }\n return 20;\n }\n };\n },\n configurable: true\n });\n\n var fromIndex = {\n valueOf: function () {\n stepFiveOccurs = true;\n return 0;\n }\n };\n\n try {\n Array.prototype.indexOf.call(obj, undefined, fromIndex);\n return stepThreeOccurs && stepFiveOccurs;\n } catch (ex) {\n return false;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-5-28",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-28.js",
+ "description": "Array.prototype.indexOf - side effects produced by step 1 are visible when an exception occurs",
+ "test": "assertTrue((function testcase() {\n\n var stepFiveOccurs = false;\n var fromIndex = {\n valueOf: function () {\n stepFiveOccurs = true;\n return 0;\n }\n };\n\n try {\n Array.prototype.indexOf.call(undefined, undefined, fromIndex);\n return false;\n } catch (e) {\n return (e instanceof TypeError) && !stepFiveOccurs;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-29",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-29.js",
+ "description": "Array.prototype.indexOf - side effects produced by step 2 are visible when an exception occurs",
+ "test": "assertTrue((function testcase() {\n\n var stepFiveOccurs = false;\n \n var obj = {};\n Object.defineProperty(obj, \"length\", {\n get: function () {\n throw new RangeError();\n },\n configurable: true\n });\n\n var fromIndex = {\n valueOf: function () {\n stepFiveOccurs = true;\n return 0;\n }\n };\n\n try {\n Array.prototype.indexOf.call(obj, undefined, fromIndex);\n return false;\n } catch (e) {\n return (e instanceof RangeError) && !stepFiveOccurs;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-5-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-3.js",
+ "description": "Array.prototype.indexOf when fromIndex is boolean",
+ "test": "assertTrue((function testcase() {\n var a = [1,2,3];\n if (a.indexOf(1,true) === -1 && // true resolves to 1\n a.indexOf(1,false) === 0 ) { // false resolves to 0\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-30",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-30.js",
+ "description": "Array.prototype.indexOf - side effects produced by step 3 are visible when an exception occurs",
+ "test": "assertTrue((function testcase() {\n\n var stepFiveOccurs = false;\n\n var obj = {};\n Object.defineProperty(obj, \"length\", {\n get: function () {\n return {\n valueOf: function () {\n throw new TypeError();\n }\n };\n },\n configurable: true\n });\n\n var fromIndex = {\n valueOf: function () {\n stepFiveOccurs = true;\n return 0;\n }\n };\n\n try {\n Array.prototype.indexOf.call(obj, undefined, fromIndex);\n return false;\n } catch (e) {\n return (e instanceof TypeError) && !stepFiveOccurs;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-5-31",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-31.js",
+ "description": "Array.prototype.indexOf - 'fromIndex' is a positive non-integer, verify truncation occurs in the proper direction",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n return [0, targetObj, 2].indexOf(targetObj, 2.5) === -1 &&\n [0, 1, targetObj].indexOf(targetObj, 2.5) === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-32",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-32.js",
+ "description": "Array.prototype.indexOf - 'fromIndex' is a negative non-integer, verify truncation occurs in the proper direction",
+ "test": "assertTrue((function testcase() {\n var targetObj = {};\n return [0, targetObj, 2].indexOf(targetObj, -1.5) === -1 &&\n [0, 1, targetObj].indexOf(targetObj, -1.5) === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-33",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-33.js",
+ "description": "Array.prototype.indexOf match on the first element, a middle element and the last element when 'fromIndex' is passed",
+ "test": "assertTrue(([0, 1, 2, 3, 4].indexOf(0, 0) === 0 &&\n [0, 1, 2, 3, 4].indexOf(2, 1) === 2 &&\n [0, 1, 2, 3, 4].indexOf(2, 2) === 2 &&\n [0, 1, 2, 3, 4].indexOf(4, 2) === 4 &&\n [0, 1, 2, 3, 4].indexOf(4, 4) === 4));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-4.js",
+ "description": "Array.prototype.indexOf returns 0 if fromIndex is 'undefined'",
+ "test": "assertTrue((function testcase() {\n var a = [1,2,3];\n if (a.indexOf(1,undefined) === 0) { // undefined resolves to 0\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-5.js",
+ "description": "Array.prototype.indexOf returns 0 if fromIndex is null",
+ "test": "assertTrue((function testcase() {\n var a = [1,2,3];\n if (a.indexOf(1,null) === 0 ) { // null resolves to 0\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-6.js",
+ "description": "Array.prototype.indexOf - 'fromIndex' isn't passed",
+ "test": "assertTrue((function testcase() {\n var arr = [0, 1, 2, 3, 4];\n //'fromIndex' will be set as 0 if not passed by default\n return arr.indexOf(0) === arr.indexOf(0, 0) &&\n arr.indexOf(2) === arr.indexOf(2, 0) &&\n arr.indexOf(4) === arr.indexOf(4, 0); \n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-7.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is 0)",
+ "test": "assertTrue(([true].indexOf(true, 0) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-8.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is +0)",
+ "test": "assertTrue(([true].indexOf(true, +0) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-5-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-9.js",
+ "description": "Array.prototype.indexOf - value of 'fromIndex' is a number (value is -0)",
+ "test": "assertTrue(([true].indexOf(true, -0) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-6-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-6-1.js",
+ "description": "Array.prototype.indexOf returns -1 if fromIndex is greater than Array length",
+ "test": "assertTrue((function testcase() {\n var a = [1,2,3];\n if (a.indexOf(1,5) === -1 && \n a.indexOf(1,3) === -1 &&\n [ ].indexOf(1,0) === -1 ){\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-7-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-1.js",
+ "description": "Array.prototype.indexOf returns -1 when 'fromIndex' is length of array - 1",
+ "test": "assertTrue(([1, 2, 3].indexOf(1, 2) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-7-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-2.js",
+ "description": "Array.prototype.indexOf returns correct index when 'fromIndex' is length of array - 1",
+ "test": "assertTrue(([1, 2, 3].indexOf(3, 2) === 2));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-7-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-3.js",
+ "description": "Array.prototype.indexOf returns -1 when 'fromIndex' and 'length' are both 0",
+ "test": "assertTrue(([].indexOf(1, 0) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-7-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-4.js",
+ "description": "Array.prototype.indexOf returns -1 when 'fromIndex' is 1",
+ "test": "assertTrue(([1, 2, 3].indexOf(1, 1) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-7-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-5.js",
+ "description": "Array.prototype.indexOf returns correct index when 'fromIndex' is 1",
+ "test": "assertTrue(([1, 2, 3].indexOf(2, 1) === 1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-8-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-1.js",
+ "description": "Array.prototype.indexOf with negative fromIndex",
+ "test": "assertTrue((function testcase() {\n var a = new Array(1,2,3);\n \n if (a.indexOf(2,-1) === -1 && \n a.indexOf(2,-2) === 1 && \n a.indexOf(1,-3) === 0 && \n a.indexOf(1,-5.3) === 0 ) {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-8-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-2.js",
+ "description": "Array.prototype.indexOf returns correct index when 'fromIndex' is -1",
+ "test": "assertTrue(([1, 2, 3, 4].indexOf(4, -1) === 3));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-8-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-3.js",
+ "description": "Array.prototype.indexOf returns -1 when abs('fromIndex') is length of array - 1",
+ "test": "assertTrue(([1, 2, 3, 4].indexOf(1, -3) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-8-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-4.js",
+ "description": "Array.prototype.indexOf returns -1 when abs('fromIndex') is length of array",
+ "test": "assertTrue(([1, 2, 3, 4].indexOf(0, -4) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-1.js",
+ "description": "Array.prototype.indexOf must return correct index (boolean)",
+ "test": "assertTrue((function testcase() {\n var obj = {toString:function (){return true}};\n var _false = false;\n var a = [obj,\"true\", undefined,0,_false,null,1,\"str\",0,1,true,false,true,false];\n if (a.indexOf(true) === 10 && //a[10]=true\n a.indexOf(false) === 4) //a[4] =_false\n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-10.js",
+ "description": "Array.prototype.indexOf must return correct index (NaN)",
+ "test": "assertTrue((function testcase() {\n var _NaN = NaN;\n var a = new Array(\"NaN\",undefined,0,false,null,{toString:function (){return NaN}},\"false\",_NaN,NaN);\n if (a.indexOf(NaN) === -1) // NaN is equal to nothing, including itself.\n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-11.js",
+ "description": "Array.prototype.indexOf - the length of iteration isn't changed by adding elements to the array during iteration",
+ "test": "assertTrue((function testcase() {\n\n var arr = [20];\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n arr[1] = 1;\n return 0;\n },\n configurable: true\n });\n\n return arr.indexOf(1) === -1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js",
+ "description": "Array.prototype.indexOf must return correct index (Number)",
+ "test": "assertTrue((function testcase() {\n var obj = {toString:function (){return 0}};\n var one = 1;\n var _float = -(4/3);\n var a = new Array(false,undefined,null,\"0\",obj,-1.3333333333333, \"str\",-0,true,+0, one, 1,0, false, _float, -(4/3));\n if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3)\n a.indexOf(0) === 7 && // a[7] = +0, 0===+0\n a.indexOf(-0) === 7 && // a[7] = +0, -0===+0\n a.indexOf(1) === 10 ) // a[10] =one=== 1\n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-3.js",
+ "description": "Array.prototype.indexOf must return correct index(string)",
+ "test": "assertTrue((function testcase() {\n var obj = {toString:function (){return \"false\"}};\n var szFalse = \"false\";\n var a = new Array(\"false1\",undefined,0,false,null,1,obj,0,szFalse, \"false\");\n if (a.indexOf(\"false\") === 8) //a[8]=szFalse\n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-4.js",
+ "description": "Array.prototype.indexOf must return correct index(undefined)",
+ "test": "assertTrue((function testcase() {\n var obj = {toString:function (){return undefined;}};\n var _undefined1 = undefined;\n var _undefined2;\n var a = new Array(true,0,false,null,1,\"undefined\",obj,1,_undefined2,_undefined1,undefined);\n if (a.indexOf(undefined) === 8) //a[8]=_undefined2\n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-5.js",
+ "description": "Array.prototype.indexOf must return correct index (Object)",
+ "test": "assertTrue((function testcase() {\n var obj1 = {toString:function (){return \"false\"}};\n var obj2 = {toString:function (){return \"false\"}};\n var obj3 = obj1;\n var a = new Array(false,undefined,0,false,null,{toString:function (){return \"false\"}},\"false\",obj2,obj1,obj3);\n if (a.indexOf(obj3) === 8) //a[8] = obj1;\n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-6.js",
+ "description": "Array.prototype.indexOf must return correct index(null)",
+ "test": "assertTrue((function testcase() {\n var obj = {toString:function (){return null}};\n var _null = null;\n var a = new Array(true,undefined,0,false,_null,1,\"str\",0,1,obj,true,false,null);\n if (a.indexOf(null) === 4 ) //a[4]=_null\n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-7.js",
+ "description": "Array.prototype.indexOf must return correct index (self reference)",
+ "test": "assertTrue((function testcase() {\n var a = new Array(0,1,2,3); \n a[2] = a;\n if (a.indexOf(a) === 2 && \n a.indexOf(3) === 3 ) \n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-8.js",
+ "description": "Array.prototype.indexOf must return correct index (Array)",
+ "test": "assertTrue((function testcase() {\n var b = new Array(\"0,1\"); \n var a = new Array(0,b,\"0,1\",3); \n if (a.indexOf(b.toString()) === 2 && \n a.indexOf(\"0,1\") === 2 ) \n {\n return true;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-9.js",
+ "description": "Array.prototype.indexOf must return correct index (Sparse Array)",
+ "test": "assertTrue((function testcase() {\n var a = new Array(0,1); \n a[4294967294] = 2; // 2^32-2 - is max array element\n a[4294967295] = 3; // 2^32-1 added as non-array element property\n a[4294967296] = 4; // 2^32 added as non-array element property\n a[4294967297] = 5; // 2^32+1 added as non-array element property\n\n // start searching near the end so in case implementation actually tries to test all missing elements!!\n return (a.indexOf(2,4294967290 ) === 4294967294 && \n a.indexOf(3,4294967290) === -1 && \n a.indexOf(4,4294967290) === -1 && \n a.indexOf(5,4294967290) === -1 ) ;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-a-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-1.js",
+ "description": "Array.prototype.indexOf - added properties in step 2 are visible here",
+ "test": "assertTrue((function testcase() {\n\n var arr = { };\n\n Object.defineProperty(arr, \"length\", {\n get: function () {\n arr[2] = \"length\";\n return 3;\n },\n configurable: true\n });\n\n return 2 === Array.prototype.indexOf.call(arr, \"length\");\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-9-a-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-10.js",
+ "description": "Array.prototype.indexOf - properties can be added to prototype after current position are visited on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [0, , 2];\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n Object.defineProperty(Array.prototype, \"1\", {\n get: function () {\n return 6.99;\n },\n configurable: true\n });\n return 0;\n },\n configurable: true\n });\n\n try {\n return arr.indexOf(6.99) === 1;\n } finally {\n delete Array.prototype[1];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-11.js",
+ "description": "Array.prototype.indexOf - deleting own property causes index property not to be visited on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var arr = { length: 2 };\n\n Object.defineProperty(arr, \"1\", {\n get: function () {\n return 6.99;\n },\n configurable: true\n });\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n delete arr[1];\n return 0;\n },\n configurable: true\n });\n\n return -1 === Array.prototype.indexOf.call(arr, 6.99);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-a-12",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-12.js",
+ "description": "Array.prototype.indexOf - deleting own property causes index property not to be visited on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [1, 2];\n\n Object.defineProperty(arr, \"1\", {\n get: function () {\n return \"6.99\";\n },\n configurable: true\n });\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n delete arr[1];\n return 0;\n },\n configurable: true\n });\n\n return -1 === arr.indexOf(\"6.99\");\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-13",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-13.js",
+ "description": "Array.prototype.indexOf - deleting property of prototype causes prototype index property not to be visited on an Array-like Object",
+ "test": "assertTrue((function testcase() {\n\n var arr = { 2: 2, length: 20 };\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n delete Object.prototype[1];\n return 0;\n },\n configurable: true\n });\n\n try {\n Object.prototype[1] = 1;\n return -1 === Array.prototype.indexOf.call(arr, 1);\n } finally {\n delete Object.prototype[1];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-a-14",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-14.js",
+ "description": "Array.prototype.indexOf - deleting property of prototype causes prototype index property not to be visited on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [0, , 2];\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n delete Array.prototype[1];\n return 0;\n },\n configurable: true\n });\n\n try {\n Array.prototype[1] = 1;\n return -1 === arr.indexOf(1);\n } finally {\n delete Array.prototype[1];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-15",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-15.js",
+ "description": "Array.prototype.indexOf - deleting own property with prototype property causes prototype index property to be visited on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var arr = { 0: 0, 1: 111, 2: 2, length: 10 };\n \n Object.defineProperty(arr, \"0\", {\n get: function () {\n delete arr[1];\n return 0;\n },\n configurable: true\n });\n\n try {\n Object.prototype[1] = 1;\n return 1 === Array.prototype.indexOf.call(arr, 1);\n } finally {\n delete Object.prototype[1];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-a-16",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-16.js",
+ "description": "Array.prototype.indexOf - deleting own property with prototype property causes prototype index property to be visited on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [0, 111, 2]; \n \n Object.defineProperty(arr, \"0\", {\n get: function () {\n delete arr[1];\n return 0;\n },\n configurable: true\n });\n\n try {\n Array.prototype[1] = 1;\n return 1 === arr.indexOf(1);\n } finally {\n delete Array.prototype[1];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-17",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-17.js",
+ "description": "Array.prototype.indexOf - decreasing length of array causes index property not to be visited",
+ "test": "assertTrue((function testcase() {\n\n var arr = [0, 1, 2, \"last\"];\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n arr.length = 3;\n return 0;\n },\n configurable: true\n });\n\n return -1 === arr.indexOf(\"last\");\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-18",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-18.js",
+ "description": "Array.prototype.indexOf - decreasing length of array with prototype property causes prototype index property to be visited",
+ "test": "assertTrue((function testcase() {\n\n var arr = [0, 1, 2];\n\n try {\n Object.defineProperty(Array.prototype, \"2\", {\n get: function () {\n return \"prototype\";\n },\n configurable: true\n });\n\n Object.defineProperty(arr, \"1\", {\n get: function () {\n arr.length = 2;\n return 1;\n },\n configurable: true\n });\n\n return 2 === arr.indexOf(\"prototype\");\n } finally {\n delete Array.prototype[2];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-19",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-19.js",
+ "description": "Array.prototype.indexOf - decreasing length of array does not delete non-configurable properties",
+ "test": "assertTrue((function testcase() {\n\n var arr = [0, 1, 2];\n\n Object.defineProperty(arr, \"2\", {\n get: function () {\n return \"unconfigurable\";\n },\n configurable: false\n });\n\n Object.defineProperty(arr, \"1\", {\n get: function () {\n arr.length = 2;\n return 1;\n },\n configurable: true\n });\n \n return 2 === arr.indexOf(\"unconfigurable\");\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-2.js",
+ "description": "Array.prototype.indexOf - added properties in step 5 are visible here on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var arr = { length: 30 };\n var targetObj = function () { };\n\n var fromIndex = {\n valueOf: function () {\n arr[4] = targetObj;\n return 3;\n }\n };\n \n return 4 === Array.prototype.indexOf.call(arr, targetObj, fromIndex);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-a-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-3.js",
+ "description": "Array.prototype.indexOf - added properties in step 5 are visible here on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [];\n arr.length = 30;\n var targetObj = function () { };\n\n var fromIndex = {\n valueOf: function () {\n arr[4] = targetObj;\n return 3;\n }\n };\n\n return 4 === arr.indexOf(targetObj, fromIndex);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-a-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-4.js",
+ "description": "Array.prototype.indexOf - deleted properties in step 2 are visible here",
+ "test": "assertTrue((function testcase() {\n\n var arr = { 2: 6.99 };\n\n Object.defineProperty(arr, \"length\", {\n get: function () {\n delete arr[2];\n return 3;\n },\n configurable: true\n });\n\n return -1 === Array.prototype.indexOf.call(arr, 6.99);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty))"
+ },
+ {
+ "id": "15.4.4.14-9-a-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-5.js",
+ "description": "Array.prototype.indexOf - deleted properties in step 5 are visible here on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var arr = { 10: false, length: 30 };\n\n var fromIndex = {\n valueOf: function () {\n delete arr[10];\n return 3;\n }\n };\n\n return -1 === Array.prototype.indexOf.call(arr, false, fromIndex);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-a-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-6.js",
+ "description": "Array.prototype.indexOf - deleted properties in step 5 are visible here on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [];\n arr[10] = \"10\";\n arr.length = 20;\n\n var fromIndex = {\n valueOf: function () {\n delete arr[10];\n return 3;\n }\n };\n\n return -1 === arr.indexOf(\"10\", fromIndex);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-a-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-7.js",
+ "description": "Array.prototype.indexOf - properties added into own object after current position are visited on an Array-like object",
+ "test": "assertTrue((function testcase() {\n \n var arr = { length: 2 };\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n Object.defineProperty(arr, \"1\", {\n get: function () {\n return 1;\n },\n configurable: true\n });\n return 0;\n },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(arr, 1) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-a-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-8.js",
+ "description": "Array.prototype.indexOf - properties added into own object after current position are visited on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [0, , 2];\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n Object.defineProperty(arr, \"1\", {\n get: function () {\n return 1;\n },\n configurable: true\n });\n return 0;\n },\n configurable: true\n });\n\n return arr.indexOf(1) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-a-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-9.js",
+ "description": "Array.prototype.indexOf - properties can be added to prototype after current position are visited on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var arr = { length: 2 };\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n Object.defineProperty(Object.prototype, \"1\", {\n get: function () {\n return 6.99;\n },\n configurable: true\n });\n return 0;\n },\n configurable: true\n });\n\n try {\n return Array.prototype.indexOf.call(arr, 6.99) === 1;\n } finally {\n delete Object.prototype[1];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-1.js",
+ "description": "Array.prototype.indexOf - non-existent property wouldn't be called",
+ "test": "assertTrue(([0, , 2].indexOf(undefined) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-1.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own data property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n var obj = { 0: 0, 1: 1, 2: 2, length: 3 };\n return Array.prototype.indexOf.call(obj, 0) === 0 &&\n Array.prototype.indexOf.call(obj, 1) === 1 &&\n Array.prototype.indexOf.call(obj, 2) === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-10.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var obj = { length: 3 };\n Object.defineProperty(obj, \"0\", {\n get: function () {\n return 0;\n },\n configurable: true\n });\n\n Object.defineProperty(obj, \"1\", {\n get: function () {\n return 1;\n },\n configurable: true\n });\n\n Object.defineProperty(obj, \"2\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n return 0 === Array.prototype.indexOf.call(obj, 0) &&\n 1 === Array.prototype.indexOf.call(obj, 1) &&\n 2 === Array.prototype.indexOf.call(obj, 2);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-11.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [];\n try {\n Array.prototype[0] = false;\n Object.defineProperty(arr, \"0\", {\n get: function () {\n return true;\n },\n configurable: true\n });\n\n return 0 === arr.indexOf(true);\n } finally {\n delete Array.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-12",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-12.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n var obj = { length: 1 };\n\n try {\n Object.prototype[0] = false;\n Object.defineProperty(obj, \"0\", {\n get: function () {\n return true;\n },\n configurable: true\n });\n\n return 0 === Array.prototype.indexOf.call(obj, true);\n } finally {\n delete Object.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-13",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-13.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [];\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n get: function () {\n return false;\n },\n configurable: true\n });\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n return true;\n },\n configurable: true\n });\n\n return 0 === arr.indexOf(true);\n } finally {\n delete Array.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-14",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-14.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var obj = { length: 1 };\n\n try {\n Object.defineProperty(Object.prototype, \"0\", {\n get: function () {\n return false;\n },\n configurable: true\n });\n\n Object.defineProperty(obj, \"0\", {\n get: function () {\n return true;\n },\n configurable: true\n });\n\n return 0 === Array.prototype.indexOf.call(obj, true);\n } finally {\n delete Object.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-15",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-15.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is inherited accessor property on an Array",
+ "test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n get: function () {\n return 10;\n },\n configurable: true\n });\n\n Object.defineProperty(Array.prototype, \"1\", {\n get: function () {\n return 20;\n },\n configurable: true\n });\n\n Object.defineProperty(Array.prototype, \"2\", {\n get: function () {\n return 30;\n },\n configurable: true\n });\n\n return 0 === [, , , ].indexOf(10) &&\n 1 === [, , , ].indexOf(20) && \n 2 === [, , , ].indexOf(30);\n } finally {\n delete Array.prototype[0];\n delete Array.prototype[1]; \n delete Array.prototype[2];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-16",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-16.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is inherited accessor property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n try {\n Object.defineProperty(Object.prototype, \"0\", {\n get: function () {\n return 10;\n },\n configurable: true\n });\n\n Object.defineProperty(Object.prototype, \"1\", {\n get: function () {\n return 20;\n },\n configurable: true\n });\n\n Object.defineProperty(Object.prototype, \"2\", {\n get: function () {\n return 30;\n },\n configurable: true\n });\n\n return 0 === Array.prototype.indexOf.call({ length: 3 }, 10) &&\n 1 === Array.prototype.indexOf.call({ length: 3 }, 20) &&\n 2 === Array.prototype.indexOf.call({ length: 3 }, 30);\n } finally {\n delete Object.prototype[0];\n delete Object.prototype[1];\n delete Object.prototype[2];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-17",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-17.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property without a get function on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [];\n Object.defineProperty(arr, \"0\", {\n set: function () { },\n configurable: true\n });\n\n return arr.indexOf(undefined) === 0;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-18",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-18.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property without a get function on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var obj = { length: 1 };\n Object.defineProperty(obj, \"0\", {\n set: function () { },\n configurable: true\n });\n\n return 0 === Array.prototype.indexOf.call(obj, undefined);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-19",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-19.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [];\n\n Object.defineProperty(arr, \"0\", {\n set: function () { },\n configurable: true\n });\n\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n return arr.indexOf(undefined) === 0;\n } finally {\n delete Array.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-2.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own data property on an Array",
+ "test": "assertTrue(([true, true, true].indexOf(true) === 0 &&\n [false, true, true].indexOf(true) === 1 &&\n [false, false, true].indexOf(true) === 2));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-20",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-20.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var proto = {};\n Object.defineProperty(proto, \"0\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n var Con = function () { };\n Con.prototype = proto;\n\n var child = new Con();\n child.length = 1;\n\n Object.defineProperty(child, \"0\", {\n set: function () { },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(child, undefined) === 0;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-21",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-21.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is inherited accessor property without a get function on an Array",
+ "test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n set: function () { },\n configurable: true\n });\n return 0 === [, ].indexOf(undefined);\n } finally {\n delete Array.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && ![, 1].hasOwnProperty(0) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-22",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-22.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is inherited accessor property without a get function on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n try {\n Object.defineProperty(Object.prototype, \"0\", {\n set: function () { },\n configurable: true\n });\n return 0 === Array.prototype.indexOf.call({ length: 1 }, undefined);\n } finally {\n delete Object.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-23",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-23.js",
+ "description": "Array.prototype.indexOf - This object is the global object",
+ "test": "assertTrue((function testcase() {\n\n var targetObj = {};\n try {\n var oldLen = fnGlobalObject().length;\n fnGlobalObject()[0] = targetObj;\n fnGlobalObject()[100] = \"100\";\n fnGlobalObject()[200] = \"200\";\n fnGlobalObject().length = 200;\n return 0 === Array.prototype.indexOf.call(fnGlobalObject(), targetObj) &&\n 100 === Array.prototype.indexOf.call(fnGlobalObject(), \"100\") &&\n -1 === Array.prototype.indexOf.call(fnGlobalObject(), \"200\");\n } finally {\n delete fnGlobalObject()[0];\n delete fnGlobalObject()[100];\n delete fnGlobalObject()[200];\n fnGlobalObject().length = oldLen;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-25",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-25.js",
+ "description": "Array.prototype.indexOf applied to Arguments object which implements its own property get method (number of arguments is less than number of parameters)",
+ "test": "assertTrue((function testcase() {\n\n var func = function (a, b) {\n return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) &&\n -1 === Array.prototype.indexOf.call(arguments, arguments[1]);\n };\n\n return func(true);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-26",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-26.js",
+ "description": "Array.prototype.indexOf applied to Arguments object which implements its own property get method (number of arguments equals to number of parameters)",
+ "test": "assertTrue((function testcase() {\n\n var func = function (a, b) {\n return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) &&\n 1 === Array.prototype.indexOf.call(arguments, arguments[1]) &&\n -1 === Array.prototype.indexOf.call(arguments, arguments[2]);\n };\n\n return func(0, true);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-27",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-27.js",
+ "description": "Array.prototype.indexOf applied to Arguments object which implements its own property get method (number of arguments is greater than number of parameters)",
+ "test": "assertTrue((function testcase() {\n\n var func = function (a, b) {\n return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) &&\n 3 === Array.prototype.indexOf.call(arguments, arguments[3]) &&\n -1 === Array.prototype.indexOf.call(arguments, arguments[4]);\n };\n\n return func(0, false, 0, true);\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-28",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-28.js",
+ "description": "Array.prototype.indexOf - side-effects are visible in subsequent iterations on an Array",
+ "test": "assertTrue((function testcase() {\n\n var preIterVisible = false;\n var arr = [];\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n preIterVisible = true;\n return false;\n },\n configurable: true\n });\n\n Object.defineProperty(arr, \"1\", {\n get: function () {\n if (preIterVisible) {\n return true;\n } else {\n return false;\n }\n },\n configurable: true\n });\n\n return arr.indexOf(true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-29",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-29.js",
+ "description": "Array.prototype.indexOf - side-effects are visible in subsequent iterations on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var preIterVisible = false;\n var obj = { length: 2 };\n\n Object.defineProperty(obj, \"0\", {\n get: function () {\n preIterVisible = true;\n return false;\n },\n configurable: true\n });\n\n Object.defineProperty(obj, \"1\", {\n get: function () {\n if (preIterVisible) {\n return true;\n } else {\n return false;\n }\n },\n configurable: true\n });\n\n return Array.prototype.indexOf.call(obj, true) === 1;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-3.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited data property on an Array",
+ "test": "assertTrue((function testcase() {\n try {\n Array.prototype[0] = false;\n return [true].indexOf(true) === 0;\n } finally {\n delete Array.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-30",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-30.js",
+ "description": "Array.prototype.indexOf - terminates iteration on unhandled exception on an Array",
+ "test": "assertTrue((function testcase() {\n\n var accessed = false;\n var arr = [];\n\n Object.defineProperty(arr, \"0\", {\n get: function () {\n throw new TypeError();\n },\n configurable: true\n });\n\n Object.defineProperty(arr, \"1\", {\n get: function () {\n accessed = true;\n return true;\n },\n configurable: true\n });\n\n try {\n arr.indexOf(true);\n return false;\n } catch (e) {\n return (e instanceof TypeError) && !accessed;\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-31",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-31.js",
+ "description": "Array.prototype.indexOf - terminates iteration on unhandled exception on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n var accessed = false;\n var obj = { length: 2 };\n\n Object.defineProperty(obj, \"0\", {\n get: function () {\n throw new TypeError();\n },\n configurable: true\n });\n\n Object.defineProperty(obj, \"1\", {\n get: function () {\n accessed = true;\n return true;\n },\n configurable: true\n });\n\n try {\n Array.prototype.indexOf.call(obj, true);\n return false;\n } catch (e) {\n return (e instanceof TypeError) && !accessed;\n }\n\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-4.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited data property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n try {\n Object.prototype[0] = false;\n return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true);\n } finally {\n delete Object.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-5.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array",
+ "test": "assertTrue((function testcase() {\n try {\n Object.defineProperty(Array.prototype, \"0\", {\n get: function () {\n return false;\n },\n configurable: true\n });\n return 0 === [true].indexOf(true);\n } finally {\n delete Array.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-6.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n try {\n Object.defineProperty(Object.prototype, \"0\", {\n get: function () {\n return false;\n },\n configurable: true\n });\n return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true);\n } finally {\n delete Object.prototype[0];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects())"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-7.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is inherited data property on an Array",
+ "test": "assertTrue((function testcase() {\n try {\n Array.prototype[0] = true;\n Array.prototype[1] = false;\n Array.prototype[2] = \"true\";\n return 0 === [, , , ].indexOf(true) &&\n 1 === [, , , ].indexOf(false) &&\n 2 === [, , , ].indexOf(\"true\");\n } finally {\n delete Array.prototype[0];\n delete Array.prototype[1];\n delete Array.prototype[2];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && ![, 1].hasOwnProperty(0))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-8.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is inherited data property on an Array-like object",
+ "test": "assertTrue((function testcase() {\n\n try {\n Object.prototype[0] = true;\n Object.prototype[1] = false;\n Object.prototype[2] = \"true\";\n return 0 === Array.prototype.indexOf.call({ length: 3 }, true) &&\n 1 === Array.prototype.indexOf.call({ length: 3 }, false) &&\n 2 === Array.prototype.indexOf.call({ length: 3 }, \"true\");\n } finally {\n delete Object.prototype[0];\n delete Object.prototype[1];\n delete Object.prototype[2];\n }\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-i-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-9.js",
+ "description": "Array.prototype.indexOf - element to be retrieved is own accessor property on an Array",
+ "test": "assertTrue((function testcase() {\n\n var arr = [, , , ];\n Object.defineProperty(arr, \"0\", {\n get: function () {\n return 0;\n },\n configurable: true\n });\n\n Object.defineProperty(arr, \"1\", {\n get: function () {\n return 1;\n },\n configurable: true\n });\n \n Object.defineProperty(arr, \"2\", {\n get: function () {\n return 2;\n },\n configurable: true\n });\n\n return arr.indexOf(0) === 0 && arr.indexOf(1) === 1 && arr.indexOf(2) === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-1.js",
+ "description": "Array.prototype.indexOf - type of array element is different from type of search element",
+ "test": "assertTrue(([\"true\"].indexOf(true) === -1 &&\n [\"0\"].indexOf(0) === -1 &&\n [false].indexOf(0) === -1 &&\n [undefined].indexOf(0) === -1 &&\n [null].indexOf(0) === -1 &&\n [[]].indexOf(0) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-10",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-10.js",
+ "description": "Array.prototype.indexOf - both array element and search element are Boolean type, and they have same value",
+ "test": "assertTrue(([false, true].indexOf(true) === 1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-11",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-11.js",
+ "description": "Array.prototype.indexOf - both array element and search element are Object type, and they refer to the same object",
+ "test": "assertTrue((function testcase() {\n\n var obj1 = {};\n var obj2 = {};\n var obj3 = obj2;\n return [{}, obj1, obj2].indexOf(obj3) === 2;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-2.js",
+ "description": "Array.prototype.indexOf - both type of array element and type of search element are Undefined",
+ "test": "assertTrue(([undefined].indexOf() === 0 && [undefined].indexOf(undefined) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-3",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-3.js",
+ "description": "Array.prototype.indexOf - both type of array element and type of search element are null",
+ "test": "assertTrue(([null].indexOf(null) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-4",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-4.js",
+ "description": "Array.prototype.indexOf - search element is NaN",
+ "test": "assertTrue(([+NaN, NaN, -NaN].indexOf(NaN) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-5",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-5.js",
+ "description": "Array.prototype.indexOf - search element is -NaN",
+ "test": "assertTrue(([+NaN, NaN, -NaN].indexOf(-NaN) === -1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-6",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-6.js",
+ "description": "Array.prototype.indexOf - array element is +0 and search element is -0",
+ "test": "assertTrue(([+0].indexOf(-0) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-7",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-7.js",
+ "description": "Array.prototype.indexOf - array element is -0 and search element is +0",
+ "test": "assertTrue(([-0].indexOf(+0) === 0));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-8",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-8.js",
+ "description": "Array.prototype.indexOf - both array element and search element are Number, and they have same value",
+ "test": "assertTrue(([-1, 0, 1].indexOf(1) === 2));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-ii-9",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-9.js",
+ "description": "Array.prototype.indexOf - both array element and search element are String, and they have exactly the same sequence of characters",
+ "test": "assertTrue(([\"\", \"ab\", \"bca\", \"abc\"].indexOf(\"abc\") === 3));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-iii-1",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-1.js",
+ "description": "Array.prototype.indexOf - returns index of last one when more than two elements in array are eligible",
+ "test": "assertTrue(([1, 2, 2, 1, 2].indexOf(2) === 1));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf))"
+ },
+ {
+ "id": "15.4.4.14-9-b-iii-2",
+ "path": "TestCases/chapter15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-2.js",
+ "description": "Array.prototype.indexOf - returns without visiting subsequent element once search value is found",
+ "test": "assertTrue((function testcase() {\n var arr = [1, 2, , 1, 2];\n var elementThirdAccessed = false;\n var elementFifthAccessed = false;\n\n Object.defineProperty(arr, \"2\", {\n get: function () {\n elementThirdAccessed = true;\n return 2;\n },\n configurable: true\n });\n Object.defineProperty(arr, \"4\", {\n get: function () {\n elementFifthAccessed = true;\n return 2;\n },\n configurable: true\n });\n\n arr.indexOf(2);\n return !elementThirdAccessed && !elementFifthAccessed;\n }).call(this));\n",
+ "precondition": "(fnExists(Array.prototype.indexOf) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnArrays())"
+ }
+ ]
+ }
+}