diff options
Diffstat (limited to 'test/suite/ch15/15.4/15.4.4/15.4.4.14')
193 files changed, 4924 insertions, 4619 deletions
diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-1.js index 4aecf8981..958d39ebf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-1.js @@ -1,18 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var f = Array.prototype.indexOf;
- if (typeof(f) === "function") {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must exist as a function +includes: [runTestCase.js] +---*/ + +function testcase() { + var f = Array.prototype.indexOf; + if (typeof(f) === "function") { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-2.js index 15b39cac0..7e6e9c928 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-0-2.js @@ -1,17 +1,17 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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.
- */
-
-
-function testcase() {
- if (Array.prototype.indexOf.length === 1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf has a length property whose value is 1. +includes: [runTestCase.js] +---*/ + +function testcase() { + if (Array.prototype.indexOf.length === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-1.js index 1e7a5a270..36be30adc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-1.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Array.prototype.indexOf.call(undefined);
- return false;
- }
- catch (e) {
- return e instanceof TypeError;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to undefined throws a TypeError +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.indexOf.call(undefined); + return false; + } + catch (e) { + return e instanceof TypeError; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-10.js index c39c62c64..ce8f27880 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-10.js @@ -1,22 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Math[1] = true;
- Math.length = 2;
- return Array.prototype.indexOf.call(Math, true) === 1;
- } finally {
- delete Math[1];
- delete Math.length;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to the Math object +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Math[1] = true; + Math.length = 2; + return Array.prototype.indexOf.call(Math, true) === 1; + } finally { + delete Math[1]; + delete Math.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-11.js index 8b74af87c..c65b0b2aa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-11.js @@ -1,20 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-11.js
- * @description Array.prototype.indexOf applied to Date object
- */
-
-
-function testcase() {
-
- var obj = new Date();
- obj.length = 2;
- obj[1] = true;
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to Date object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new Date(); + obj.length = 2; + obj[1] = true; + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-12.js index c619cc351..81a42fedb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-12.js @@ -1,20 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-12.js
- * @description Array.prototype.indexOf applied to RegExp object
- */
-
-
-function testcase() {
-
- var obj = new RegExp();
- obj.length = 2;
- obj[1] = true;
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to RegExp object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new RegExp(); + obj.length = 2; + obj[1] = true; + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-13.js index 8e9797dc2..f33a2914f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-13.js @@ -1,23 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- try {
- JSON[3] = targetObj;
- JSON.length = 5;
- return Array.prototype.indexOf.call(JSON, targetObj) === 3;
- } finally {
- delete JSON[3];
- delete JSON.length;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to the JSON object +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + try { + JSON[3] = targetObj; + JSON.length = 5; + return Array.prototype.indexOf.call(JSON, targetObj) === 3; + } finally { + delete JSON[3]; + delete JSON.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-14.js index bcd7cd3de..69c7572c8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-14.js @@ -1,20 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-14.js
- * @description Array.prototype.indexOf applied to Error object
- */
-
-
-function testcase() {
-
- var obj = new SyntaxError();
- obj[1] = true;
- obj.length = 2;
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to Error object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new SyntaxError(); + obj[1] = true; + obj.length = 2; + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-15.js index 11926dffc..a550ecdac 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-15.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-15.js
- * @description Array.prototype.indexOf applied to Arguments object
- */
-
-
-function testcase() {
-
- function fun() {
- return arguments;
- }
- var obj = fun(1, true, 3);
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to Arguments object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function fun() { + return arguments; + } + var obj = fun(1, true, 3); + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-17.js index a66609cd7..476b2d811 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-17.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[1] = true;
- fnGlobalObject().length = 2;
- return Array.prototype.indexOf.call(fnGlobalObject(), true) === 1;
- } finally {
- delete fnGlobalObject()[1];
- fnGlobalObject().length = oldLen;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to the global object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[1] = true; + fnGlobalObject().length = 2; + return Array.prototype.indexOf.call(fnGlobalObject(), true) === 1; + } finally { + delete fnGlobalObject()[1]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-2.js index 944ef47d0..fd1b7b93c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-2.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Array.prototype.indexOf.call(null);
- return false;
- }
- catch (e) {
- return e instanceof TypeError;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to null throws a TypeError +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.indexOf.call(null); + return false; + } + catch (e) { + return e instanceof TypeError; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-3.js index 45077ae0e..086429db7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-3.js @@ -1,24 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-3.js
- * @description Array.prototype.indexOf applied to boolean primitive
- */
-
-
-function testcase() {
- var targetObj = {};
- try {
- Boolean.prototype[1] = targetObj;
- Boolean.prototype.length = 2;
-
- return Array.prototype.indexOf.call(true, targetObj) === 1;
- } finally {
- delete Boolean.prototype[1];
- delete Boolean.prototype.length;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to boolean primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + try { + Boolean.prototype[1] = targetObj; + Boolean.prototype.length = 2; + + return Array.prototype.indexOf.call(true, targetObj) === 1; + } finally { + delete Boolean.prototype[1]; + delete Boolean.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-4.js index a91e92170..5f49b704f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-4.js @@ -1,20 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-4.js
- * @description Array.prototype.indexOf applied to Boolean Object
- */
-
-
-function testcase() {
-
- var obj = new Boolean(false);
- obj.length = 2;
- obj[1] = true;
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to Boolean Object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new Boolean(false); + obj.length = 2; + obj[1] = true; + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-5.js index 1be433cc4..63615a95f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-5.js @@ -1,24 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-5.js
- * @description Array.prototype.indexOf applied to number primitive
- */
-
-
-function testcase() {
- var targetObj = {};
- try {
- Number.prototype[1] = targetObj;
- Number.prototype.length = 2;
-
- return Array.prototype.indexOf.call(5, targetObj) === 1;
- } finally {
- delete Number.prototype[1];
- delete Number.prototype.length;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to number primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + try { + Number.prototype[1] = targetObj; + Number.prototype.length = 2; + + return Array.prototype.indexOf.call(5, targetObj) === 1; + } finally { + delete Number.prototype[1]; + delete Number.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-6.js index 988a3fc52..1c2c5a356 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-6.js @@ -1,20 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-6.js
- * @description Array.prototype.indexOf applied to Number object
- */
-
-
-function testcase() {
-
- var obj = new Number(-3);
- obj.length = 2;
- obj[1] = true;
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to Number object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new Number(-3); + obj.length = 2; + obj[1] = true; + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-7.js index 928309c72..73ac2e09c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-7.js @@ -1,16 +1,16 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-7.js
- * @description Array.prototype.indexOf applied to string primitive
- */
-
-
-function testcase() {
-
- return Array.prototype.indexOf.call("abc", "b") === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to string primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + + return Array.prototype.indexOf.call("abc", "b") === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-8.js index de9cf17aa..0f2252e7c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-8.js @@ -1,18 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-8.js
- * @description Array.prototype.indexOf applied to String object
- */
-
-
-function testcase() {
-
- var obj = new String("null");
-
- return Array.prototype.indexOf.call(obj, 'l') === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to String object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new String("null"); + + return Array.prototype.indexOf.call(obj, 'l') === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-9.js index f0acdce25..5b89dc657 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-9.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-1-9.js
- * @description Array.prototype.indexOf applied to Function object
- */
-
-
-function testcase() {
-
- var obj = function (a, b) {
- return a + b;
- };
- obj[1] = true;
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf applied to Function object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = function (a, b) { + return a + b; + }; + obj[1] = true; + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-1.js index 80519f0e6..01b7a740f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-1.js @@ -1,37 +1,39 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var a = new Array();
- a[100] = 1;
- a[99999] = "";
- a[10] = new Object();
- a[5555] = 5.5;
- a[123456] = "str";
- a[5] = 1E+309;
- if (a.indexOf(1) !== 100 ||
- a.indexOf("") !== 99999 ||
- a.indexOf("str") !== 123456 ||
- a.indexOf(1E+309) !== 5 || //Infinity
- a.indexOf(5.5) !== 5555 )
- {
- return false;
- }
- if (a.indexOf(true) === -1 &&
- a.indexOf(5) === -1 &&
- a.indexOf("str1") === -1 &&
- a.indexOf(null) === -1 &&
- a.indexOf(new Object()) === -1)
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 for elements not present in + array +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(); + a[100] = 1; + a[99999] = ""; + a[10] = new Object(); + a[5555] = 5.5; + a[123456] = "str"; + a[5] = 1E+309; + if (a.indexOf(1) !== 100 || + a.indexOf("") !== 99999 || + a.indexOf("str") !== 123456 || + a.indexOf(1E+309) !== 5 || //Infinity + a.indexOf(5.5) !== 5555 ) + { + return false; + } + if (a.indexOf(true) === -1 && + a.indexOf(5) === -1 && + a.indexOf("str1") === -1 && + a.indexOf(null) === -1 && + a.indexOf(new Object()) === -1) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-2.js index 841814c92..9326aacce 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-10-2.js @@ -1,24 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var accessed = false;
- var f = {length: 0};
- Object.defineProperty(f,"0",{get: function () {accessed = true; return 1;}});
-
-
- var i = Array.prototype.indexOf.call(f,1);
-
- if (i === -1 && accessed==false) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 and does not + access any other properties +includes: [runTestCase.js] +---*/ + +function testcase() { + var accessed = false; + var f = {length: 0}; + Object.defineProperty(f,"0",{get: function () {accessed = true; return 1;}}); + + + var i = Array.prototype.indexOf.call(f,1); + + if (i === -1 && accessed==false) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-1.js index 9c93172ce..0b77bff45 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-1.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var objOne = { 1: true, length: 2 };
- var objTwo = { 2: true, length: 2 };
- return Array.prototype.indexOf.call(objOne, true) === 1 &&
- Array.prototype.indexOf.call(objTwo, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own data property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var objOne = { 1: true, length: 2 }; + var objTwo = { 2: true, length: 2 }; + return Array.prototype.indexOf.call(objOne, true) === 1 && + Array.prototype.indexOf.call(objTwo, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-10.js index f6632c7d6..93e2362a0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-10.js @@ -1,33 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var proto = {};
- Object.defineProperty(proto, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- var Con = function () {};
- Con.prototype = proto;
-
- var childOne = new Con();
- childOne[1] = true;
- var childTwo = new Con();
- childTwo[2] = true;
-
- return Array.prototype.indexOf.call(childOne, true) === 1 &&
- Array.prototype.indexOf.call(childTwo, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + + var proto = {}; + Object.defineProperty(proto, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + var Con = function () {}; + Con.prototype = proto; + + var childOne = new Con(); + childOne[1] = true; + var childTwo = new Con(); + childTwo[2] = true; + + return Array.prototype.indexOf.call(childOne, true) === 1 && + Array.prototype.indexOf.call(childTwo, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-11.js index 6de1bd2af..050c57f3c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-11.js @@ -1,22 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 1: true };
- Object.defineProperty(obj, "length", {
- set: function () { },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(obj, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own accessor property + without a get function +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: true }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); + + return Array.prototype.indexOf.call(obj, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-12.js index 0755c25bd..9da8a76ed 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-12.js @@ -1,32 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Object.defineProperty(Object.prototype, "length", {
- get: function () {
- return 20;
- },
- configurable: true
- });
-
- var obj = { 1: 1 };
- Object.defineProperty(obj, "length", {
- set: function () { },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(obj, 1) === -1;
- } finally {
- delete Object.prototype.length;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own accessor property + without a get function that overrides an inherited accessor + property +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Object.defineProperty(Object.prototype, "length", { + get: function () { + return 20; + }, + configurable: true + }); + + var obj = { 1: 1 }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); + + return Array.prototype.indexOf.call(obj, 1) === -1; + } finally { + delete Object.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-13.js index fc0ea45e6..3c88c4aca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-13.js @@ -1,28 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var proto = {};
- Object.defineProperty(proto, "length", {
- set: function () { },
- configurable: true
- });
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child[1] = true;
-
- return Array.prototype.indexOf.call(child, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is inherited accessor property + without a get function +includes: [runTestCase.js] +---*/ + +function testcase() { + + var proto = {}; + Object.defineProperty(proto, "length", { + set: function () { }, + configurable: true + }); + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child[1] = true; + + return Array.prototype.indexOf.call(child, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-14.js index 1da6bd194..440894d18 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-14.js @@ -1,18 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-14.js
- * @description Array.prototype.indexOf - 'length' is undefined property
- */
-
-
-function testcase() {
-
- var obj = { 0: true, 1: true };
-
- return Array.prototype.indexOf.call(obj, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is undefined property +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: true, 1: true }; + + return Array.prototype.indexOf.call(obj, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-15.js index f5df7954f..8487afd24 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-15.js @@ -1,33 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject().length = 2;
-
- fnGlobalObject()[1] = targetObj;
- if (Array.prototype.indexOf.call(fnGlobalObject(), targetObj) !== 1) {
- return false;
- }
-
- fnGlobalObject()[1] = {};
- fnGlobalObject()[2] = targetObj;
-
- return Array.prototype.indexOf.call(fnGlobalObject(), targetObj) === -1;
- } finally {
- delete fnGlobalObject()[1];
- delete fnGlobalObject()[2];
- fnGlobalObject().length = oldLen;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is property of the global object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + var targetObj = {}; + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject().length = 2; + + fnGlobalObject()[1] = targetObj; + if (Array.prototype.indexOf.call(fnGlobalObject(), targetObj) !== 1) { + return false; + } + + fnGlobalObject()[1] = {}; + fnGlobalObject()[2] = targetObj; + + return Array.prototype.indexOf.call(fnGlobalObject(), targetObj) === -1; + } finally { + delete fnGlobalObject()[1]; + delete fnGlobalObject()[2]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-17.js index a20500339..7b8b0cfee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-17.js @@ -1,22 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var func = function (a, b) {
- arguments[2] = false;
- return Array.prototype.indexOf.call(arguments, true) === 1 &&
- Array.prototype.indexOf.call(arguments, false) === -1;
- };
-
- return func(0, true);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf applied to Arguments object which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var func = function (a, b) { + arguments[2] = false; + return Array.prototype.indexOf.call(arguments, true) === 1 && + Array.prototype.indexOf.call(arguments, false) === -1; + }; + + return func(0, true); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-18.js index 883d30cb4..969c3c9a7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-18.js @@ -1,22 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var str = new String("012");
- try {
- String.prototype[3] = "3";
- return Array.prototype.indexOf.call(str, "2") === 2 &&
- Array.prototype.indexOf.call(str, "3") === -1;
- } finally {
- delete String.prototype[3];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf applied to String object, which implements + its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + var str = new String("012"); + try { + String.prototype[3] = "3"; + return Array.prototype.indexOf.call(str, "2") === 2 && + Array.prototype.indexOf.call(str, "3") === -1; + } finally { + delete String.prototype[3]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-19.js index c874b8863..f6396152f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-19.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = function (a, b) {
- return a + b;
- };
- obj[1] = "b";
- obj[2] = "c";
-
- return Array.prototype.indexOf.call(obj, obj[1]) === 1 &&
- Array.prototype.indexOf.call(obj, obj[2]) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf applied to Function object which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = function (a, b) { + return a + b; + }; + obj[1] = "b"; + obj[2] = "c"; + + return Array.prototype.indexOf.call(obj, obj[1]) === 1 && + Array.prototype.indexOf.call(obj, obj[2]) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-2.js index d14fff919..f990588d3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-2.js @@ -1,24 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- try {
- Array.prototype[2] = targetObj;
-
- return [0, targetObj].indexOf(targetObj) === 1 &&
- [0, 1].indexOf(targetObj) === -1;
-
- } finally {
- delete Array.prototype[2];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is own data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + try { + Array.prototype[2] = targetObj; + + return [0, targetObj].indexOf(targetObj) === 1 && + [0, 1].indexOf(targetObj) === -1; + + } finally { + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-3.js index caf68f771..e539451a9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-3.js @@ -1,25 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var proto = { length: 0 };
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 2;
- child[1] = true;
-
- return Array.prototype.indexOf.call(child, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own data property that + overrides an inherited data property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var proto = { length: 0 }; + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child.length = 2; + child[1] = true; + + return Array.prototype.indexOf.call(child, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-4.js index 5f6e8dd38..654717e1a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-4.js @@ -1,28 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var targetObj = {};
- var arrProtoLen;
-
- try {
- arrProtoLen = Array.prototype.length;
- Array.prototype.length = 0;
-
- return [0, targetObj].indexOf(targetObj) === 1;
-
- } finally {
-
- Array.prototype.length = arrProtoLen;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own data property that + overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var targetObj = {}; + var arrProtoLen; + + try { + arrProtoLen = Array.prototype.length; + Array.prototype.length = 0; + + return [0, targetObj].indexOf(targetObj) === 1; + + } finally { + + Array.prototype.length = arrProtoLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-5.js index 3a9f693f6..49299bbd4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-5.js @@ -1,34 +1,36 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var proto = {};
- Object.defineProperty(proto, "length", {
- get: function () {
- return 0;
- },
- configurable: true
- });
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
-
- Object.defineProperty(child, "length", {
- value: 2,
- configurable: true
- });
- child[1] = true;
-
- return Array.prototype.indexOf.call(child, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own data property that + overrides an inherited accessor property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var proto = {}; + Object.defineProperty(proto, "length", { + get: function () { + return 0; + }, + configurable: true + }); + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + + Object.defineProperty(child, "length", { + value: 2, + configurable: true + }); + child[1] = true; + + return Array.prototype.indexOf.call(child, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-6.js index 9261c7d69..b9d2c3463 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-6.js @@ -1,26 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var proto = { length: 2 };
-
- var Con = function () {};
- Con.prototype = proto;
-
- var childOne = new Con();
- childOne[1] = true;
- var childTwo = new Con();
- childTwo[2] = true;
-
- return Array.prototype.indexOf.call(childOne, true) === 1 &&
- Array.prototype.indexOf.call(childTwo, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + var proto = { length: 2 }; + + var Con = function () {}; + Con.prototype = proto; + + var childOne = new Con(); + childOne[1] = true; + var childTwo = new Con(); + childTwo[2] = true; + + return Array.prototype.indexOf.call(childOne, true) === 1 && + Array.prototype.indexOf.call(childTwo, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-7.js index 17ad5a70c..eaad6eb7a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-7.js @@ -1,31 +1,31 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var objOne = { 1: true };
- var objTwo = { 2: true };
- Object.defineProperty(objOne, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
- Object.defineProperty(objTwo, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(objOne, true) === 1 &&
- Array.prototype.indexOf.call(objTwo, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is own accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + var objOne = { 1: true }; + var objTwo = { 2: true }; + Object.defineProperty(objOne, "length", { + get: function () { + return 2; + }, + configurable: true + }); + Object.defineProperty(objTwo, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + return Array.prototype.indexOf.call(objOne, true) === 1 && + Array.prototype.indexOf.call(objTwo, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-8.js index 697d50f16..1544172e2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-8.js @@ -1,31 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var proto = { length: 0 };
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child[1] = true;
-
- Object.defineProperty(child, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(child, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own accessor property that + overrides an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + + var proto = { length: 0 }; + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child[1] = true; + + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + return Array.prototype.indexOf.call(child, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-9.js index 5c56b328e..e582394cd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-2-9.js @@ -1,36 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var proto = {};
- Object.defineProperty(proto, "length", {
- get: function () {
- return 0;
- },
- configurable: true
- });
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child[1] = true;
-
- Object.defineProperty(child, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(child, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is own accessor property that + overrides an inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + var proto = {}; + Object.defineProperty(proto, "length", { + get: function () { + return 0; + }, + configurable: true + }); + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child[1] = true; + + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + return Array.prototype.indexOf.call(child, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-1.js index b7f2e2d81..796eb1e1d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-1.js @@ -1,18 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 0: 1, 1: 1, length: undefined };
-
- return Array.prototype.indexOf.call(obj, 1) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - value of 'length' is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 1, 1: 1, length: undefined }; + + return Array.prototype.indexOf.call(obj, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-10.js index 65828b96c..98ee88f10 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-10.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 0: 0, length: NaN };
-
- return Array.prototype.indexOf.call(obj, 0) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is number primitive + (value is NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 0, length: NaN }; + + return Array.prototype.indexOf.call(obj, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-11.js index 220340539..34417d5dd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-11.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 1: 1, 2: 2, length: "2" };
-
- return Array.prototype.indexOf.call(obj, 1) === 1 &&
- Array.prototype.indexOf.call(obj, 2) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is a string containing a + positive number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: 1, 2: 2, length: "2" }; + + return Array.prototype.indexOf.call(obj, 1) === 1 && + Array.prototype.indexOf.call(obj, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js index 0315be5f2..261b34290 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-12.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 1: "true", 2: "2", length: "-4294967294" };
-
- return Array.prototype.indexOf.call(obj, "true") === 1 &&
- Array.prototype.indexOf.call(obj, "2") === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is a string containing a + negative number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: "true", 2: "2", length: "-4294967294" }; + + return Array.prototype.indexOf.call(obj, "true") === 1 && + Array.prototype.indexOf.call(obj, "2") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-13.js index bdf22f0a4..7a0380bba 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-13.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 199: true, 200: "200.59", length: "200.59" };
-
- return Array.prototype.indexOf.call(obj, true) === 199 &&
- Array.prototype.indexOf.call(obj, "200.59") === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is a string containing a + decimal number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 199: true, 200: "200.59", length: "200.59" }; + + return Array.prototype.indexOf.call(obj, true) === 199 && + Array.prototype.indexOf.call(obj, "200.59") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js index 14b89f514..6dd9cf04b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-14.js @@ -1,22 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var objOne = { 0: true, 1: true, length: "Infinity" };
- var objTwo = { 0: true, 1: true, length: "+Infinity" };
- var objThree = { 0: true, 1: true, length: "-Infinity" };
-
- return Array.prototype.indexOf.call(objOne, true) === -1 &&
- Array.prototype.indexOf.call(objTwo, true) === -1 &&
- Array.prototype.indexOf.call(objThree, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is a string containing + +/-Infinity +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objOne = { 0: true, 1: true, length: "Infinity" }; + var objTwo = { 0: true, 1: true, length: "+Infinity" }; + var objThree = { 0: true, 1: true, length: "-Infinity" }; + + return Array.prototype.indexOf.call(objOne, true) === -1 && + Array.prototype.indexOf.call(objTwo, true) === -1 && + Array.prototype.indexOf.call(objThree, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-15.js index a5b0a8150..4ac7d3589 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-15.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 1: true, 2: "2E0", length: "2E0" };
-
- return Array.prototype.indexOf.call(obj, true) === 1 &&
- Array.prototype.indexOf.call(obj, "2E0") === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is a string containing an + exponential number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: true, 2: "2E0", length: "2E0" }; + + return Array.prototype.indexOf.call(obj, true) === 1 && + Array.prototype.indexOf.call(obj, "2E0") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-16.js index 1922df6df..912c0afca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-16.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 10: true, 11: "0x00B", length: "0x00B" };
-
- return Array.prototype.indexOf.call(obj, true) === 10 &&
- Array.prototype.indexOf.call(obj, "0x00B") === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is a string containing a hex + number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 10: true, 11: "0x00B", length: "0x00B" }; + + return Array.prototype.indexOf.call(obj, true) === 10 && + Array.prototype.indexOf.call(obj, "0x00B") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-17.js index 3cda52758..7315b2d46 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-17.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 1: true, 2: "0002.0", length: "0002.0" };
-
- return Array.prototype.indexOf.call(obj, true) === 1 &&
- Array.prototype.indexOf.call(obj, "0002.0") === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'length' is a string containing a number + with leading zeros +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: true, 2: "0002.0", length: "0002.0" }; + + return Array.prototype.indexOf.call(obj, true) === 1 && + Array.prototype.indexOf.call(obj, "0002.0") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-18.js index d7d30b11e..e9dae5848 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-18.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 0: true, 100: true, length: "one" };
-
- return Array.prototype.indexOf.call(obj, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a string that can't + convert to a number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: true, 100: true, length: "one" }; + + return Array.prototype.indexOf.call(obj, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-19.js index e09845de8..b1b6e7d8d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-19.js @@ -1,34 +1,36 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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.
- */
-
-
-function testcase() {
-
- // objects inherit the default valueOf() method from Object
- // that simply returns itself. Since the default valueOf() method
- // does not return a primitive value, ES next tries to convert the object
- // to a number by calling its toString() method and converting the
- // resulting string to a number.
-
- var obj = {
- 1: true,
- 2: 2,
-
- length: {
- toString: function () {
- return '2';
- }
- }
- };
-
- return Array.prototype.indexOf.call(obj, true) === 1 &&
- Array.prototype.indexOf.call(obj, 2) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is an Object which has + an own toString method. +includes: [runTestCase.js] +---*/ + +function testcase() { + + // objects inherit the default valueOf() method from Object + // that simply returns itself. Since the default valueOf() method + // does not return a primitive value, ES next tries to convert the object + // to a number by calling its toString() method and converting the + // resulting string to a number. + + var obj = { + 1: true, + 2: 2, + + length: { + toString: function () { + return '2'; + } + } + }; + + return Array.prototype.indexOf.call(obj, true) === 1 && + Array.prototype.indexOf.call(obj, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-2.js index a82ef2706..1d74a0d39 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-2.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var obj = { 0: 0, 1: 1, length: true };
- return Array.prototype.indexOf.call(obj, 0) === 0 &&
- Array.prototype.indexOf.call(obj, 1) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf return -1 when 'length' is a boolean + (value is true) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = { 0: 0, 1: 1, length: true }; + return Array.prototype.indexOf.call(obj, 0) === 0 && + Array.prototype.indexOf.call(obj, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-20.js index 8f70eb6a2..0ed993913 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-20.js @@ -1,28 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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.
- */
-
-
-function testcase() {
-
- //valueOf method will be invoked first, since hint is Number
- var obj = {
- 1: true,
- 2: 2,
- length: {
- valueOf: function () {
- return 2;
- }
- }
- };
-
- return Array.prototype.indexOf.call(obj, true) === 1 &&
- Array.prototype.indexOf.call(obj, 2) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is an Object which has + an own valueOf method. +includes: [runTestCase.js] +---*/ + +function testcase() { + + //valueOf method will be invoked first, since hint is Number + var obj = { + 1: true, + 2: 2, + length: { + valueOf: function () { + return 2; + } + } + }; + + return Array.prototype.indexOf.call(obj, true) === 1 && + Array.prototype.indexOf.call(obj, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-21.js index ceb822811..03a48868f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-21.js @@ -1,34 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var toStringAccessed = false;
- var valueOfAccessed = false;
-
- var obj = {
- 1: true,
- length: {
- toString: function () {
- toStringAccessed = true;
- return '2';
- },
-
- valueOf: function () {
- valueOfAccessed = true;
- return {};
- }
- }
- };
-
- return Array.prototype.indexOf.call(obj, true) === 1 && toStringAccessed && valueOfAccessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +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 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var toStringAccessed = false; + var valueOfAccessed = false; + + var obj = { + 1: true, + length: { + toString: function () { + toStringAccessed = true; + return '2'; + }, + + valueOf: function () { + valueOfAccessed = true; + return {}; + } + } + }; + + return Array.prototype.indexOf.call(obj, true) === 1 && toStringAccessed && valueOfAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-22.js index 19c806f59..984416751 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-22.js @@ -1,38 +1,41 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var toStringAccessed = false;
- var valueOfAccessed = false;
-
- var obj = {
- length: {
- toString: function () {
- toStringAccessed = true;
- return {};
- },
-
- valueOf: function () {
- valueOfAccessed = true;
- return {};
- }
- }
- };
-
- try {
- Array.prototype.indexOf.call(obj);
- return false;
- } catch (e) {
- return toStringAccessed && valueOfAccessed;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf throws TypeError exception when 'length' + is an object with toString and valueOf methods that don�t return + primitive values +includes: [runTestCase.js] +---*/ + +function testcase() { + + var toStringAccessed = false; + var valueOfAccessed = false; + + var obj = { + length: { + toString: function () { + toStringAccessed = true; + return {}; + }, + + valueOf: function () { + valueOfAccessed = true; + return {}; + } + } + }; + + try { + Array.prototype.indexOf.call(obj); + return false; + } catch (e) { + return toStringAccessed && valueOfAccessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-23.js index 3bd5f57fb..1408b76ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-23.js @@ -1,40 +1,43 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var toStringAccessed = false;
- var valueOfAccessed = false;
-
- var proto = {
- valueOf: function () {
- valueOfAccessed = true;
- return 2;
- }
- };
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child.toString = function () {
- toStringAccessed = true;
- return 2;
- };
-
- var obj = {
- 1: true,
- length: child
- };
-
- return Array.prototype.indexOf.call(obj, true) === 1 && valueOfAccessed && !toStringAccessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf uses inherited valueOf method when + 'length' is an object with an own toString and inherited valueOf + methods +includes: [runTestCase.js] +---*/ + +function testcase() { + + var toStringAccessed = false; + var valueOfAccessed = false; + + var proto = { + valueOf: function () { + valueOfAccessed = true; + return 2; + } + }; + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child.toString = function () { + toStringAccessed = true; + return 2; + }; + + var obj = { + 1: true, + length: child + }; + + return Array.prototype.indexOf.call(obj, true) === 1 && valueOfAccessed && !toStringAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-24.js index eaf2794b1..d430d30af 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-24.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 122: true, 123: false, length: 123.321 }; //length will be 123 finally
-
- return Array.prototype.indexOf.call(obj, true) === 122 &&
- Array.prototype.indexOf.call(obj, false) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a positive + non-integer, ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 122: true, 123: false, length: 123.321 }; //length will be 123 finally + + return Array.prototype.indexOf.call(obj, true) === 122 && + Array.prototype.indexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js index 0c562a54e..5130ec348 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-25.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { 1: true, 2: false, length: -4294967294.5 }; //length will be 2 finally
-
- return Array.prototype.indexOf.call(obj, true) === 1 &&
- Array.prototype.indexOf.call(obj, false) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a negative + non-integer, ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: true, 2: false, length: -4294967294.5 }; //length will be 2 finally + + return Array.prototype.indexOf.call(obj, true) === 1 && + Array.prototype.indexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js index 8528a66fb..f9f222078 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-28.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var targetObj = {};
- var obj = {
- 0: targetObj,
- 4294967294: targetObj,
- 4294967295: targetObj,
- length: 4294967296
- };
-
- return Array.prototype.indexOf.call(obj, targetObj) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is boundary value + (2^32) +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + var obj = { + 0: targetObj, + 4294967294: targetObj, + 4294967295: targetObj, + length: 4294967296 + }; + + return Array.prototype.indexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js index ddadd4d88..b106b64e1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-29.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var targetObj = {};
- var obj = {
- 0: targetObj,
- 1: 4294967297,
- length: 4294967297
- };
-
- return Array.prototype.indexOf.call(obj, targetObj) === 0 &&
- Array.prototype.indexOf.call(obj, 4294967297) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is boundary value + (2^32 + 1) +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + var obj = { + 0: targetObj, + 1: 4294967297, + length: 4294967297 + }; + + return Array.prototype.indexOf.call(obj, targetObj) === 0 && + Array.prototype.indexOf.call(obj, 4294967297) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-3.js index 8aa187847..032b9c49d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-3.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 0: true, length: 0 };
-
- return Array.prototype.indexOf.call(obj, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a number (value is + 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: true, length: 0 }; + + return Array.prototype.indexOf.call(obj, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-4.js index 75fcfc5a4..35302a417 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-4.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 0: true, length: +0 };
-
- return Array.prototype.indexOf.call(obj, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a number (value is + +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: true, length: +0 }; + + return Array.prototype.indexOf.call(obj, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-5.js index 04a795cb6..75594c7a5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-5.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 0: true, length: -0 };
-
- return Array.prototype.indexOf.call(obj, true) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a number (value is + -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: true, length: -0 }; + + return Array.prototype.indexOf.call(obj, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-6.js index af913fdb2..fabf3cae6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-6.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 3: true, 4: false, length: 4 };
-
- return Array.prototype.indexOf.call(obj, true) === 3 &&
- Array.prototype.indexOf.call(obj, false) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a number (value is + positive) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 3: true, 4: false, length: 4 }; + + return Array.prototype.indexOf.call(obj, true) === 3 && + Array.prototype.indexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js index 7c170b67b..eddde8bc9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-7.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 4: true, 5: false, length: 5 - Math.pow(2, 32) };
-
- return Array.prototype.indexOf.call(obj, true) === 4 &&
- Array.prototype.indexOf.call(obj, false) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a number (value is + negative) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 4: true, 5: false, length: 5 - Math.pow(2, 32) }; + + return Array.prototype.indexOf.call(obj, true) === 4 && + Array.prototype.indexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js index 4eec4a6f5..8343a4baa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-8.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 0: 0, length: Infinity };
-
- return Array.prototype.indexOf.call(obj, 0) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a number (value is + Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 0, length: Infinity }; + + return Array.prototype.indexOf.call(obj, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-9.js index 49e652d9a..ee95baa13 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-3-9.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var obj = { 0: 0, length: -Infinity };
-
- return Array.prototype.indexOf.call(obj, 0) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'length' is a number (value is + -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 0, length: -Infinity }; + + return Array.prototype.indexOf.call(obj, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-1.js index 4996ea8fb..6085f851f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-1.js @@ -1,18 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var i = [].indexOf(42);
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf returns -1 if 'length' is 0 (empty array) +includes: [runTestCase.js] +---*/ + +function testcase() { + var i = [].indexOf(42); + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-10.js index 1e70eaa9e..943f230c3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-10.js @@ -1,17 +1,17 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = [];
- var obj = { 0: targetObj, 100: targetObj, length: -6e-1 };
- return Array.prototype.indexOf.call(obj, targetObj) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is a number of value -6e-1 +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = []; + var obj = { 0: targetObj, 100: targetObj, length: -6e-1 }; + return Array.prototype.indexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-11.js index ea99de8ba..38b12e9ca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-11.js @@ -1,17 +1,17 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = [];
- var obj = { 0: targetObj, 100: targetObj, length: "" };
- return Array.prototype.indexOf.call(obj, targetObj) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is an empty string +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = []; + var obj = { 0: targetObj, 100: targetObj, length: "" }; + return Array.prototype.indexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-2.js index bed15ed81..19477dd52 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-2.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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))
- */
-
-
-function testcase() {
-
- var i = Array.prototype.indexOf.call({length: null}, 1);
-
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 ( length + overridden to null (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.indexOf.call({length: null}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-3.js index 294d9d726..6cb840758 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-3.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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))
- */
-
-
-function testcase() {
-
- var i = Array.prototype.indexOf.call({length: false}, 1);
-
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 (length + overridden to false (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.indexOf.call({length: false}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-4.js index fe838c830..c0c98db3d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-4.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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 )
- */
-
-
-function testcase() {
-
- var i = Array.prototype.lastIndexOf.call({length: 0}, 1);
-
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 (generic + 'array' with length 0 ) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.lastIndexOf.call({length: 0}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-5.js index 386f92a20..ee3076392 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-5.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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))
- */
-
-
-function testcase() {
-
- var i = Array.prototype.indexOf.call({length: '0'}, 1);
-
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 ( length + overridden to '0' (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.indexOf.call({length: '0'}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-6.js index aafac4e05..ea8c182c7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-6.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var i = Array.prototype.indexOf.call({length: { valueOf: function () { return 0;}}}, 1);
-
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 (subclassed + Array, length overridden with obj with valueOf) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.indexOf.call({length: { valueOf: function () { return 0;}}}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-7.js index f543d575a..60c9864b0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-7.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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))
- */
-
-
-function testcase() {
-
-
- // objects inherit the default valueOf method of the Object object;
- // that simply returns the itself. Since the default valueOf() method
- // does not return a primitive value, ES next tries to convert the object
- // to a number by calling its toString() method and converting the
- // resulting string to a number.
- var i = Array.prototype.indexOf.call({length: { toString: function () { return '0';}}}, 1);
-
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 ( length is + object overridden with obj w/o valueOf (toString)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + + // objects inherit the default valueOf method of the Object object; + // that simply returns the itself. Since the default valueOf() method + // does not return a primitive value, ES next tries to convert the object + // to a number by calling its toString() method and converting the + // resulting string to a number. + var i = Array.prototype.indexOf.call({length: { toString: function () { return '0';}}}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-8.js index 124278a54..6a1d71ac2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-8.js @@ -1,34 +1,36 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
-
- // objects inherit the default valueOf method of the Object object;
- // that simply returns the itself. Since the default valueOf() method
- // does not return a primitive value, ES next tries to convert the object
- // to a number by calling its toString() method and converting the
- // resulting string to a number.
- //
- // The toString( ) method on Array converts the array elements to strings,
- // then returns the result of concatenating these strings, with commas in
- // between. An array with no elements converts to the empty string, which
- // converts to the number 0. If an array has a single element that is a
- // number n, the array converts to a string representation of n, which is
- // then converted back to n itself. If an array contains more than one element,
- // or if its one element is not a number, the array converts to NaN.
- var i = Array.prototype.indexOf.call({length: [ ]}, 1);
-
- if (i === -1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if 'length' is 0 (length is an + empty array) +includes: [runTestCase.js] +---*/ + +function testcase() { + + + // objects inherit the default valueOf method of the Object object; + // that simply returns the itself. Since the default valueOf() method + // does not return a primitive value, ES next tries to convert the object + // to a number by calling its toString() method and converting the + // resulting string to a number. + // + // The toString( ) method on Array converts the array elements to strings, + // then returns the result of concatenating these strings, with commas in + // between. An array with no elements converts to the empty string, which + // converts to the number 0. If an array has a single element that is a + // number n, the array converts to a string representation of n, which is + // then converted back to n itself. If an array contains more than one element, + // or if its one element is not a number, the array converts to NaN. + var i = Array.prototype.indexOf.call({length: [ ]}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-9.js index ad1aefef3..ea0bf99ef 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-4-9.js @@ -1,17 +1,17 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = [];
- var obj = { 0: targetObj, 100: targetObj, length: 0.1 };
- return Array.prototype.indexOf.call(obj, targetObj) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'length' is a number of value 0.1 +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = []; + var obj = { 0: targetObj, 100: targetObj, length: 0.1 }; + return Array.prototype.indexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-1.js index 55e7fa66d..fc3d7221a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-1.js @@ -1,19 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-1.js
- * @description Array.prototype.indexOf when fromIndex is string
- */
-
-
-function testcase() {
- var a = [1,2,1,2,1,2];
- if (a.indexOf(2,"2") === 3 && // "2" resolves to 2
- a.indexOf(2,"one") === 1) { // "one" resolves to 0
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf when fromIndex is string +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = [1,2,1,2,1,2]; + if (a.indexOf(2,"2") === 3 && // "2" resolves to 2 + a.indexOf(2,"one") === 1) { // "one" resolves to 0 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-10.js index 169eba1be..3b106f554 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-10.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, 2].indexOf(targetObj, 2) === -1 &&
- [0, 1, targetObj].indexOf(targetObj, 2) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is positive number) +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, 2].indexOf(targetObj, 2) === -1 && + [0, 1, targetObj].indexOf(targetObj, 2) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-11.js index 39c93be14..178ee616d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-11.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, 2].indexOf(targetObj, -1) === -1 &&
- [0, 1, targetObj].indexOf(targetObj, -1) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is negative number) +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, 2].indexOf(targetObj, -1) === -1 && + [0, 1, targetObj].indexOf(targetObj, -1) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-12.js index de0e282c0..7c6a1ef47 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-12.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var arr = [];
- arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type
- return arr.indexOf(true, Infinity) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + var arr = []; + arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type + return arr.indexOf(true, Infinity) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-13.js index 11be6b95e..52e76fc39 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-13.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- return [true].indexOf(true, -Infinity) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].indexOf(true, -Infinity) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-14.js index 88c78e1e5..67b211f0a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-14.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- return [true].indexOf(true, NaN) === 0 && [true].indexOf(true, -NaN) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].indexOf(true, NaN) === 0 && [true].indexOf(true, -NaN) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-15.js index 8f39cda4e..b67169091 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-15.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [0, true, 2].indexOf(true, "-1") === -1 &&
- [0, 1, true].indexOf(true, "-1") === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a string + containing a negative number +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, true, 2].indexOf(true, "-1") === -1 && + [0, 1, true].indexOf(true, "-1") === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-16.js index 8b8e91e0b..46ffb164c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-16.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var arr = [];
- arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type
- return arr.indexOf(true, "Infinity") === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a string + containing Infinity +includes: [runTestCase.js] +---*/ + +function testcase() { + var arr = []; + arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type + return arr.indexOf(true, "Infinity") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-17.js index 1fa680a32..f92d2dd25 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-17.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [true].indexOf(true, "-Infinity") === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a string + containing -Infinity +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].indexOf(true, "-Infinity") === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-18.js index a630df56e..a30edda2d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-18.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, 1, targetObj, 3, 4].indexOf(targetObj, "3E0") === -1 &&
- [0, 1, 2, targetObj, 4].indexOf(targetObj, "3E0") === 3;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a string + containing an exponential number +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, 1, targetObj, 3, 4].indexOf(targetObj, "3E0") === -1 && + [0, 1, 2, targetObj, 4].indexOf(targetObj, "3E0") === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-19.js index d917045f7..d5aef49a5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-19.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, 1, targetObj, 3, 4].indexOf(targetObj, "0x0003") === -1 &&
- [0, 1, 2, targetObj, 4].indexOf(targetObj, "0x0003") === 3;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a string + containing a hex number +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, 1, targetObj, 3, 4].indexOf(targetObj, "0x0003") === -1 && + [0, 1, 2, targetObj, 4].indexOf(targetObj, "0x0003") === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-2.js index e059edb20..6e57f065c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-2.js @@ -1,20 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var a = new Array(1,2,3);
- if (a.indexOf(3,0.49) === 2 && // 0.49 resolves to 0
- a.indexOf(1,0.51) === 0 && // 0.51 resolves to 0
- a.indexOf(1,1.51) === -1) { // 1.01 resolves to 1
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf when fromIndex is floating point number +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,3); + if (a.indexOf(3,0.49) === 2 && // 0.49 resolves to 0 + a.indexOf(1,0.51) === 0 && // 0.51 resolves to 0 + a.indexOf(1,1.51) === -1) { // 1.01 resolves to 1 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-20.js index 109c38041..c529d9b50 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-20.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, 1, targetObj, 3, 4].indexOf(targetObj, "0003.10") === -1 &&
- [0, 1, 2, targetObj, 4].indexOf(targetObj, "0003.10") === 3;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' which is a string + containing a number with leading zeros +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, 1, targetObj, 3, 4].indexOf(targetObj, "0003.10") === -1 && + [0, 1, 2, targetObj, 4].indexOf(targetObj, "0003.10") === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-21.js index 1a80e7100..015e0dc75 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-21.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- // objects inherit the default valueOf() method from Object
- // that simply returns itself. Since the default valueOf() method
- // does not return a primitive value, ES next tries to convert the object
- // to a number by calling its toString() method and converting the
- // resulting string to a number.
- var fromIndex = {
- toString: function () {
- return '1';
- }
- };
-
- return [0, true].indexOf(true, fromIndex) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is an Object, which + has an own toString method +includes: [runTestCase.js] +---*/ + +function testcase() { + + // objects inherit the default valueOf() method from Object + // that simply returns itself. Since the default valueOf() method + // does not return a primitive value, ES next tries to convert the object + // to a number by calling its toString() method and converting the + // resulting string to a number. + var fromIndex = { + toString: function () { + return '1'; + } + }; + + return [0, true].indexOf(true, fromIndex) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-22.js index f4b7f410c..dcba8e0a1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-22.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var fromIndex = {
- valueOf: function () {
- return 1;
- }
- };
-
-
- return [0, true].indexOf(true, fromIndex) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is an Object, which + has an own valueOf method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var fromIndex = { + valueOf: function () { + return 1; + } + }; + + + return [0, true].indexOf(true, fromIndex) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-23.js index aec49eab4..13c18346d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-23.js @@ -1,31 +1,34 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var toStringAccessed = false;
- var valueOfAccessed = false;
-
- var fromIndex = {
- toString: function () {
- toStringAccessed = true;
- return '1';
- },
-
- valueOf: function () {
- valueOfAccessed = true;
- return {};
- }
- };
-
- return [0, true].indexOf(true, fromIndex) === 1 && toStringAccessed && valueOfAccessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +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 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var toStringAccessed = false; + var valueOfAccessed = false; + + var fromIndex = { + toString: function () { + toStringAccessed = true; + return '1'; + }, + + valueOf: function () { + valueOfAccessed = true; + return {}; + } + }; + + return [0, true].indexOf(true, fromIndex) === 1 && toStringAccessed && valueOfAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-24.js index af7e04be8..f9ca99e91 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-24.js @@ -1,35 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var toStringAccessed = false;
- var valueOfAccessed = false;
- var fromIndex = {
- toString: function () {
- toStringAccessed = true;
- return {};
- },
-
- valueOf: function () {
- valueOfAccessed = true;
- return {};
- }
- };
-
- try {
- [0, true].indexOf(true, fromIndex);
- return false;
- } catch (e) {
- return toStringAccessed && valueOfAccessed;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +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 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var toStringAccessed = false; + var valueOfAccessed = false; + var fromIndex = { + toString: function () { + toStringAccessed = true; + return {}; + }, + + valueOf: function () { + valueOfAccessed = true; + return {}; + } + }; + + try { + [0, true].indexOf(true, fromIndex); + return false; + } catch (e) { + return toStringAccessed && valueOfAccessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-25.js index 210ff59e1..42592de85 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-25.js @@ -1,35 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var toStringAccessed = false;
- var valueOfAccessed = false;
-
- var proto = {
- valueOf: function () {
- valueOfAccessed = true;
- return 1;
- }
- };
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child.toString = function () {
- toStringAccessed = true;
- return 2;
- };
-
- return [0, true].indexOf(true, child) === 1 && valueOfAccessed && !toStringAccessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf uses inherited valueOf method when value + of 'fromIndex' is an object with an own toString and inherited + valueOf methods +includes: [runTestCase.js] +---*/ + +function testcase() { + + var toStringAccessed = false; + var valueOfAccessed = false; + + var proto = { + valueOf: function () { + valueOfAccessed = true; + return 1; + } + }; + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child.toString = function () { + toStringAccessed = true; + return 2; + }; + + return [0, true].indexOf(true, child) === 1 && valueOfAccessed && !toStringAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-26.js index 69574ff01..3f94ebd9d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-26.js @@ -1,43 +1,45 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var stepTwoOccurs = false;
- var stepFiveOccurs = false;
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- stepTwoOccurs = true;
- if (stepFiveOccurs) {
- throw new Error("Step 5 occurred out of order");
- }
- return 20;
- },
- configurable: true
- });
-
- var fromIndex = {
- valueOf: function () {
- stepFiveOccurs = true;
- return 0;
- }
- };
-
- try {
- Array.prototype.indexOf.call(obj, undefined, fromIndex);
- return stepTwoOccurs && stepFiveOccurs;
- } catch (ex) {
- return false;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - side effects produced by step 2 are + visible when an exception occurs +includes: [runTestCase.js] +---*/ + +function testcase() { + var stepTwoOccurs = false; + var stepFiveOccurs = false; + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + stepTwoOccurs = true; + if (stepFiveOccurs) { + throw new Error("Step 5 occurred out of order"); + } + return 20; + }, + configurable: true + }); + + var fromIndex = { + valueOf: function () { + stepFiveOccurs = true; + return 0; + } + }; + + try { + Array.prototype.indexOf.call(obj, undefined, fromIndex); + return stepTwoOccurs && stepFiveOccurs; + } catch (ex) { + return false; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-27.js index 98ff90761..079965725 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-27.js @@ -1,47 +1,49 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var stepThreeOccurs = false;
- var stepFiveOccurs = false;
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- return {
- valueOf: function () {
- stepThreeOccurs = true;
- if (stepFiveOccurs) {
- throw new Error("Step 5 occurred out of order");
- }
- return 20;
- }
- };
- },
- configurable: true
- });
-
- var fromIndex = {
- valueOf: function () {
- stepFiveOccurs = true;
- return 0;
- }
- };
-
- try {
- Array.prototype.indexOf.call(obj, undefined, fromIndex);
- return stepThreeOccurs && stepFiveOccurs;
- } catch (ex) {
- return false;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - side effects produced by step 3 are + visible when an exception occurs +includes: [runTestCase.js] +---*/ + +function testcase() { + var stepThreeOccurs = false; + var stepFiveOccurs = false; + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + return { + valueOf: function () { + stepThreeOccurs = true; + if (stepFiveOccurs) { + throw new Error("Step 5 occurred out of order"); + } + return 20; + } + }; + }, + configurable: true + }); + + var fromIndex = { + valueOf: function () { + stepFiveOccurs = true; + return 0; + } + }; + + try { + Array.prototype.indexOf.call(obj, undefined, fromIndex); + return stepThreeOccurs && stepFiveOccurs; + } catch (ex) { + return false; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-28.js index be603a1b9..39820eec7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-28.js @@ -1,29 +1,31 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var stepFiveOccurs = false;
- var fromIndex = {
- valueOf: function () {
- stepFiveOccurs = true;
- return 0;
- }
- };
-
- try {
- Array.prototype.indexOf.call(undefined, undefined, fromIndex);
- return false;
- } catch (e) {
- return (e instanceof TypeError) && !stepFiveOccurs;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - side effects produced by step 1 are + visible when an exception occurs +includes: [runTestCase.js] +---*/ + +function testcase() { + + var stepFiveOccurs = false; + var fromIndex = { + valueOf: function () { + stepFiveOccurs = true; + return 0; + } + }; + + try { + Array.prototype.indexOf.call(undefined, undefined, fromIndex); + return false; + } catch (e) { + return (e instanceof TypeError) && !stepFiveOccurs; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-29.js index ce0e9739e..56dabfedb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-29.js @@ -1,38 +1,40 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var stepFiveOccurs = false;
-
- var obj = {};
- Object.defineProperty(obj, "length", {
- get: function () {
- throw new RangeError();
- },
- configurable: true
- });
-
- var fromIndex = {
- valueOf: function () {
- stepFiveOccurs = true;
- return 0;
- }
- };
-
- try {
- Array.prototype.indexOf.call(obj, undefined, fromIndex);
- return false;
- } catch (e) {
- return (e instanceof RangeError) && !stepFiveOccurs;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - side effects produced by step 2 are + visible when an exception occurs +includes: [runTestCase.js] +---*/ + +function testcase() { + + var stepFiveOccurs = false; + + var obj = {}; + Object.defineProperty(obj, "length", { + get: function () { + throw new RangeError(); + }, + configurable: true + }); + + var fromIndex = { + valueOf: function () { + stepFiveOccurs = true; + return 0; + } + }; + + try { + Array.prototype.indexOf.call(obj, undefined, fromIndex); + return false; + } catch (e) { + return (e instanceof RangeError) && !stepFiveOccurs; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-3.js index 6b646e64d..1d75def54 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-3.js @@ -1,19 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-3.js
- * @description Array.prototype.indexOf when fromIndex is boolean
- */
-
-
-function testcase() {
- var a = [1,2,3];
- if (a.indexOf(1,true) === -1 && // true resolves to 1
- a.indexOf(1,false) === 0 ) { // false resolves to 0
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf when fromIndex is boolean +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = [1,2,3]; + if (a.indexOf(1,true) === -1 && // true resolves to 1 + a.indexOf(1,false) === 0 ) { // false resolves to 0 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-30.js index 8724c75c0..f6d8848ba 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-30.js @@ -1,42 +1,44 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var stepFiveOccurs = false;
-
- var obj = {};
- Object.defineProperty(obj, "length", {
- get: function () {
- return {
- valueOf: function () {
- throw new TypeError();
- }
- };
- },
- configurable: true
- });
-
- var fromIndex = {
- valueOf: function () {
- stepFiveOccurs = true;
- return 0;
- }
- };
-
- try {
- Array.prototype.indexOf.call(obj, undefined, fromIndex);
- return false;
- } catch (e) {
- return (e instanceof TypeError) && !stepFiveOccurs;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - side effects produced by step 3 are + visible when an exception occurs +includes: [runTestCase.js] +---*/ + +function testcase() { + + var stepFiveOccurs = false; + + var obj = {}; + Object.defineProperty(obj, "length", { + get: function () { + return { + valueOf: function () { + throw new TypeError(); + } + }; + }, + configurable: true + }); + + var fromIndex = { + valueOf: function () { + stepFiveOccurs = true; + return 0; + } + }; + + try { + Array.prototype.indexOf.call(obj, undefined, fromIndex); + return false; + } catch (e) { + return (e instanceof TypeError) && !stepFiveOccurs; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-31.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-31.js index 3caf29be4..e6be2099c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-31.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-31.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, 2].indexOf(targetObj, 2.5) === -1 &&
- [0, 1, targetObj].indexOf(targetObj, 2.5) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'fromIndex' is a positive non-integer, + verify truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, 2].indexOf(targetObj, 2.5) === -1 && + [0, 1, targetObj].indexOf(targetObj, 2.5) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-32.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-32.js index 66a164321..750aea7ec 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-32.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-32.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, 2].indexOf(targetObj, -1.5) === -1 &&
- [0, 1, targetObj].indexOf(targetObj, -1.5) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - 'fromIndex' is a negative non-integer, + verify truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, 2].indexOf(targetObj, -1.5) === -1 && + [0, 1, targetObj].indexOf(targetObj, -1.5) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-33.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-33.js index 965c2cee3..44231f8a6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-33.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-33.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [0, 1, 2, 3, 4].indexOf(0, 0) === 0 &&
- [0, 1, 2, 3, 4].indexOf(2, 1) === 2 &&
- [0, 1, 2, 3, 4].indexOf(2, 2) === 2 &&
- [0, 1, 2, 3, 4].indexOf(4, 2) === 4 &&
- [0, 1, 2, 3, 4].indexOf(4, 4) === 4;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf match on the first element, a middle + element and the last element when 'fromIndex' is passed +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, 1, 2, 3, 4].indexOf(0, 0) === 0 && + [0, 1, 2, 3, 4].indexOf(2, 1) === 2 && + [0, 1, 2, 3, 4].indexOf(2, 2) === 2 && + [0, 1, 2, 3, 4].indexOf(4, 2) === 4 && + [0, 1, 2, 3, 4].indexOf(4, 4) === 4; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-4.js index e9a9b1c96..af15b1d46 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-4.js @@ -1,18 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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'
- */
-
-
-function testcase() {
- var a = [1,2,3];
- if (a.indexOf(1,undefined) === 0) { // undefined resolves to 0
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf returns 0 if fromIndex is 'undefined' +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = [1,2,3]; + if (a.indexOf(1,undefined) === 0) { // undefined resolves to 0 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-5.js index 55abcec91..1759f60aa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-5.js @@ -1,18 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var a = [1,2,3];
- if (a.indexOf(1,null) === 0 ) { // null resolves to 0
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf returns 0 if fromIndex is null +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = [1,2,3]; + if (a.indexOf(1,null) === 0 ) { // null resolves to 0 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-6.js index 7d3dae256..2893fe8c1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-6.js @@ -1,19 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-6.js
- * @description Array.prototype.indexOf - 'fromIndex' isn't passed
- */
-
-
-function testcase() {
- var arr = [0, 1, 2, 3, 4];
- //'fromIndex' will be set as 0 if not passed by default
- return arr.indexOf(0) === arr.indexOf(0, 0) &&
- arr.indexOf(2) === arr.indexOf(2, 0) &&
- arr.indexOf(4) === arr.indexOf(4, 0);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - 'fromIndex' isn't passed +includes: [runTestCase.js] +---*/ + +function testcase() { + var arr = [0, 1, 2, 3, 4]; + //'fromIndex' will be set as 0 if not passed by default + return arr.indexOf(0) === arr.indexOf(0, 0) && + arr.indexOf(2) === arr.indexOf(2, 0) && + arr.indexOf(4) === arr.indexOf(4, 0); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-7.js index dcb784bea..a1fbbb9cd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-7.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- return [true].indexOf(true, 0) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].indexOf(true, 0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-8.js index 47aebb3fc..571c6cd63 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-8.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- return [true].indexOf(true, +0) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].indexOf(true, +0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-9.js index 268569f93..01b310d40 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-5-9.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- return [true].indexOf(true, -0) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - value of 'fromIndex' is a number (value + is -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].indexOf(true, -0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-6-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-6-1.js index d21c122b5..50aa35884 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-6-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-6-1.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var a = [1,2,3];
- if (a.indexOf(1,5) === -1 &&
- a.indexOf(1,3) === -1 &&
- [ ].indexOf(1,0) === -1 ){
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 if fromIndex is greater than + Array length +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = [1,2,3]; + if (a.indexOf(1,5) === -1 && + a.indexOf(1,3) === -1 && + [ ].indexOf(1,0) === -1 ){ + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-1.js index c641b2d7f..5e36d9b9f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-1.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 3].indexOf(1, 2) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 when 'fromIndex' is length of + array - 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].indexOf(1, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-2.js index f701c93a4..42f3e0436 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-2.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 3].indexOf(3, 2) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns correct index when 'fromIndex' is + length of array - 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].indexOf(3, 2) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-3.js index 36178b585..6c5010f4e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-3.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [].indexOf(1, 0) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 when 'fromIndex' and 'length' + are both 0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [].indexOf(1, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-4.js index fea341fdd..ff48872eb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-4.js @@ -1,16 +1,16 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 3].indexOf(1, 1) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf returns -1 when 'fromIndex' is 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].indexOf(1, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-5.js index 0036b298b..0428f5fbd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-7-5.js @@ -1,16 +1,16 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 3].indexOf(2, 1) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf returns correct index when 'fromIndex' is 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].indexOf(2, 1) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-1.js index 8e00f731d..f7b9ba2ef 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-1.js @@ -1,22 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-1.js
- * @description Array.prototype.indexOf with negative fromIndex
- */
-
-
-function testcase() {
- var a = new Array(1,2,3);
-
- if (a.indexOf(2,-1) === -1 &&
- a.indexOf(2,-2) === 1 &&
- a.indexOf(1,-3) === 0 &&
- a.indexOf(1,-5.3) === 0 ) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf with negative fromIndex +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,3); + + if (a.indexOf(2,-1) === -1 && + a.indexOf(2,-2) === 1 && + a.indexOf(1,-3) === 0 && + a.indexOf(1,-5.3) === 0 ) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-2.js index d749ecc7d..dcaf435d9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-2.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 3, 4].indexOf(4, -1) === 3;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns correct index when 'fromIndex' is + -1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3, 4].indexOf(4, -1) === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-3.js index 09155bb00..ab1c88cb1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-3.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 3, 4].indexOf(1, -3) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 when abs('fromIndex') is length + of array - 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3, 4].indexOf(1, -3) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-4.js index 188aa57ee..189ae4a69 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-8-4.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 3, 4].indexOf(0, -4) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf returns -1 when abs('fromIndex') is length + of array +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3, 4].indexOf(0, -4) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-1.js index 07c3fa630..5a7383e9d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-1.js @@ -1,22 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return true}};
- var _false = false;
- var a = [obj,"true", undefined,0,_false,null,1,"str",0,1,true,false,true,false];
- if (a.indexOf(true) === 10 && //a[10]=true
- a.indexOf(false) === 4) //a[4] =_false
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index (boolean) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {toString:function (){return true}}; + var _false = false; + var a = [obj,"true", undefined,0,_false,null,1,"str",0,1,true,false,true,false]; + if (a.indexOf(true) === 10 && //a[10]=true + a.indexOf(false) === 4) //a[4] =_false + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-10.js index 9147f4a09..fa24b0c49 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-10.js @@ -1,23 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * note that prior to the finally ES5 draft SameValue was used for comparisions
- * and hence NaNs could be found using indexOf *
- *
- * @path ch15/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)
- */
-
-
-function testcase() {
- var _NaN = NaN;
- var a = new Array("NaN",undefined,0,false,null,{toString:function (){return NaN}},"false",_NaN,NaN);
- if (a.indexOf(NaN) === -1) // NaN is equal to nothing, including itself.
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +info: > + note that prior to the finally ES5 draft SameValue was used for comparisions + and hence NaNs could be found using indexOf * +description: Array.prototype.indexOf must return correct index (NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + var _NaN = NaN; + var a = new Array("NaN",undefined,0,false,null,{toString:function (){return NaN}},"false",_NaN,NaN); + if (a.indexOf(NaN) === -1) // NaN is equal to nothing, including itself. + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-11.js index 82b0b08fa..f6996f129 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-11.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [20];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- arr[1] = 1;
- return 0;
- },
- configurable: true
- });
-
- return arr.indexOf(1) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - the length of iteration isn't changed by + adding elements to the array during iteration +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [20]; + + Object.defineProperty(arr, "0", { + get: function () { + arr[1] = 1; + return 0; + }, + configurable: true + }); + + return arr.indexOf(1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js index 688093ce9..0b7f6c335 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js @@ -1,25 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return 0}};
- var one = 1;
- var _float = -(4/3);
- var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3));
- if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3)
- a.indexOf(0) === 7 && // a[7] = +0, 0===+0
- a.indexOf(-0) === 7 && // a[7] = +0, -0===+0
- a.indexOf(1) === 10 ) // a[10] =one=== 1
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index (Number) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {toString:function (){return 0}}; + var one = 1; + var _float = -(4/3); + var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); + if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) + a.indexOf(0) === 7 && // a[7] = +0, 0===+0 + a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 + a.indexOf(1) === 10 ) // a[10] =one=== 1 + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-3.js index 47ab35477..8358d3930 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-3.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return "false"}};
- var szFalse = "false";
- var a = new Array("false1",undefined,0,false,null,1,obj,0,szFalse, "false");
- if (a.indexOf("false") === 8) //a[8]=szFalse
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index(string) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {toString:function (){return "false"}}; + var szFalse = "false"; + var a = new Array("false1",undefined,0,false,null,1,obj,0,szFalse, "false"); + if (a.indexOf("false") === 8) //a[8]=szFalse + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-4.js index 8dbf466b1..75b73f32b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-4.js @@ -1,22 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return undefined;}};
- var _undefined1 = undefined;
- var _undefined2;
- var a = new Array(true,0,false,null,1,"undefined",obj,1,_undefined2,_undefined1,undefined);
- if (a.indexOf(undefined) === 8) //a[8]=_undefined2
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index(undefined) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {toString:function (){return undefined;}}; + var _undefined1 = undefined; + var _undefined2; + var a = new Array(true,0,false,null,1,"undefined",obj,1,_undefined2,_undefined1,undefined); + if (a.indexOf(undefined) === 8) //a[8]=_undefined2 + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-5.js index c54e53629..726536dc8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-5.js @@ -1,22 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var obj1 = {toString:function (){return "false"}};
- var obj2 = {toString:function (){return "false"}};
- var obj3 = obj1;
- var a = new Array(false,undefined,0,false,null,{toString:function (){return "false"}},"false",obj2,obj1,obj3);
- if (a.indexOf(obj3) === 8) //a[8] = obj1;
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index (Object) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj1 = {toString:function (){return "false"}}; + var obj2 = {toString:function (){return "false"}}; + var obj3 = obj1; + var a = new Array(false,undefined,0,false,null,{toString:function (){return "false"}},"false",obj2,obj1,obj3); + if (a.indexOf(obj3) === 8) //a[8] = obj1; + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-6.js index 7fd3f5b5e..6010f4b87 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-6.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return null}};
- var _null = null;
- var a = new Array(true,undefined,0,false,_null,1,"str",0,1,obj,true,false,null);
- if (a.indexOf(null) === 4 ) //a[4]=_null
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index(null) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {toString:function (){return null}}; + var _null = null; + var a = new Array(true,undefined,0,false,_null,1,"str",0,1,obj,true,false,null); + if (a.indexOf(null) === 4 ) //a[4]=_null + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-7.js index d91e3d086..bebd58d56 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-7.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var a = new Array(0,1,2,3);
- a[2] = a;
- if (a.indexOf(a) === 2 &&
- a.indexOf(3) === 3 )
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index (self reference) +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(0,1,2,3); + a[2] = a; + if (a.indexOf(a) === 2 && + a.indexOf(3) === 3 ) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-8.js index 7dd751c78..b04bba42d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-8.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var b = new Array("0,1");
- var a = new Array(0,b,"0,1",3);
- if (a.indexOf(b.toString()) === 2 &&
- a.indexOf("0,1") === 2 )
- {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index (Array) +includes: [runTestCase.js] +---*/ + +function testcase() { + var b = new Array("0,1"); + var a = new Array(0,b,"0,1",3); + if (a.indexOf(b.toString()) === 2 && + a.indexOf("0,1") === 2 ) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-9.js index bd811ae03..ee1c78ab4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-9.js @@ -1,25 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
- var a = new Array(0,1);
- a[4294967294] = 2; // 2^32-2 - is max array element
- a[4294967295] = 3; // 2^32-1 added as non-array element property
- a[4294967296] = 4; // 2^32 added as non-array element property
- a[4294967297] = 5; // 2^32+1 added as non-array element property
-
- // start searching near the end so in case implementation actually tries to test all missing elements!!
- return (a.indexOf(2,4294967290 ) === 4294967294 &&
- a.indexOf(3,4294967290) === -1 &&
- a.indexOf(4,4294967290) === -1 &&
- a.indexOf(5,4294967290) === -1 ) ;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf must return correct index (Sparse Array) +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(0,1); + a[4294967294] = 2; // 2^32-2 - is max array element + a[4294967295] = 3; // 2^32-1 added as non-array element property + a[4294967296] = 4; // 2^32 added as non-array element property + a[4294967297] = 5; // 2^32+1 added as non-array element property + + // start searching near the end so in case implementation actually tries to test all missing elements!! + return (a.indexOf(2,4294967290 ) === 4294967294 && + a.indexOf(3,4294967290) === -1 && + a.indexOf(4,4294967290) === -1 && + a.indexOf(5,4294967290) === -1 ) ; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-1.js index 54c7923bd..b05853d15 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-1.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { };
-
- Object.defineProperty(arr, "length", {
- get: function () {
- arr[2] = "length";
- return 3;
- },
- configurable: true
- });
-
- return 2 === Array.prototype.indexOf.call(arr, "length");
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - added properties in step 2 are visible + here +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { }; + + Object.defineProperty(arr, "length", { + get: function () { + arr[2] = "length"; + return 3; + }, + configurable: true + }); + + return 2 === Array.prototype.indexOf.call(arr, "length"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-10.js index acc2ebc4c..7ad43af7c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-10.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(Array.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- try {
- return arr.indexOf(6.99) === 1;
- } finally {
- delete Array.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - properties can be added to prototype + after current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(Array.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + try { + return arr.indexOf(6.99) === 1; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-11.js index 66126dc25..83146efbe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-11.js @@ -1,33 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { length: 2 };
-
- Object.defineProperty(arr, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- return -1 === Array.prototype.indexOf.call(arr, 6.99);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleting own property causes index + property not to be visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { length: 2 }; + + Object.defineProperty(arr, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + return -1 === Array.prototype.indexOf.call(arr, 6.99); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-12.js index 256ad2671..6efe02c52 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-12.js @@ -1,33 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [1, 2];
-
- Object.defineProperty(arr, "1", {
- get: function () {
- return "6.99";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- return -1 === arr.indexOf("6.99");
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleting own property causes index + property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [1, 2]; + + Object.defineProperty(arr, "1", { + get: function () { + return "6.99"; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + return -1 === arr.indexOf("6.99"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-13.js index 33f4f928d..db597955d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-13.js @@ -1,31 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { 2: 2, length: 20 };
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete Object.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- return -1 === Array.prototype.indexOf.call(arr, 1);
- } finally {
- delete Object.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleting property of prototype causes + prototype index property not to be visited on an Array-like Object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { 2: 2, length: 20 }; + + Object.defineProperty(arr, "0", { + get: function () { + delete Object.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + return -1 === Array.prototype.indexOf.call(arr, 1); + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-14.js index 2761b6a99..e742b2bf3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-14.js @@ -1,31 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete Array.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- return -1 === arr.indexOf(1);
- } finally {
- delete Array.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleting property of prototype causes + prototype index property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + delete Array.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + return -1 === arr.indexOf(1); + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-15.js index 6aee39a24..e492ebd1c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-15.js @@ -1,31 +1,34 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { 0: 0, 1: 111, 2: 2, length: 10 };
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- return 1 === Array.prototype.indexOf.call(arr, 1);
- } finally {
- delete Object.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleting own property with prototype + property causes prototype index property to be visited on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + return 1 === Array.prototype.indexOf.call(arr, 1); + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-16.js index 23696e159..8cb24c817 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-16.js @@ -1,31 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [0, 111, 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- return 1 === arr.indexOf(1);
- } finally {
- delete Array.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleting own property with prototype + property causes prototype index property to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 111, 2]; + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + return 1 === arr.indexOf(1); + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-17.js index cbf849792..f1b062895 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-17.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2, "last"];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- arr.length = 3;
- return 0;
- },
- configurable: true
- });
-
- return -1 === arr.indexOf("last");
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - decreasing length of array causes index + property not to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2, "last"]; + + Object.defineProperty(arr, "0", { + get: function () { + arr.length = 3; + return 0; + }, + configurable: true + }); + + return -1 === arr.indexOf("last"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-18.js index dae72c99f..bdfde4242 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-18.js @@ -1,37 +1,39 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2];
-
- try {
- Object.defineProperty(Array.prototype, "2", {
- get: function () {
- return "prototype";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- return 2 === arr.indexOf("prototype");
- } finally {
- delete Array.prototype[2];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - decreasing length of array with + prototype property causes prototype index property to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2]; + + try { + Object.defineProperty(Array.prototype, "2", { + get: function () { + return "prototype"; + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + return 2 === arr.indexOf("prototype"); + } finally { + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-19.js index bb919355f..dcf6266dc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-19.js @@ -1,33 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- return "unconfigurable";
- },
- configurable: false
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- return 2 === arr.indexOf("unconfigurable");
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - decreasing length of array does not + delete non-configurable properties +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2]; + + Object.defineProperty(arr, "2", { + get: function () { + return "unconfigurable"; + }, + configurable: false + }); + + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + return 2 === arr.indexOf("unconfigurable"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-2.js index fe4c97ecd..db6f90286 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-2.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { length: 30 };
- var targetObj = function () { };
-
- var fromIndex = {
- valueOf: function () {
- arr[4] = targetObj;
- return 3;
- }
- };
-
- return 4 === Array.prototype.indexOf.call(arr, targetObj, fromIndex);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - added properties in step 5 are visible + here on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { length: 30 }; + var targetObj = function () { }; + + var fromIndex = { + valueOf: function () { + arr[4] = targetObj; + return 3; + } + }; + + return 4 === Array.prototype.indexOf.call(arr, targetObj, fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-3.js index 510a09134..a4c8a2099 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-3.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [];
- arr.length = 30;
- var targetObj = function () { };
-
- var fromIndex = {
- valueOf: function () {
- arr[4] = targetObj;
- return 3;
- }
- };
-
- return 4 === arr.indexOf(targetObj, fromIndex);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - added properties in step 5 are visible + here on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = []; + arr.length = 30; + var targetObj = function () { }; + + var fromIndex = { + valueOf: function () { + arr[4] = targetObj; + return 3; + } + }; + + return 4 === arr.indexOf(targetObj, fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-4.js index 8518f8cba..25f33503d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-4.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { 2: 6.99 };
-
- Object.defineProperty(arr, "length", {
- get: function () {
- delete arr[2];
- return 3;
- },
- configurable: true
- });
-
- return -1 === Array.prototype.indexOf.call(arr, 6.99);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleted properties in step 2 are visible + here +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { 2: 6.99 }; + + Object.defineProperty(arr, "length", { + get: function () { + delete arr[2]; + return 3; + }, + configurable: true + }); + + return -1 === Array.prototype.indexOf.call(arr, 6.99); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-5.js index 5a49af4d2..a9b654bad 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-5.js @@ -1,25 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { 10: false, length: 30 };
-
- var fromIndex = {
- valueOf: function () {
- delete arr[10];
- return 3;
- }
- };
-
- return -1 === Array.prototype.indexOf.call(arr, false, fromIndex);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleted properties in step 5 are visible + here on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { 10: false, length: 30 }; + + var fromIndex = { + valueOf: function () { + delete arr[10]; + return 3; + } + }; + + return -1 === Array.prototype.indexOf.call(arr, false, fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-6.js index 51d633b34..0575e20d4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-6.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [];
- arr[10] = "10";
- arr.length = 20;
-
- var fromIndex = {
- valueOf: function () {
- delete arr[10];
- return 3;
- }
- };
-
- return -1 === arr.indexOf("10", fromIndex);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - deleted properties in step 5 are visible + here on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = []; + arr[10] = "10"; + arr.length = 20; + + var fromIndex = { + valueOf: function () { + delete arr[10]; + return 3; + } + }; + + return -1 === arr.indexOf("10", fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-7.js index 736e10843..512abbeb5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-7.js @@ -1,31 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { length: 2 };
-
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(arr, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(arr, 1) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - properties added into own object after + current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { length: 2 }; + + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(arr, "1", { + get: function () { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + return Array.prototype.indexOf.call(arr, 1) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-8.js index f4f6c3e0c..67fdc3ddd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-8.js @@ -1,31 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(arr, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- return arr.indexOf(1) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - properties added into own object after + current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(arr, "1", { + get: function () { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + return arr.indexOf(1) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-9.js index c2b57d402..cd87f5a1b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-a-9.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = { length: 2 };
-
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(Object.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- try {
- return Array.prototype.indexOf.call(arr, 6.99) === 1;
- } finally {
- delete Object.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - properties can be added to prototype + after current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { length: 2 }; + + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(Object.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + try { + return Array.prototype.indexOf.call(arr, 6.99) === 1; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-1.js index 70d59948f..22a0ebd75 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-1.js @@ -1,16 +1,16 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [0, , 2].indexOf(undefined) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - non-existent property wouldn't be called +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, , 2].indexOf(undefined) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-1.js index 57aea0a34..8d2046ad7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-1.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var obj = { 0: 0, 1: 1, 2: 2, length: 3 };
- return Array.prototype.indexOf.call(obj, 0) === 0 &&
- Array.prototype.indexOf.call(obj, 1) === 1 &&
- Array.prototype.indexOf.call(obj, 2) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own data + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = { 0: 0, 1: 1, 2: 2, length: 3 }; + return Array.prototype.indexOf.call(obj, 0) === 0 && + Array.prototype.indexOf.call(obj, 1) === 1 && + Array.prototype.indexOf.call(obj, 2) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-10.js index 7fa23f0c8..95d42dd5c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-10.js @@ -1,40 +1,42 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { length: 3 };
- Object.defineProperty(obj, "0", {
- get: function () {
- return 0;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "2", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return 0 === Array.prototype.indexOf.call(obj, 0) &&
- 1 === Array.prototype.indexOf.call(obj, 1) &&
- 2 === Array.prototype.indexOf.call(obj, 2);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { length: 3 }; + Object.defineProperty(obj, "0", { + get: function () { + return 0; + }, + configurable: true + }); + + Object.defineProperty(obj, "1", { + get: function () { + return 1; + }, + configurable: true + }); + + Object.defineProperty(obj, "2", { + get: function () { + return 2; + }, + configurable: true + }); + + return 0 === Array.prototype.indexOf.call(obj, 0) && + 1 === Array.prototype.indexOf.call(obj, 1) && + 2 === Array.prototype.indexOf.call(obj, 2); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-11.js index ac64a33c3..5a11c0c45 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-11.js @@ -1,29 +1,31 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [];
- try {
- Array.prototype[0] = false;
- Object.defineProperty(arr, "0", {
- get: function () {
- return true;
- },
- configurable: true
- });
-
- return 0 === arr.indexOf(true);
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = []; + try { + Array.prototype[0] = false; + Object.defineProperty(arr, "0", { + get: function () { + return true; + }, + configurable: true + }); + + return 0 === arr.indexOf(true); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-12.js index 5e268ce32..a09ef5444 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-12.js @@ -1,29 +1,32 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var obj = { length: 1 };
-
- try {
- Object.prototype[0] = false;
- Object.defineProperty(obj, "0", {
- get: function () {
- return true;
- },
- configurable: true
- });
-
- return 0 === Array.prototype.indexOf.call(obj, true);
- } finally {
- delete Object.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property that overrides an inherited data property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = { length: 1 }; + + try { + Object.prototype[0] = false; + Object.defineProperty(obj, "0", { + get: function () { + return true; + }, + configurable: true + }); + + return 0 === Array.prototype.indexOf.call(obj, true); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-13.js index 06450b83e..fe76f0733 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-13.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [];
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return false;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "0", {
- get: function () {
- return true;
- },
- configurable: true
- });
-
- return 0 === arr.indexOf(true);
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = []; + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return false; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + return true; + }, + configurable: true + }); + + return 0 === arr.indexOf(true); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-14.js index 72417e9ff..10f7c94ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-14.js @@ -1,36 +1,39 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { length: 1 };
-
- try {
- Object.defineProperty(Object.prototype, "0", {
- get: function () {
- return false;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "0", {
- get: function () {
- return true;
- },
- configurable: true
- });
-
- return 0 === Array.prototype.indexOf.call(obj, true);
- } finally {
- delete Object.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property that overrides an inherited accessor property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { length: 1 }; + + try { + Object.defineProperty(Object.prototype, "0", { + get: function () { + return false; + }, + configurable: true + }); + + Object.defineProperty(obj, "0", { + get: function () { + return true; + }, + configurable: true + }); + + return 0 === Array.prototype.indexOf.call(obj, true); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-15.js index 9093071c3..af124ec94 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-15.js @@ -1,44 +1,46 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 10;
- },
- configurable: true
- });
-
- Object.defineProperty(Array.prototype, "1", {
- get: function () {
- return 20;
- },
- configurable: true
- });
-
- Object.defineProperty(Array.prototype, "2", {
- get: function () {
- return 30;
- },
- configurable: true
- });
-
- return 0 === [, , , ].indexOf(10) &&
- 1 === [, , , ].indexOf(20) &&
- 2 === [, , , ].indexOf(30);
- } finally {
- delete Array.prototype[0];
- delete Array.prototype[1];
- delete Array.prototype[2];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is inherited + accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 10; + }, + configurable: true + }); + + Object.defineProperty(Array.prototype, "1", { + get: function () { + return 20; + }, + configurable: true + }); + + Object.defineProperty(Array.prototype, "2", { + get: function () { + return 30; + }, + configurable: true + }); + + return 0 === [, , , ].indexOf(10) && + 1 === [, , , ].indexOf(20) && + 2 === [, , , ].indexOf(30); + } finally { + delete Array.prototype[0]; + delete Array.prototype[1]; + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-16.js index 64e58f666..112bd12b7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-16.js @@ -1,45 +1,47 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- try {
- Object.defineProperty(Object.prototype, "0", {
- get: function () {
- return 10;
- },
- configurable: true
- });
-
- Object.defineProperty(Object.prototype, "1", {
- get: function () {
- return 20;
- },
- configurable: true
- });
-
- Object.defineProperty(Object.prototype, "2", {
- get: function () {
- return 30;
- },
- configurable: true
- });
-
- return 0 === Array.prototype.indexOf.call({ length: 3 }, 10) &&
- 1 === Array.prototype.indexOf.call({ length: 3 }, 20) &&
- 2 === Array.prototype.indexOf.call({ length: 3 }, 30);
- } finally {
- delete Object.prototype[0];
- delete Object.prototype[1];
- delete Object.prototype[2];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is inherited + accessor property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Object.defineProperty(Object.prototype, "0", { + get: function () { + return 10; + }, + configurable: true + }); + + Object.defineProperty(Object.prototype, "1", { + get: function () { + return 20; + }, + configurable: true + }); + + Object.defineProperty(Object.prototype, "2", { + get: function () { + return 30; + }, + configurable: true + }); + + return 0 === Array.prototype.indexOf.call({ length: 3 }, 10) && + 1 === Array.prototype.indexOf.call({ length: 3 }, 20) && + 2 === Array.prototype.indexOf.call({ length: 3 }, 30); + } finally { + delete Object.prototype[0]; + delete Object.prototype[1]; + delete Object.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-17.js index 58fef54ff..20ba76dff 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-17.js @@ -1,22 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [];
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- return arr.indexOf(undefined) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = []; + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + return arr.indexOf(undefined) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-18.js index 8912be8ee..9a5bde6ad 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-18.js @@ -1,22 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj = { length: 1 };
- Object.defineProperty(obj, "0", {
- set: function () { },
- configurable: true
- });
-
- return 0 === Array.prototype.indexOf.call(obj, undefined);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { length: 1 }; + Object.defineProperty(obj, "0", { + set: function () { }, + configurable: true + }); + + return 0 === Array.prototype.indexOf.call(obj, undefined); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-19.js index 369476570..153e8929f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-19.js @@ -1,34 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return arr.indexOf(undefined) === 0;
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +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 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = []; + + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 2; + }, + configurable: true + }); + + return arr.indexOf(undefined) === 0; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-2.js index b74ea0e08..15e71a186 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-2.js @@ -1,17 +1,19 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- return [true, true, true].indexOf(true) === 0 &&
- [false, true, true].indexOf(true) === 1 &&
- [false, false, true].indexOf(true) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own data + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + return [true, true, true].indexOf(true) === 0 && + [false, true, true].indexOf(true) === 1 && + [false, false, true].indexOf(true) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-20.js index 865d0cb0d..b38a647af 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-20.js @@ -1,35 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var proto = {};
- Object.defineProperty(proto, "0", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 1;
-
- Object.defineProperty(child, "0", {
- set: function () { },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(child, undefined) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +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 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var proto = {}; + Object.defineProperty(proto, "0", { + get: function () { + return 2; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 1; + + Object.defineProperty(child, "0", { + set: function () { }, + configurable: true + }); + + return Array.prototype.indexOf.call(child, undefined) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-21.js index b58131bf5..ed5d2ebdf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-21.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Object.defineProperty(Array.prototype, "0", {
- set: function () { },
- configurable: true
- });
- return 0 === [, ].indexOf(undefined);
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is inherited + accessor property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Object.defineProperty(Array.prototype, "0", { + set: function () { }, + configurable: true + }); + return 0 === [, ].indexOf(undefined); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-22.js index 418abf42b..a2261a5a5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-22.js @@ -1,24 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- try {
- Object.defineProperty(Object.prototype, "0", {
- set: function () { },
- configurable: true
- });
- return 0 === Array.prototype.indexOf.call({ length: 1 }, undefined);
- } finally {
- delete Object.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is inherited + accessor property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Object.defineProperty(Object.prototype, "0", { + set: function () { }, + configurable: true + }); + return 0 === Array.prototype.indexOf.call({ length: 1 }, undefined); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-23.js index 624c2ea43..6c2398ac1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-23.js @@ -1,31 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var targetObj = {};
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[0] = targetObj;
- fnGlobalObject()[100] = "100";
- fnGlobalObject()[200] = "200";
- fnGlobalObject().length = 200;
- return 0 === Array.prototype.indexOf.call(fnGlobalObject(), targetObj) &&
- 100 === Array.prototype.indexOf.call(fnGlobalObject(), "100") &&
- -1 === Array.prototype.indexOf.call(fnGlobalObject(), "200");
- } finally {
- delete fnGlobalObject()[0];
- delete fnGlobalObject()[100];
- delete fnGlobalObject()[200];
- fnGlobalObject().length = oldLen;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - This object is the global object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + var targetObj = {}; + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[0] = targetObj; + fnGlobalObject()[100] = "100"; + fnGlobalObject()[200] = "200"; + fnGlobalObject().length = 200; + return 0 === Array.prototype.indexOf.call(fnGlobalObject(), targetObj) && + 100 === Array.prototype.indexOf.call(fnGlobalObject(), "100") && + -1 === Array.prototype.indexOf.call(fnGlobalObject(), "200"); + } finally { + delete fnGlobalObject()[0]; + delete fnGlobalObject()[100]; + delete fnGlobalObject()[200]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-25.js index c42475ef8..6244fce24 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-25.js @@ -1,21 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var func = function (a, b) {
- return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) &&
- -1 === Array.prototype.indexOf.call(arguments, arguments[1]);
- };
-
- return func(true);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf applied to Arguments object which + implements its own property get method (number of arguments is + less than number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var func = function (a, b) { + return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && + -1 === Array.prototype.indexOf.call(arguments, arguments[1]); + }; + + return func(true); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-26.js index 1dd42a99c..6d1a797db 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-26.js @@ -1,22 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var func = function (a, b) {
- return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) &&
- 1 === Array.prototype.indexOf.call(arguments, arguments[1]) &&
- -1 === Array.prototype.indexOf.call(arguments, arguments[2]);
- };
-
- return func(0, true);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf applied to Arguments object which + implements its own property get method (number of arguments equals + to number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var func = function (a, b) { + return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && + 1 === Array.prototype.indexOf.call(arguments, arguments[1]) && + -1 === Array.prototype.indexOf.call(arguments, arguments[2]); + }; + + return func(0, true); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-27.js index 52097dffa..fc1949d1a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-27.js @@ -1,22 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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)
- */
-
-
-function testcase() {
-
- var func = function (a, b) {
- return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) &&
- 3 === Array.prototype.indexOf.call(arguments, arguments[3]) &&
- -1 === Array.prototype.indexOf.call(arguments, arguments[4]);
- };
-
- return func(0, false, 0, true);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf applied to Arguments object which + implements its own property get method (number of arguments is + greater than number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var func = function (a, b) { + return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && + 3 === Array.prototype.indexOf.call(arguments, arguments[3]) && + -1 === Array.prototype.indexOf.call(arguments, arguments[4]); + }; + + return func(0, false, 0, true); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-28.js index 554516c25..6672dc44d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-28.js @@ -1,38 +1,40 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- preIterVisible = true;
- return false;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- if (preIterVisible) {
- return true;
- } else {
- return false;
- }
- },
- configurable: true
- });
-
- return arr.indexOf(true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - side-effects are visible in subsequent + iterations on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var arr = []; + + Object.defineProperty(arr, "0", { + get: function () { + preIterVisible = true; + return false; + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + if (preIterVisible) { + return true; + } else { + return false; + } + }, + configurable: true + }); + + return arr.indexOf(true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-29.js index bef85f25c..fcd79d7ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-29.js @@ -1,38 +1,40 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- preIterVisible = true;
- return false;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "1", {
- get: function () {
- if (preIterVisible) {
- return true;
- } else {
- return false;
- }
- },
- configurable: true
- });
-
- return Array.prototype.indexOf.call(obj, true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - side-effects are visible in subsequent + iterations on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var obj = { length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + preIterVisible = true; + return false; + }, + configurable: true + }); + + Object.defineProperty(obj, "1", { + get: function () { + if (preIterVisible) { + return true; + } else { + return false; + } + }, + configurable: true + }); + + return Array.prototype.indexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-3.js index 0c453edfe..01c9129cb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-3.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Array.prototype[0] = false;
- return [true].indexOf(true) === 0;
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own data + property that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype[0] = false; + return [true].indexOf(true) === 0; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-30.js index 20c2f0fef..2dc6def72 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-30.js @@ -1,39 +1,41 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var accessed = false;
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- throw new TypeError();
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- accessed = true;
- return true;
- },
- configurable: true
- });
-
- try {
- arr.indexOf(true);
- return false;
- } catch (e) {
- return (e instanceof TypeError) && !accessed;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - terminates iteration on unhandled + exception on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var arr = []; + + Object.defineProperty(arr, "0", { + get: function () { + throw new TypeError(); + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + accessed = true; + return true; + }, + configurable: true + }); + + try { + arr.indexOf(true); + return false; + } catch (e) { + return (e instanceof TypeError) && !accessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-31.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-31.js index 5ac4092d5..8f4e5a2bb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-31.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-31.js @@ -1,40 +1,42 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var accessed = false;
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- throw new TypeError();
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "1", {
- get: function () {
- accessed = true;
- return true;
- },
- configurable: true
- });
-
- try {
- Array.prototype.indexOf.call(obj, true);
- return false;
- } catch (e) {
- return (e instanceof TypeError) && !accessed;
- }
-
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - terminates iteration on unhandled + exception on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var obj = { length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + throw new TypeError(); + }, + configurable: true + }); + + Object.defineProperty(obj, "1", { + get: function () { + accessed = true; + return true; + }, + configurable: true + }); + + try { + Array.prototype.indexOf.call(obj, true); + return false; + } catch (e) { + return (e instanceof TypeError) && !accessed; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-4.js index c02809cb0..60e85ff2e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-4.js @@ -1,21 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- try {
- Object.prototype[0] = false;
- return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true);
- } finally {
- delete Object.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own data + property that overrides an inherited data property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Object.prototype[0] = false; + return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-5.js index 921a001c6..baaaf396a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-5.js @@ -1,25 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return false;
- },
- configurable: true
- });
- return 0 === [true].indexOf(true);
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own data + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return false; + }, + configurable: true + }); + return 0 === [true].indexOf(true); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-6.js index 97710df6c..d55e38499 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-6.js @@ -1,26 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- try {
- Object.defineProperty(Object.prototype, "0", {
- get: function () {
- return false;
- },
- configurable: true
- });
- return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true);
- } finally {
- delete Object.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own data + property that overrides an inherited accessor property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Object.defineProperty(Object.prototype, "0", { + get: function () { + return false; + }, + configurable: true + }); + return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-7.js index 4b320c21d..431744ff1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-7.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- try {
- Array.prototype[0] = true;
- Array.prototype[1] = false;
- Array.prototype[2] = "true";
- return 0 === [, , , ].indexOf(true) &&
- 1 === [, , , ].indexOf(false) &&
- 2 === [, , , ].indexOf("true");
- } finally {
- delete Array.prototype[0];
- delete Array.prototype[1];
- delete Array.prototype[2];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is inherited + data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype[0] = true; + Array.prototype[1] = false; + Array.prototype[2] = "true"; + return 0 === [, , , ].indexOf(true) && + 1 === [, , , ].indexOf(false) && + 2 === [, , , ].indexOf("true"); + } finally { + delete Array.prototype[0]; + delete Array.prototype[1]; + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-8.js index 82cf0242e..e70ca50e5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-8.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- try {
- Object.prototype[0] = true;
- Object.prototype[1] = false;
- Object.prototype[2] = "true";
- return 0 === Array.prototype.indexOf.call({ length: 3 }, true) &&
- 1 === Array.prototype.indexOf.call({ length: 3 }, false) &&
- 2 === Array.prototype.indexOf.call({ length: 3 }, "true");
- } finally {
- delete Object.prototype[0];
- delete Object.prototype[1];
- delete Object.prototype[2];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is inherited + data property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Object.prototype[0] = true; + Object.prototype[1] = false; + Object.prototype[2] = "true"; + return 0 === Array.prototype.indexOf.call({ length: 3 }, true) && + 1 === Array.prototype.indexOf.call({ length: 3 }, false) && + 2 === Array.prototype.indexOf.call({ length: 3 }, "true"); + } finally { + delete Object.prototype[0]; + delete Object.prototype[1]; + delete Object.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-9.js index f25525686..1b991a52c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-i-9.js @@ -1,38 +1,40 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var arr = [, , , ];
- Object.defineProperty(arr, "0", {
- get: function () {
- return 0;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "2", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return arr.indexOf(0) === 0 && arr.indexOf(1) === 1 && arr.indexOf(2) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [, , , ]; + Object.defineProperty(arr, "0", { + get: function () { + return 0; + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + return 1; + }, + configurable: true + }); + + Object.defineProperty(arr, "2", { + get: function () { + return 2; + }, + configurable: true + }); + + return arr.indexOf(0) === 0 && arr.indexOf(1) === 1 && arr.indexOf(2) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-1.js index 40130e6c2..dc9ee02d1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-1.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return ["true"].indexOf(true) === -1 &&
- ["0"].indexOf(0) === -1 &&
- [false].indexOf(0) === -1 &&
- [undefined].indexOf(0) === -1 &&
- [null].indexOf(0) === -1 &&
- [[]].indexOf(0) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - type of array element is different from + type of search element +includes: [runTestCase.js] +---*/ + +function testcase() { + + return ["true"].indexOf(true) === -1 && + ["0"].indexOf(0) === -1 && + [false].indexOf(0) === -1 && + [undefined].indexOf(0) === -1 && + [null].indexOf(0) === -1 && + [[]].indexOf(0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-10.js index 4434cc59b..ae9f136c2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-10.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [false, true].indexOf(true) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - both array element and search element + are Boolean type, and they have same value +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [false, true].indexOf(true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-11.js index 835f5859d..82f785122 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-11.js @@ -1,19 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- var obj1 = {};
- var obj2 = {};
- var obj3 = obj2;
- return [{}, obj1, obj2].indexOf(obj3) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - both array element and search element + are Object type, and they refer to the same object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj1 = {}; + var obj2 = {}; + var obj3 = obj2; + return [{}, obj1, obj2].indexOf(obj3) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-2.js index b6d245e6e..c0dadc3ab 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-2.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [undefined].indexOf() === 0 && [undefined].indexOf(undefined) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - both type of array element and type of + search element are Undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [undefined].indexOf() === 0 && [undefined].indexOf(undefined) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-3.js index 4468c69e0..28bf65c33 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-3.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [null].indexOf(null) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - both type of array element and type of + search element are null +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [null].indexOf(null) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-4.js index 1c02cef3e..303018e50 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-4.js @@ -1,16 +1,16 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [+NaN, NaN, -NaN].indexOf(NaN) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - search element is NaN +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [+NaN, NaN, -NaN].indexOf(NaN) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-5.js index 3727b5289..b90747588 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-5.js @@ -1,16 +1,16 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [+NaN, NaN, -NaN].indexOf(-NaN) === -1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.indexOf - search element is -NaN +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [+NaN, NaN, -NaN].indexOf(-NaN) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-6.js index bcb7d59af..ee01067d7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-6.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [+0].indexOf(-0) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - array element is +0 and search element + is -0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [+0].indexOf(-0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-7.js index e85a7b228..7dcec9abc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-7.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [-0].indexOf(+0) === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - array element is -0 and search element + is +0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [-0].indexOf(+0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-8.js index eecaaa28d..7e9805a83 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-8.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [-1, 0, 1].indexOf(1) === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - both array element and search element + are Number, and they have same value +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [-1, 0, 1].indexOf(1) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-9.js index b6a72a373..cf49ade9e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-ii-9.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return ["", "ab", "bca", "abc"].indexOf("abc") === 3;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - both array element and search element + are String, and they have exactly the same sequence of characters +includes: [runTestCase.js] +---*/ + +function testcase() { + + return ["", "ab", "bca", "abc"].indexOf("abc") === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-1.js index 78a042b12..211b4ae10 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-1.js @@ -1,16 +1,18 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
-
- return [1, 2, 2, 1, 2].indexOf(2) === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - returns index of last one when more than + two elements in array are eligible +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 2, 1, 2].indexOf(2) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-2.js index 6c7b3e617..13ed62ac9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-b-iii-2.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/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
- */
-
-
-function testcase() {
- var arr = [1, 2, , 1, 2];
- var elementThirdAccessed = false;
- var elementFifthAccessed = false;
-
- Object.defineProperty(arr, "2", {
- get: function () {
- elementThirdAccessed = true;
- return 2;
- },
- configurable: true
- });
- Object.defineProperty(arr, "4", {
- get: function () {
- elementFifthAccessed = true;
- return 2;
- },
- configurable: true
- });
-
- arr.indexOf(2);
- return !elementThirdAccessed && !elementFifthAccessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.indexOf - returns without visiting subsequent + element once search value is found +includes: [runTestCase.js] +---*/ + +function testcase() { + var arr = [1, 2, , 1, 2]; + var elementThirdAccessed = false; + var elementFifthAccessed = false; + + Object.defineProperty(arr, "2", { + get: function () { + elementThirdAccessed = true; + return 2; + }, + configurable: true + }); + Object.defineProperty(arr, "4", { + get: function () { + elementFifthAccessed = true; + return 2; + }, + configurable: true + }); + + arr.indexOf(2); + return !elementThirdAccessed && !elementFifthAccessed; + } +runTestCase(testcase); |