diff options
Diffstat (limited to 'test/suite/ch15/15.4/15.4.4/15.4.4.15')
193 files changed, 4975 insertions, 4643 deletions
diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-0-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-0-1.js index 90f3b8f8b..64371f367 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-0-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-0-1.js
- * @description Array.prototype.lastIndexOf must exist as a function
- */
-
-
-function testcase() {
- var f = Array.prototype.lastIndexOf;
- 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.lastIndexOf must exist as a function +includes: [runTestCase.js] +---*/ + +function testcase() { + var f = Array.prototype.lastIndexOf; + if (typeof(f) === "function") { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-0-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-0-2.js index baf04e91e..bdff5303f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-0-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-0-2.js
- * @description Array.prototype.lastIndexOf has a length property whose value is 1.
- */
-
-
-function testcase() {
- if (Array.prototype.lastIndexOf.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.lastIndexOf has a length property whose value is 1. +includes: [runTestCase.js] +---*/ + +function testcase() { + if (Array.prototype.lastIndexOf.length === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-1.js index c80cb0548..b13ee11f6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-1.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.15/15.4.4.15-1-1.js
- * @description Array.prototype.lastIndexOf applied to undefined throws a TypeError
- */
-
-
-function testcase() {
-
- try {
- Array.prototype.lastIndexOf.call(undefined);
- return false;
- } catch (e) {
- if (e instanceof TypeError) {
- 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.lastIndexOf applied to undefined throws a TypeError +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Array.prototype.lastIndexOf.call(undefined); + return false; + } catch (e) { + if (e instanceof TypeError) { + return true; + } + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-10.js index 17f2838b5..d1be8ebb6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-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.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-10.js
- * @description Array.prototype.lastIndexOf applied to the Math object
- */
-
-
-function testcase() {
-
- try {
- Math.length = 2;
- Math[1] = 100;
- return 1 === Array.prototype.lastIndexOf.call(Math, 100);
- } finally {
- delete Math.length;
- delete Math[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.lastIndexOf applied to the Math object +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Math.length = 2; + Math[1] = 100; + return 1 === Array.prototype.lastIndexOf.call(Math, 100); + } finally { + delete Math.length; + delete Math[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-11.js index 5492798c9..3577ee93d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-11.js
- * @description Array.prototype.lastIndexOf applied to Date object
- */
-
-
-function testcase() {
-
- var obj = new Date();
- obj.length = 2;
- obj[1] = true;
-
- return Array.prototype.lastIndexOf.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.lastIndexOf applied to Date object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new Date(); + obj.length = 2; + obj[1] = true; + + return Array.prototype.lastIndexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-12.js index 55949f407..f3cd78438 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-12.js
- * @description Array.prototype.lastIndexOf applied to RegExp object
- */
-
-
-function testcase() {
-
- var obj = new RegExp("afdasf");
- obj.length = 100;
- obj[1] = "afdasf";
-
- return Array.prototype.lastIndexOf.call(obj, "afdasf") === 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.lastIndexOf applied to RegExp object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new RegExp("afdasf"); + obj.length = 100; + obj[1] = "afdasf"; + + return Array.prototype.lastIndexOf.call(obj, "afdasf") === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-13.js index 35e6aff51..58cc6773c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-13.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.15/15.4.4.15-1-13.js
- * @description Array.prototype.lastIndexOf applied to the JSON object
- */
-
-
-function testcase() {
-
- var targetObj = {};
- try {
- JSON[3] = targetObj;
- JSON.length = 5;
- return 3 === Array.prototype.lastIndexOf.call(JSON, targetObj);
- } 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.lastIndexOf applied to the JSON object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var targetObj = {}; + try { + JSON[3] = targetObj; + JSON.length = 5; + return 3 === Array.prototype.lastIndexOf.call(JSON, targetObj); + } finally { + delete JSON[3]; + delete JSON.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-14.js index 82278e2bd..6d542bdf1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-14.js
- * @description Array.prototype.lastIndexOf applied to Error object
- */
-
-
-function testcase() {
-
- var obj = new SyntaxError();
- obj.length = 2;
- obj[1] = Infinity;
-
- return Array.prototype.lastIndexOf.call(obj, 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.lastIndexOf applied to Error object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new SyntaxError(); + obj.length = 2; + obj[1] = Infinity; + + return Array.prototype.lastIndexOf.call(obj, Infinity) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-15.js index 0b1eedb59..14806caa8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-15.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.15/15.4.4.15-1-15.js
- * @description Array.prototype.lastIndexOf applied to the Arguments object
- */
-
-
-function testcase() {
-
- var obj = (function fun() {
- return arguments;
- }(1, 2, 3));
-
- return Array.prototype.lastIndexOf.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.lastIndexOf applied to the Arguments object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = (function fun() { + return arguments; + }(1, 2, 3)); + + return Array.prototype.lastIndexOf.call(obj, 2) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-17.js index da75a413e..868960034 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-17.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.15/15.4.4.15-1-17.js
- * @description Array.prototype.lastIndexOf applied to the global object
- */
-
-
-function testcase() {
- var targetObj = ["global"];
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[1] = targetObj;
- fnGlobalObject().length = 3;
- return 1 === Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj);
- } 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.lastIndexOf applied to the global object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + var targetObj = ["global"]; + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[1] = targetObj; + fnGlobalObject().length = 3; + return 1 === Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj); + } finally { + delete fnGlobalObject()[1]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-2.js index 5365ac0da..36c810e2f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-2.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.15/15.4.4.15-1-2.js
- * @description Array.prototype.lastIndexOf applied to null throws a TypeError
- */
-
-
-function testcase() {
-
- try {
- Array.prototype.lastIndexOf.call(null);
- return false;
- } catch (e) {
- if (e instanceof TypeError) {
- 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.lastIndexOf applied to null throws a TypeError +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Array.prototype.lastIndexOf.call(null); + return false; + } catch (e) { + if (e instanceof TypeError) { + return true; + } + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-3.js index 6a050fd2a..26d3705af 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-3.js
- * @description Array.prototype.lastIndexOf applied to boolean primitive
- */
-
-
-function testcase() {
-
- try {
- Boolean.prototype[1] = true;
- Boolean.prototype.length = 2;
-
- return 1 === Array.prototype.lastIndexOf.call(true, true);
- } 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.lastIndexOf applied to boolean primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Boolean.prototype[1] = true; + Boolean.prototype.length = 2; + + return 1 === Array.prototype.lastIndexOf.call(true, true); + } 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.15/15.4.4.15-1-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-4.js index 6112e7830..bc672cade 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-4.js
- * @description Array.prototype.lastIndexOf applied to Boolean object
- */
-
-
-function testcase() {
-
- var obj = new Boolean(false);
- obj.length = 2;
- obj[1] = true;
-
- return Array.prototype.lastIndexOf.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.lastIndexOf applied to Boolean object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new Boolean(false); + obj.length = 2; + obj[1] = true; + + return Array.prototype.lastIndexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-5.js index 4adfdb470..6a20348ab 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-5.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.15/15.4.4.15-1-5.js
- * @description Array.prototype.lastIndexOf applied to number primitive
- */
-
-
-function testcase() {
-
- try {
- Number.prototype[1] = isNaN;
- Number.prototype.length = 2;
- return 1 === Array.prototype.lastIndexOf.call(5, isNaN);
- } 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.lastIndexOf applied to number primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + + try { + Number.prototype[1] = isNaN; + Number.prototype.length = 2; + return 1 === Array.prototype.lastIndexOf.call(5, isNaN); + } 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.15/15.4.4.15-1-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-6.js index 33e2791df..4274a80dc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-6.js
- * @description Array.prototype.lastIndexOf applied to Number object
- */
-
-
-function testcase() {
-
- var obj = new Number(-3);
- obj.length = 2;
- obj[1] = true;
-
- return Array.prototype.lastIndexOf.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.lastIndexOf applied to Number object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new Number(-3); + obj.length = 2; + obj[1] = true; + + return Array.prototype.lastIndexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-7.js index 8d0b871dc..19b75c63f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-7.js
- * @description Array.prototype.lastIndexOf applied to string primitive
- */
-
-
-function testcase() {
-
- return Array.prototype.lastIndexOf.call("abc", "c") === 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.lastIndexOf applied to string primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + + return Array.prototype.lastIndexOf.call("abc", "c") === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-8.js index 70b73d38b..dbf90cddf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-8.js
- * @description Array.prototype.lastIndexOf applied to String object
- */
-
-
-function testcase() {
-
- var obj = new String("undefined");
-
- return Array.prototype.lastIndexOf.call(obj, "f") === 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.lastIndexOf applied to String object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = new String("undefined"); + + return Array.prototype.lastIndexOf.call(obj, "f") === 4; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-9.js index df55f36e8..178762689 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-1-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-1-9.js
- * @description Array.prototype.lastIndexOf applied to Function object
- */
-
-
-function testcase() {
-
- var obj = function (a, b) {
- return a + b;
- };
- obj[1] = true;
-
- return Array.prototype.lastIndexOf.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.lastIndexOf applied to Function object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = function (a, b) { + return a + b; + }; + obj[1] = true; + + return Array.prototype.lastIndexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-1.js index 102b1d1ca..3dfbcfb51 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-1.js
- * @description Array.prototype.lastIndexOf - 'length' is own data property on an Array-like object
- */
-
-
-function testcase() {
- var obj = { 1: null, 2: undefined, length: 2 };
-
- return Array.prototype.lastIndexOf.call(obj, null) === 1 &&
- Array.prototype.lastIndexOf.call(obj, 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.lastIndexOf - 'length' is own data property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = { 1: null, 2: undefined, length: 2 }; + + return Array.prototype.lastIndexOf.call(obj, null) === 1 && + Array.prototype.lastIndexOf.call(obj, undefined) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-10.js index 935c5ba71..e8c974c71 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-10.js @@ -1,32 +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.15/15.4.4.15-2-10.js
- * @description Array.prototype.lastIndexOf - 'length' is inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var proto = {};
- Object.defineProperty(proto, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child[1] = 1;
- child[2] = 2;
-
- return Array.prototype.lastIndexOf.call(child, 1) === 1 &&
- Array.prototype.lastIndexOf.call(child, 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.lastIndexOf - 'length' is inherited accessor + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var proto = {}; + Object.defineProperty(proto, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child[1] = 1; + child[2] = 2; + + return Array.prototype.lastIndexOf.call(child, 1) === 1 && + Array.prototype.lastIndexOf.call(child, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-11.js index 37247be7d..c8135f76c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-11.js
- * @description Array.prototype.lastIndexOf - 'length' is own accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- var obj = { 0: 1 };
- Object.defineProperty(obj, "length", {
- set: function () { },
- configurable: true
- });
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - 'length' is own accessor property + without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 1 }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); + + return Array.prototype.lastIndexOf.call(obj, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-12.js index 3df74f606..5d4fc8b95 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-12.js
- * @description Array.prototype.lastIndexOf - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array-like object
- */
-
-
-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.lastIndexOf.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.lastIndexOf - 'length' is own accessor property + without a get function that overrides an inherited accessor + property on an Array-like object +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.lastIndexOf.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.15/15.4.4.15-2-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-13.js index ff0aab23c..6b2a14c8d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-13.js
- * @description Array.prototype.lastIndexOf - 'length' is inherited accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- var proto = {};
- Object.defineProperty(proto, "length", {
- set: function () { },
- configurable: true
- });
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child[0] = true;
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - 'length' is inherited accessor + property without a get function on an Array-like object +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[0] = true; + + return Array.prototype.lastIndexOf.call(child, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-14.js index 5ad1375b2..da1654cb2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-14.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.15/15.4.4.15-2-14.js
- * @description Array.prototype.lastIndexOf - 'length' is undefined property on an Array-like object
- */
-
-
-function testcase() {
-
- var obj = { 0: null, 1: undefined };
-
- return Array.prototype.lastIndexOf.call(obj, null) === -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.lastIndexOf - 'length' is undefined property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: null, 1: undefined }; + + return Array.prototype.lastIndexOf.call(obj, null) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-15.js index 5f50bfff6..0c9089495 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-15.js @@ -1,33 +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.15/15.4.4.15-2-15.js
- * @description Array.prototype.lastIndexOf - '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.lastIndexOf.call(fnGlobalObject(), targetObj) !== 1) {
- return false;
- }
-
- fnGlobalObject()[1] = {};
- fnGlobalObject()[2] = targetObj;
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - '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.lastIndexOf.call(fnGlobalObject(), targetObj) !== 1) { + return false; + } + + fnGlobalObject()[1] = {}; + fnGlobalObject()[2] = targetObj; + + return Array.prototype.lastIndexOf.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.15/15.4.4.15-2-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-17.js index 2a910d8d4..074d3b99f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-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.15/15.4.4.15-2-17.js
- * @description Array.prototype.lastIndexOf applied to Arguments object which implements its own property get method
- */
-
-
-function testcase() {
-
- var targetObj = function () { };
- var func = function (a, b) {
- arguments[2] = function () { };
- return Array.prototype.lastIndexOf.call(arguments, targetObj) === 1 &&
- Array.prototype.lastIndexOf.call(arguments, arguments[2]) === -1;
- };
-
- return func(0, targetObj);
- }
-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.lastIndexOf applied to Arguments object which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var targetObj = function () { }; + var func = function (a, b) { + arguments[2] = function () { }; + return Array.prototype.lastIndexOf.call(arguments, targetObj) === 1 && + Array.prototype.lastIndexOf.call(arguments, arguments[2]) === -1; + }; + + return func(0, targetObj); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-18.js index 1608f1b39..97faba2ae 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-18.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.15/15.4.4.15-2-18.js
- * @description Array.prototype.lastIndexOf 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.lastIndexOf.call(str, "2") === 2 &&
- Array.prototype.lastIndexOf.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.lastIndexOf 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.lastIndexOf.call(str, "2") === 2 && + Array.prototype.lastIndexOf.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.15/15.4.4.15-2-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-19.js index 35a7b79bb..1582d417d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-19.js
- * @description Array.prototype.lastIndexOf applied to String 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.lastIndexOf.call(obj, obj[1]) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf applied to String 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.lastIndexOf.call(obj, obj[1]) === 1 && + Array.prototype.lastIndexOf.call(obj, obj[2]) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-2.js index f8e4c834e..e957abdef 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-2.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.15/15.4.4.15-2-2.js
- * @description Array.prototype.lastIndexOf - 'length' is own data property on an Array
- */
-
-
-function testcase() {
- var targetObj = {};
- try {
- Array.prototype[2] = targetObj;
-
- return [0, targetObj].lastIndexOf(targetObj) === 1 &&
- [0, 1].lastIndexOf(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.lastIndexOf - 'length' is own data property on an + Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + try { + Array.prototype[2] = targetObj; + + return [0, targetObj].lastIndexOf(targetObj) === 1 && + [0, 1].lastIndexOf(targetObj) === -1; + } finally { + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-3.js index 97b8b2b41..f9a64df6a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-3.js
- * @description Array.prototype.lastIndexOf - '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] = child;
-
- return Array.prototype.lastIndexOf.call(child, child) === 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.lastIndexOf - '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] = child; + + return Array.prototype.lastIndexOf.call(child, child) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-4.js index 6b32c7ba7..a0a3990ad 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-4.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.15/15.4.4.15-2-4.js
- * @description Array.prototype.lastIndexOf when '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, 2].lastIndexOf(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.lastIndexOf when '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, 2].lastIndexOf(targetObj) === 1; + } finally { + Array.prototype.length = arrProtoLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-5.js index 79da9a467..a7cbea78b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-5.js
- * @description Array.prototype.lastIndexOf - '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] = null;
-
- return Array.prototype.lastIndexOf.call(child, null) === 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.lastIndexOf - '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] = null; + + return Array.prototype.lastIndexOf.call(child, null) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-6.js index 98caba2ee..dc9e2b119 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-6.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.15/15.4.4.15-2-6.js
- * @description Array.prototype.lastIndexOf - 'length' is an inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- var proto = { length: 2 };
-
- var Con = function () {};
- Con.prototype = proto;
-
- var child = new Con();
- child[1] = "x";
- child[2] = "y";
-
- return Array.prototype.lastIndexOf.call(child, "x") === 1 &&
- Array.prototype.lastIndexOf.call(child, "y") === -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.lastIndexOf - 'length' is an inherited data + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var proto = { length: 2 }; + + var Con = function () {}; + Con.prototype = proto; + + var child = new Con(); + child[1] = "x"; + child[2] = "y"; + + return Array.prototype.lastIndexOf.call(child, "x") === 1 && + Array.prototype.lastIndexOf.call(child, "y") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-7.js index d5320c3d5..0010d7255 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-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.15/15.4.4.15-2-7.js
- * @description Array.prototype.lastIndexOf - 'length' is own accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var obj = { 1: true, 2: false };
-
- Object.defineProperty(obj, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return Array.prototype.lastIndexOf.call(obj, true) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - 'length' is own accessor property on + an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: true, 2: false }; + + Object.defineProperty(obj, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + return Array.prototype.lastIndexOf.call(obj, true) === 1 && + Array.prototype.lastIndexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-8.js index 4948d4c43..79bc1099e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-2-8.js
- * @description Array.prototype.lastIndexOf - 'length' is own accessor 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[1] = eval;
-
- Object.defineProperty(child, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return Array.prototype.lastIndexOf.call(child, eval) === 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.lastIndexOf - 'length' is own accessor 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[1] = eval; + + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + return Array.prototype.lastIndexOf.call(child, eval) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-9.js index 2fc602265..42c2e5135 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-2-9.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.15/15.4.4.15-2-9.js
- * @description Array.prototype.lastIndexOf - 'length' is own accessor 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();
- child[1] = true;
-
- Object.defineProperty(child, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - 'length' is own accessor 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(); + child[1] = true; + + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + return Array.prototype.lastIndexOf.call(child, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-1.js index 5d08d458a..d00a3caad 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-1.js
- * @description Array.prototype.lastIndexOf - value of 'length' is undefined
- */
-
-
-function testcase() {
-
- var obj = { 0: 1, 1: 1, length: undefined };
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 1, 1: 1, length: undefined }; + + return Array.prototype.lastIndexOf.call(obj, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-10.js index 4b680a5a4..b3268ab38 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-10.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is NaN)
- */
-
-
-function testcase() {
-
- var obj = { 0: 0, length: NaN };
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a number (value + is NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 0, length: NaN }; + + return Array.prototype.lastIndexOf.call(obj, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-11.js index 38c8861d6..f27861957 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-11.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a string containing positive number
- */
-
-
-function testcase() {
-
- var obj = {1: true, 2: false, length: "2"};
-
- return Array.prototype.lastIndexOf.call(obj, true) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a string + containing positive number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = {1: true, 2: false, length: "2"}; + + return Array.prototype.lastIndexOf.call(obj, true) === 1 && + Array.prototype.lastIndexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-12.js index c8f5ea3e0..500f5f1ca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-12.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a string containing negative number
- */
-
-
-function testcase() {
-
- var obj = {1: null, 2: undefined, length: "-4294967294"};
-
- return Array.prototype.lastIndexOf.call(obj, null) === 1 &&
- Array.prototype.lastIndexOf.call(obj, 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.lastIndexOf - value of 'length' is a string + containing negative number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = {1: null, 2: undefined, length: "-4294967294"}; + + return Array.prototype.lastIndexOf.call(obj, null) === 1 && + Array.prototype.lastIndexOf.call(obj, undefined) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-13.js index 00bd45fbd..40996acdc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-13.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a string containing a decimal number
- */
-
-
-function testcase() {
-
- var obj = { 4: 4, 5: 5, length: "5.512345" };
-
- return Array.prototype.lastIndexOf.call(obj, 4) === 4 &&
- Array.prototype.lastIndexOf.call(obj, 5) === -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.lastIndexOf - value of 'length' is a string + containing a decimal number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 4: 4, 5: 5, length: "5.512345" }; + + return Array.prototype.lastIndexOf.call(obj, 4) === 4 && + Array.prototype.lastIndexOf.call(obj, 5) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js index e75f1cbac..517ff7378 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-14.js
- * @description Array.prototype.lastIndexOf - value of '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.lastIndexOf.call(objOne, true) === -1 &&
- Array.prototype.lastIndexOf.call(objTwo, true) === -1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - value of '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.lastIndexOf.call(objOne, true) === -1 && + Array.prototype.lastIndexOf.call(objTwo, true) === -1 && + Array.prototype.lastIndexOf.call(objThree, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-15.js index a2a8e3cbc..83a5d8672 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-15.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a string containing an exponential number
- */
-
-
-function testcase() {
-
- var obj = {229: 229, 230: 2.3E2, length: "2.3E2"};
-
- return Array.prototype.lastIndexOf.call(obj, 229) === 229 &&
- Array.prototype.lastIndexOf.call(obj, 2.3E2) === -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.lastIndexOf - value of 'length' is a string + containing an exponential number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = {229: 229, 230: 2.3E2, length: "2.3E2"}; + + return Array.prototype.lastIndexOf.call(obj, 229) === 229 && + Array.prototype.lastIndexOf.call(obj, 2.3E2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-16.js index ddee9b916..afacbf865 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-16.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a string which is able to be converted into hex number
- */
-
-
-function testcase() {
-
- var obj = { 2573: 2573, 2574: 0x000A0E, length: "0x000A0E" };
-
- return Array.prototype.lastIndexOf.call(obj, 2573) === 2573 &&
- Array.prototype.lastIndexOf.call(obj, 0x000A0E) === -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.lastIndexOf - value of 'length' is a string which + is able to be converted into hex number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 2573: 2573, 2574: 0x000A0E, length: "0x000A0E" }; + + return Array.prototype.lastIndexOf.call(obj, 2573) === 2573 && + Array.prototype.lastIndexOf.call(obj, 0x000A0E) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-17.js index 8c19a878a..645121bfc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-17.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a string containing a number with leading zeros
- */
-
-
-function testcase() {
-
- var obj = { 1: 1, 2: 2, length: "0002.0" };
-
- return Array.prototype.lastIndexOf.call(obj, 1) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a string + containing a number with leading zeros +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 1: 1, 2: 2, length: "0002.0" }; + + return Array.prototype.lastIndexOf.call(obj, 1) === 1 && + Array.prototype.lastIndexOf.call(obj, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-18.js index 6bca43644..b946d3f1a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-18.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a string that can't convert to a number
- */
-
-
-function testcase() {
- var targetObj = new String("123abc123");
- var obj = { 0: targetObj, length: "123abc123" };
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a string that + can't convert to a number +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = new String("123abc123"); + var obj = { 0: targetObj, length: "123abc123" }; + + return Array.prototype.lastIndexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-19.js index 970f8c5d1..6c5b4ec9d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-19.js @@ -1,35 +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.15/15.4.4.15-3-19.js
- * @description Array.prototype.lastIndexOf - 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 targetObj = fnGlobalObject();
- var obj = {
- 1: targetObj,
- 2: 2,
-
- length: {
- toString: function () {
- return '2';
- }
- }
- };
-
- return Array.prototype.lastIndexOf.call(obj, targetObj) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is an Object which + has an own toString method +includes: + - runTestCase.js + - fnGlobalObject.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 targetObj = fnGlobalObject(); + var obj = { + 1: targetObj, + 2: 2, + + length: { + toString: function () { + return '2'; + } + } + }; + + return Array.prototype.lastIndexOf.call(obj, targetObj) === 1 && + Array.prototype.lastIndexOf.call(obj, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-2.js index eb1f473b8..54010a101 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-2.js
- * @description Array.prototype.lastIndexOf return -1 when value of 'length' is a boolean (value is true)
- */
-
-
-function testcase() {
- var obj = { 0: 0, 1: 1, length: true };
- return Array.prototype.lastIndexOf.call(obj, 0) === 0 &&
- Array.prototype.lastIndexOf.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.lastIndexOf return -1 when value of 'length' is a + boolean (value is true) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = { 0: 0, 1: 1, length: true }; + return Array.prototype.lastIndexOf.call(obj, 0) === 0 && + Array.prototype.lastIndexOf.call(obj, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-20.js index 51add47e6..faf9b2bf0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-20.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.15/15.4.4.15-3-20.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.call(obj, true) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(obj, true) === 1 && + Array.prototype.lastIndexOf.call(obj, 2) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-21.js index 8dc121efc..24e3ef1c0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-21.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.15/15.4.4.15-3-21.js
- * @description Array.prototype.lastIndexOf - '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 targetObj = this;
- var obj = {
- 1: targetObj,
- length: {
- toString: function () {
- toStringAccessed = true;
- return '3';
- },
-
- valueOf: function () {
- valueOfAccessed = true;
- return {};
- }
- }
- };
-
- return Array.prototype.lastIndexOf.call(obj, targetObj) === 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.lastIndexOf - '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 targetObj = this; + var obj = { + 1: targetObj, + length: { + toString: function () { + toStringAccessed = true; + return '3'; + }, + + valueOf: function () { + valueOfAccessed = true; + return {}; + } + } + }; + + return Array.prototype.lastIndexOf.call(obj, targetObj) === 1 && toStringAccessed && valueOfAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-22.js index ae009540e..1873c1d8c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-22.js @@ -1,39 +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.15/15.4.4.15-3-22.js
- * @description Array.prototype.lastIndexOf 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 = {
- 1: true,
- length: {
- toString: function () {
- toStringAccessed = true;
- return {};
- },
-
- valueOf: function () {
- valueOfAccessed = true;
- return {};
- }
- }
- };
-
- try {
- Array.prototype.lastIndexOf.call(obj, true);
- 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.lastIndexOf 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 = { + 1: true, + length: { + toString: function () { + toStringAccessed = true; + return {}; + }, + + valueOf: function () { + valueOfAccessed = true; + return {}; + } + } + }; + + try { + Array.prototype.lastIndexOf.call(obj, true); + return false; + } catch (e) { + return toStringAccessed && valueOfAccessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-23.js index fce75d9f2..2bee01fe2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-23.js
- * @description Array.prototype.lastIndexOf uses inherited valueOf method when 'length' is an object with an own toString and an 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: child,
- length: child
- };
-
- return Array.prototype.lastIndexOf.call(obj, 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.lastIndexOf uses inherited valueOf method when + 'length' is an object with an own toString and an 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: child, + length: child + }; + + return Array.prototype.lastIndexOf.call(obj, child) === 1 && valueOfAccessed && !toStringAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-24.js index f3f94d3fb..8ea7809c5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-24.js
- * @description Array.prototype.lastIndexOf - 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.5 };
-
- return Array.prototype.lastIndexOf.call(obj, true) === 122 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - 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.5 }; + + return Array.prototype.lastIndexOf.call(obj, true) === 122 && + Array.prototype.lastIndexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js index c15573aa4..1cd08fd85 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-25.js
- * @description Array.prototype.lastIndexOf - 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 };
-
- return Array.prototype.lastIndexOf.call(obj, true) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - 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 }; + + return Array.prototype.lastIndexOf.call(obj, true) === 1 && + Array.prototype.lastIndexOf.call(obj, false) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.js index a893151b4..e7008eda6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-28.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.15/15.4.4.15-3-28.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.call(obj, targetObj) === -1; //verify length is 0 finally
- }
-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.lastIndexOf - 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.lastIndexOf.call(obj, targetObj) === -1; //verify length is 0 finally + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-29.js index c0fd45ece..e7cbb10ca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-29.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.15/15.4.4.15-3-29.js
- * @description Array.prototype.lastIndexOf - value of 'length' is boundary value (2^32 + 1)
- */
-
-
-function testcase() {
-
- var targetObj = {};
- var obj = {
- 0: targetObj,
- 1: 4294967297,
- length: 4294967297
- };
-
- return Array.prototype.lastIndexOf.call(obj, targetObj) === 0 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(obj, targetObj) === 0 && + Array.prototype.lastIndexOf.call(obj, 4294967297) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-3.js index 9e0186af9..33dceab3d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-3.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is 0)
- */
-
-
-function testcase() {
-
- var obj = { 0: "undefined", length: 0 };
-
- return Array.prototype.lastIndexOf.call(obj, "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.lastIndexOf - value of 'length' is a number (value + is 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: "undefined", length: 0 }; + + return Array.prototype.lastIndexOf.call(obj, "undefined") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-4.js index 0f1c2bbff..e746679a7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-4.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is -0)
- */
-
-
-function testcase() {
-
- var obj = { 0: true, length: -0 };
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a number (value + is -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: true, length: -0 }; + + return Array.prototype.lastIndexOf.call(obj, true) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-5.js index d6031ef6e..11adf1d5d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-5.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is +0)
- */
-
-
-function testcase() {
-
- var obj = { 0: +0, length: +0 };
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a number (value + is +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: +0, length: +0 }; + + return Array.prototype.lastIndexOf.call(obj, +0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-6.js index ed166929e..288924a50 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-6.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is a positive number)
- */
-
-
-function testcase() {
-
- var obj = { 99: true, 100: 100, length: 100 };
-
- return Array.prototype.lastIndexOf.call(obj, true) === 99 &&
- Array.prototype.lastIndexOf.call(obj, 100) === -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.lastIndexOf - value of 'length' is a number (value + is a positive number) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 99: true, 100: 100, length: 100 }; + + return Array.prototype.lastIndexOf.call(obj, true) === 99 && + Array.prototype.lastIndexOf.call(obj, 100) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-7.js index 995d60ec7..18460fc3e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-7.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is a negative number)
- */
-
-
-function testcase() {
-
- var obj = { 4: -Infinity, 5: Infinity, length: 5 - Math.pow(2, 32) };
-
- return Array.prototype.lastIndexOf.call(obj, -Infinity) === 4 &&
- Array.prototype.lastIndexOf.call(obj, 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.lastIndexOf - value of 'length' is a number (value + is a negative number) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 4: -Infinity, 5: Infinity, length: 5 - Math.pow(2, 32) }; + + return Array.prototype.lastIndexOf.call(obj, -Infinity) === 4 && + Array.prototype.lastIndexOf.call(obj, Infinity) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-8.js index 62daa6fda..740b3aa9c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-8.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is Infinity)
- */
-
-
-function testcase() {
-
- var obj = { 0: 0, length: Infinity };
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a number (value + is Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 0, length: Infinity }; + + return Array.prototype.lastIndexOf.call(obj, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-9.js index 514b1753b..473a5cb4f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-3-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-3-9.js
- * @description Array.prototype.lastIndexOf - value of 'length' is a number (value is -Infinity)
- */
-
-
-function testcase() {
-
- var obj = { 0: 0, length: -Infinity };
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - value of 'length' is a number (value + is -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 0, length: -Infinity }; + + return Array.prototype.lastIndexOf.call(obj, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-1.js index c80d4b4c1..a1fe7bc83 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-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.15/15.4.4.15-4-1.js
- * @description Array.prototype.lastIndexOf returns -1 if 'length' is 0 (empty array)
- */
-
-
-function testcase() {
- var i = [].lastIndexOf(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.lastIndexOf returns -1 if 'length' is 0 (empty + array) +includes: [runTestCase.js] +---*/ + +function testcase() { + var i = [].lastIndexOf(42); + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-10.js index 252d68448..bcdf24aee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-10.js
- * @description Array.prototype.lastIndexOf - 'length' is a number of value -6e-1
- */
-
-
-function testcase() {
- var targetObj = [];
- var obj = { 0: targetObj, 100: targetObj, length: -6e-1 };
- return Array.prototype.lastIndexOf.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.lastIndexOf - '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.lastIndexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-11.js index c8148f6ab..194232865 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-11.js
- * @description Array.prototype.lastIndexOf - 'length' is an empty string
- */
-
-
-function testcase() {
- var targetObj = [];
- var obj = { 0: targetObj, 100: targetObj, length: "" };
- return Array.prototype.lastIndexOf.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.lastIndexOf - 'length' is an empty string +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = []; + var obj = { 0: targetObj, 100: targetObj, length: "" }; + return Array.prototype.lastIndexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-2.js index 596c72444..ca775ba91 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-2.js
- * @description Array.prototype.lastIndexOf returns -1 if 'length' is 0 ( length overridden to null (type conversion))
- */
-
-
-function testcase() {
-
- var i = Array.prototype.lastIndexOf.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.lastIndexOf returns -1 if 'length' is 0 ( length + overridden to null (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.lastIndexOf.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.15/15.4.4.15-4-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-3.js index d2684a546..d64cbbffe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-3.js
- * @description Array.prototype.lastIndexOf returns -1 if 'length' is 0 (length overridden to false (type conversion))
- */
-
-
-function testcase() {
-
- var i = Array.prototype.lastIndexOf.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.lastIndexOf returns -1 if 'length' is 0 (length + overridden to false (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.lastIndexOf.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.15/15.4.4.15-4-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-4.js index d1e98e2cf..f1d32a462 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-4.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.15/15.4.4.15-4-4.js
- * @description Array.prototype.lastIndexOf returns -1 if 'length' is 0 (generic 'array' with length 0 )
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = 0;
-
- 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.lastIndexOf returns -1 if 'length' is 0 (generic + 'array' with length 0 ) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = 0; + + 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.15/15.4.4.15-4-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-5.js index 8a8076b1a..4fd8a09c0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-5.js
- * @description Array.prototype.lastIndexOf returns -1 if 'length' is 0 ( length overridden to '0' (type conversion))
- */
-
-
-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.lastIndexOf returns -1 if 'length' is 0 ( length + overridden to '0' (type conversion)) +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.15/15.4.4.15-4-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-6.js index de4dd5de7..392ba313a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-6.js
- * @description Array.prototype.lastIndexOf returns -1 if 'length' is 0 (subclassed Array, length overridden with obj with valueOf)
- */
-
-
-function testcase() {
-
- var i = Array.prototype.lastIndexOf.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.lastIndexOf returns -1 if 'length' is 0 + (subclassed Array, length overridden with obj with valueOf) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var i = Array.prototype.lastIndexOf.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.15/15.4.4.15-4-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-7.js index afdb47845..f00fa6b26 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-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.15/15.4.4.15-4-7.js
- * @description Array.prototype.lastIndexOf returns -1 if 'length' is 0 ( length is object overridden with obj w/o valueOf (toString))
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
-
- var o = { toString: function () { return '0';}};
- f.length = o;
-
- // 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.lastIndexOf.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.lastIndexOf returns -1 if 'length' is 0 ( length + is object overridden with obj w/o valueOf (toString)) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + + var o = { toString: function () { return '0';}}; + f.length = o; + + // 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.lastIndexOf.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.15/15.4.4.15-4-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-8.js index ddff751ee..29fd98253 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-8.js
- * @description Array.prototype.lastIndexOf 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.lastIndexOf.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.lastIndexOf 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.lastIndexOf.call({length: [ ]}, 1); + + if (i === -1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-9.js index 64b26786f..a2424a9dd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-4-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-4-9.js
- * @description Array.prototype.lastIndexOf - 'length' is a number of value 0.1
- */
-
-
-function testcase() {
- var targetObj = [];
- var obj = { 0: targetObj, 100: targetObj, length: 0.1 };
- return Array.prototype.lastIndexOf.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.lastIndexOf - '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.lastIndexOf.call(obj, targetObj) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-1.js index b62f17339..3b0323f1d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-1.js
- * @description Array.prototype.lastIndexOf when fromIndex is string
- */
-
-
-function testcase() {
- var a = new Array(0,1,1);
- if (a.lastIndexOf(1,"1") === 1 && // "1" resolves to 1
- a.lastIndexOf(1,"one") === -1) { // NaN string 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.lastIndexOf when fromIndex is string +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(0,1,1); + if (a.lastIndexOf(1,"1") === 1 && // "1" resolves to 1 + a.lastIndexOf(1,"one") === -1) { // NaN string resolves to 0 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-10.js index a25194604..67615ca8f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-10.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is positive number)
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, true].lastIndexOf(targetObj, 1.5) === 1 &&
- [0, true, targetObj].lastIndexOf(targetObj, 1.5) === -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.lastIndexOf - value of 'fromIndex' is a number + (value is positive number) +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, true].lastIndexOf(targetObj, 1.5) === 1 && + [0, true, targetObj].lastIndexOf(targetObj, 1.5) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-11.js index 466cabd3a..8d88fa6b7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-11.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is negative number)
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, true].lastIndexOf(targetObj, -2.5) === 1 &&
- [0, true, targetObj].lastIndexOf(targetObj, -2.5) === -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.lastIndexOf - value of 'fromIndex' is a number + (value is negative number) +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, true].lastIndexOf(targetObj, -2.5) === 1 && + [0, true, targetObj].lastIndexOf(targetObj, -2.5) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-12.js index 5a1109638..5f7fb9acb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-12.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is Infinity)
- */
-
-
-function testcase() {
- var arr = [];
- arr[Math.pow(2, 32) - 2] = null; // length is the max value of Uint type
- return arr.lastIndexOf(null, Infinity) === (Math.pow(2, 32) - 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.lastIndexOf - value of 'fromIndex' is a number + (value is Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + var arr = []; + arr[Math.pow(2, 32) - 2] = null; // length is the max value of Uint type + return arr.lastIndexOf(null, Infinity) === (Math.pow(2, 32) - 2); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-13.js index ca513c6ec..c3b00b588 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-13.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is -Infinity)
- */
-
-
-function testcase() {
-
- return [true].lastIndexOf(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.lastIndexOf - value of 'fromIndex' is a number + (value is -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].lastIndexOf(true, -Infinity) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-14.js index 7941302bb..717a8e549 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-14.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.15/15.4.4.15-5-14.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is NaN)
- */
-
-
-function testcase() {
-
- return [0, true].lastIndexOf(true, NaN) === -1 && // from Index will be convert to +0
- [true, 0].lastIndexOf(true, NaN) === 0 &&
- [0, true].lastIndexOf(true, -NaN) === -1 &&
- [true, 0].lastIndexOf(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.lastIndexOf - value of 'fromIndex' is a number + (value is NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, true].lastIndexOf(true, NaN) === -1 && // from Index will be convert to +0 + [true, 0].lastIndexOf(true, NaN) === 0 && + [0, true].lastIndexOf(true, -NaN) === -1 && + [true, 0].lastIndexOf(true, -NaN) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-15.js index 9c6c39197..87adc7308 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-15.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing a negative number
- */
-
-
-function testcase() {
-
- return [0, "-2", 2].lastIndexOf("-2", "-2") === 1 &&
- [0, 2, "-2"].lastIndexOf("-2", "-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.lastIndexOf - value of 'fromIndex' is a string + containing a negative number +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, "-2", 2].lastIndexOf("-2", "-2") === 1 && + [0, 2, "-2"].lastIndexOf("-2", "-2") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-16.js index c3c9b82a0..3e6ed875d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-16.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf(true, "Infinity") === (Math.pow(2, 32) - 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.lastIndexOf - 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.lastIndexOf(true, "Infinity") === (Math.pow(2, 32) - 2); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-17.js index 7b963a75a..f6c368c83 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-17.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing -Infinity
- */
-
-
-function testcase() {
-
- return [true].lastIndexOf(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.lastIndexOf - value of 'fromIndex' is a string + containing -Infinity +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [true].lastIndexOf(true, "-Infinity") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-18.js index 0140305e2..c729aab8e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-18.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing an exponential number
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, NaN, targetObj, 3, false].lastIndexOf(targetObj, "2E0") === 2 &&
- [0, NaN, 3, targetObj, false].lastIndexOf(targetObj, "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.lastIndexOf - value of 'fromIndex' is a string + containing an exponential number +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, NaN, targetObj, 3, false].lastIndexOf(targetObj, "2E0") === 2 && + [0, NaN, 3, targetObj, false].lastIndexOf(targetObj, "2E0") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-19.js index 797e6e07b..605362243 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-19.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing a hex number
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, true, targetObj, 3, false].lastIndexOf(targetObj, "0x0002") === 2 &&
- [0, true, 3, targetObj, false].lastIndexOf(targetObj, "0x0002") === -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.lastIndexOf - value of 'fromIndex' is a string + containing a hex number +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, true, targetObj, 3, false].lastIndexOf(targetObj, "0x0002") === 2 && + [0, true, 3, targetObj, false].lastIndexOf(targetObj, "0x0002") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-2.js index 309f0e500..3a35e0d4e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-2.js
- * @description Array.prototype.lastIndexOf when fromIndex is floating point number
- */
-
-
-function testcase() {
- var a = new Array(1,2,1);
- if (a.lastIndexOf(2,1.49) === 1 && // 1.49 resolves to 1
- a.lastIndexOf(2,0.51) === -1 && // 0.51 resolves to 0
- a.lastIndexOf(1,0.51) === 0){ // 0.51 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.lastIndexOf when fromIndex is floating point number +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,1); + if (a.lastIndexOf(2,1.49) === 1 && // 1.49 resolves to 1 + a.lastIndexOf(2,0.51) === -1 && // 0.51 resolves to 0 + a.lastIndexOf(1,0.51) === 0){ // 0.51 resolves to 0 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-20.js index a7a265e8a..78494d315 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-20.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' which is a string containing a number with leading zeros
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10") === 2 &&
- [0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10") === -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.lastIndexOf - value of 'fromIndex' which is a + string containing a number with leading zeros +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10") === 2 && + [0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10") === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-21.js index db0abbc9f..53f45ebee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-21.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.15/15.4.4.15-5-21.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' which is an Object, and 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 '2';
- }
- };
- var targetObj = new RegExp();
-
- return [0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex) === 2 &&
- [0, true, 3, targetObj, false].lastIndexOf(targetObj, 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.lastIndexOf - value of 'fromIndex' which is an + Object, and 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 '2'; + } + }; + var targetObj = new RegExp(); + + return [0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex) === 2 && + [0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-22.js index a8a1cbf9e..d6e8dc7ce 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-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.15/15.4.4.15-5-22.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' which is an object, and has an own valueOf method
- */
-
-
-function testcase() {
-
- var fromIndex = {
- valueOf: function () {
- return 2;
- }
- };
-
- var targetObj = function () {};
- return [0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex) === 2 &&
- [0, true, 3, targetObj, false].lastIndexOf(targetObj, 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.lastIndexOf - value of 'fromIndex' which is an + object, and has an own valueOf method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var fromIndex = { + valueOf: function () { + return 2; + } + }; + + var targetObj = function () {}; + return [0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex) === 2 && + [0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-23.js index 913d37aba..74588ada5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-23.js
- * @description Array.prototype.lastIndexOf - 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].lastIndexOf(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.lastIndexOf - 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].lastIndexOf(true, fromIndex) === 1 && toStringAccessed && valueOfAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-24.js index 5e71efdaf..31998c9ae 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-24.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.15/15.4.4.15-5-24.js
- * @description Array.prototype.lastIndexOf throws TypeError exception when value of 'fromIndex' is an object that both toString and valueOf methods than don't return primitive value
- */
-
-
-function testcase() {
-
- var toStringAccessed = false;
- var valueOfAccessed = false;
-
- var fromIndex = {
- toString: function () {
- toStringAccessed = true;
- return {};
- },
-
- valueOf: function () {
- valueOfAccessed = true;
- return {};
- }
- };
-
- try {
- [0, null].lastIndexOf(null, 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.lastIndexOf throws TypeError exception when value + of 'fromIndex' is an object that both toString and valueOf methods + than don't return primitive value +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, null].lastIndexOf(null, fromIndex); + return false; + } catch (e) { + return toStringAccessed && valueOfAccessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-25.js index ccb155fad..8bd166edb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-25.js
- * @description Array.prototype.lastIndexOf use 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 1;
- };
-
- return [0, true].lastIndexOf(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.lastIndexOf use 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 1; + }; + + return [0, true].lastIndexOf(true, child) === 1 && valueOfAccessed && !toStringAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-26.js index d46a21b05..df459ca8f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-26.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-5-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-27.js index 60c5c74d0..e48b1540d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-27.js @@ -1,48 +1,50 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/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.15/15.4.4.15-5-27.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-5-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-28.js index ca77bf187..62d4cf5fd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-28.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-5-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-29.js index ef395c6f1..34b895e03 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-29.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-5-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-3.js index ec34d4e70..466fa94aa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-3.js
- * @description Array.prototype.lastIndexOf when fromIndex is boolean
- */
-
-
-function testcase() {
- var a = new Array(1,2,1);
- if (a.lastIndexOf(2,true) === 1 && // true resolves to 1
- a.lastIndexOf(2,false) === -1 ) { // 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.lastIndexOf when fromIndex is boolean +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,1); + if (a.lastIndexOf(2,true) === 1 && // true resolves to 1 + a.lastIndexOf(2,false) === -1 ) { // false resolves to 0 + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-30.js index d64eb33e8..bc9e32345 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-30.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-5-31.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-31.js index 9788dd52a..5c174f19f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-31.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-31.js
- * @description Array.prototype.lastIndexOf - 'fromIndex' is a positive non-integer, verify truncation occurs in the proper direction
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, true].lastIndexOf(targetObj, 1.5) === 1 &&
- [0, true, targetObj].lastIndexOf(targetObj, 1.5) === -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.lastIndexOf - 'fromIndex' is a positive + non-integer, verify truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, true].lastIndexOf(targetObj, 1.5) === 1 && + [0, true, targetObj].lastIndexOf(targetObj, 1.5) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-32.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-32.js index e2fa1284e..b55a85b62 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-32.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-32.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.15/15.4.4.15-5-32.js
- * @description Array.prototype.lastIndexOf - 'fromIndex' is a negative non-integer, verify truncation occurs in the proper direction
- */
-
-
-function testcase() {
- var targetObj = {};
- return [0, targetObj, true].lastIndexOf(targetObj, -2.5) === 1 &&
- [0, true, targetObj].lastIndexOf(targetObj, -2.5) === -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.lastIndexOf - 'fromIndex' is a negative + non-integer, verify truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + var targetObj = {}; + return [0, targetObj, true].lastIndexOf(targetObj, -2.5) === 1 && + [0, true, targetObj].lastIndexOf(targetObj, -2.5) === -1; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-33.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-33.js index 3db396c41..c6cd3e42c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-33.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-33.js
- * @description Array.prototype.lastIndexOf - match on the first element, a middle element and the last element when 'fromIndex' is passed
- */
-
-
-function testcase() {
-
- return [0, 1, 2, 3, 4].lastIndexOf(0, 0) === 0 &&
- [0, 1, 2, 3, 4].lastIndexOf(0, 2) === 0 &&
- [0, 1, 2, 3, 4].lastIndexOf(2, 2) === 2 &&
- [0, 1, 2, 3, 4].lastIndexOf(2, 4) === 2 &&
- [0, 1, 2, 3, 4].lastIndexOf(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.lastIndexOf - 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].lastIndexOf(0, 0) === 0 && + [0, 1, 2, 3, 4].lastIndexOf(0, 2) === 0 && + [0, 1, 2, 3, 4].lastIndexOf(2, 2) === 2 && + [0, 1, 2, 3, 4].lastIndexOf(2, 4) === 2 && + [0, 1, 2, 3, 4].lastIndexOf(4, 4) === 4; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-4.js index fcbae77c2..cbf5c96b0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-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.15/15.4.4.15-5-4.js
- * @description Array.prototype.lastIndexOf when fromIndex is undefined
- */
-
-
-function testcase() {
- var a = new Array(1,2,1);
- if (a.lastIndexOf(2,undefined) === -1 &&
- a.lastIndexOf(1,undefined) === 0 &&
- a.lastIndexOf(1) === 2) { // undefined resolves to 0, no second argument resolves to len
- 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.lastIndexOf when fromIndex is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,1); + if (a.lastIndexOf(2,undefined) === -1 && + a.lastIndexOf(1,undefined) === 0 && + a.lastIndexOf(1) === 2) { // undefined resolves to 0, no second argument resolves to len + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-5.js index b9ac2cc15..fb55edf72 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-5.js
- * @description Array.prototype.lastIndexOf when fromIndex is null
- */
-
-
-function testcase() {
- var a = new Array(1,2,1);
- if (a.lastIndexOf(2,null) === -1 && a.lastIndexOf(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.lastIndexOf when fromIndex is null +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,1); + if (a.lastIndexOf(2,null) === -1 && a.lastIndexOf(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.15/15.4.4.15-5-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-6.js index 87247f208..2a767eeca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-5-6.js
- * @description Array.prototype.lastIndexOf when 'fromIndex' isn't passed
- */
-
-
-function testcase() {
- var arr = [0, 1, 2, 3, 4];
- //'fromIndex' will be set as 4 if not passed by default
- return arr.lastIndexOf(0) === arr.lastIndexOf(0, 4) &&
- arr.lastIndexOf(2) === arr.lastIndexOf(2, 4) &&
- arr.lastIndexOf(4) === arr.lastIndexOf(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.lastIndexOf when 'fromIndex' isn't passed +includes: [runTestCase.js] +---*/ + +function testcase() { + var arr = [0, 1, 2, 3, 4]; + //'fromIndex' will be set as 4 if not passed by default + return arr.lastIndexOf(0) === arr.lastIndexOf(0, 4) && + arr.lastIndexOf(2) === arr.lastIndexOf(2, 4) && + arr.lastIndexOf(4) === arr.lastIndexOf(4, 4); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-7.js index 204f02d4c..cb0575c88 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-7.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.15/15.4.4.15-5-7.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is 0)
- */
-
-
-function testcase() {
-
- return [0, 100].lastIndexOf(100, 0) === -1 && // verify fromIndex is not more than 0
- [200, 0].lastIndexOf(200, 0) === 0; // verify fromIndex is not less than 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.lastIndexOf - value of 'fromIndex' is a number + (value is 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, 100].lastIndexOf(100, 0) === -1 && // verify fromIndex is not more than 0 + [200, 0].lastIndexOf(200, 0) === 0; // verify fromIndex is not less than 0 + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-8.js index dde37f435..d2f5f45e1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-8.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.15/15.4.4.15-5-8.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is +0)
- */
-
-
-function testcase() {
-
- return [0, true].lastIndexOf(true, +0) === -1 &&
- [true, 0].lastIndexOf(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.lastIndexOf - value of 'fromIndex' is a number + (value is +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, true].lastIndexOf(true, +0) === -1 && + [true, 0].lastIndexOf(true, +0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-9.js index be6bb788b..347a109ff 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-9.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.15/15.4.4.15-5-9.js
- * @description Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is -0)
- */
-
-
-function testcase() {
-
- return [0, true].lastIndexOf(true, -0) === -1 &&
- [true, 0].lastIndexOf(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.lastIndexOf - value of 'fromIndex' is a number + (value is -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, true].lastIndexOf(true, -0) === -1 && + [true, 0].lastIndexOf(true, -0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-1.js index dd686d1e3..5a612b3d7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-1.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.15/15.4.4.15-6-1.js
- * @description Array.prototype.lastIndexOf when fromIndex greater than Array.length
- */
-
-
-function testcase() {
- var a = new Array(1,2,3);
- if (a.lastIndexOf(3,5.4) === 2 &&
- a.lastIndexOf(3,3.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.lastIndexOf when fromIndex greater than + Array.length +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,3); + if (a.lastIndexOf(3,5.4) === 2 && + a.lastIndexOf(3,3.1) === 2 ) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-2.js index a27e2b7dc..c200191c6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-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.15/15.4.4.15-6-2.js
- * @description Array.prototype.lastIndexOf returns correct index when 'fromIndex' is length of array - 1
- */
-
-
-function testcase() {
-
- return [1, 2, 3].lastIndexOf(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.lastIndexOf returns correct index when 'fromIndex' + is length of array - 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].lastIndexOf(3, 2) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-3.js index b53095476..df2292d2a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-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.15/15.4.4.15-6-3.js
- * @description Array.prototype.lastIndexOf returns -1 when 'fromIndex' is length of array - 1
- */
-
-
-function testcase() {
-
- return [1, 2, 3].lastIndexOf(3, 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.lastIndexOf returns -1 when 'fromIndex' is length + of array - 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].lastIndexOf(3, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-4.js index 2cc5c1f19..570118688 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-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.15/15.4.4.15-6-4.js
- * @description Array.prototype.lastIndexOf returns -1 when 'fromIndex' and 'length' are both 0
- */
-
-
-function testcase() {
-
- return [].lastIndexOf(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.lastIndexOf returns -1 when 'fromIndex' and + 'length' are both 0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [].lastIndexOf(1, 0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-5.js index f4de9a7f7..11356448b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-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.15/15.4.4.15-6-5.js
- * @description Array.prototype.lastIndexOf returns -1 when 'fromIndex' is 1
- */
-
-
-function testcase() {
-
- return [1, 2, 3].lastIndexOf(3, 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.lastIndexOf returns -1 when 'fromIndex' is 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].lastIndexOf(3, 1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-6.js index 3f39207a1..53a8677fe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-6-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.15/15.4.4.15-6-6.js
- * @description Array.prototype.lastIndexOf returns correct index when 'fromIndex' is 1
- */
-
-
-function testcase() {
-
- return [1, 2, 3].lastIndexOf(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.lastIndexOf returns correct index when 'fromIndex' + is 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3].lastIndexOf(2, 1) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-1.js index adfb892f4..69e05c6fe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-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.15/15.4.4.15-7-1.js
- * @description Array.prototype.lastIndexOf with negative fromIndex
- */
-
-
-function testcase() {
- var a = new Array(1,2,3);
-
- if (a.lastIndexOf(2,-2) === 1 &&
- a.lastIndexOf(2,-3) === -1 &&
- a.lastIndexOf(1,-5.3) === -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.lastIndexOf with negative fromIndex +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(1,2,3); + + if (a.lastIndexOf(2,-2) === 1 && + a.lastIndexOf(2,-3) === -1 && + a.lastIndexOf(1,-5.3) === -1 ) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-2.js index 7c886f80e..e9b92427d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-7-2.js
- * @description Array.prototype.lastIndexOf returns correct index when 'fromIndex' is -1
- */
-
-
-function testcase() {
-
- return [1, 2, 3, 4].lastIndexOf(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.lastIndexOf returns correct index when 'fromIndex' + is -1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3, 4].lastIndexOf(4, -1) === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-3.js index 2b8d631eb..f49077954 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-7-3.js
- * @description Array.prototype.lastIndexOf returns -1 when abs('fromIndex') is length of array - 1
- */
-
-
-function testcase() {
-
- return [1, 2, 3, 4].lastIndexOf(3, -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.lastIndexOf returns -1 when abs('fromIndex') is + length of array - 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3, 4].lastIndexOf(3, -3) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-4.js index cfb2247d0..efc2c1535 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-7-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.15/15.4.4.15-7-4.js
- * @description Array.prototype.lastIndexOf returns -1 when abs('fromIndex') is length of array
- */
-
-
-function testcase() {
-
- return [1, 2, 3, 4].lastIndexOf(2, -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.lastIndexOf returns -1 when abs('fromIndex') is + length of array +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [1, 2, 3, 4].lastIndexOf(2, -4) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-1.js index e53e1a979..5751e9640 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-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.15/15.4.4.15-8-1.js
- * @description Array.prototype.lastIndexOf must return correct index(boolean)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return true}};
- var _false = false;
- var a = new Array(false,true,false,obj,_false,true,"true", undefined,0,null,1,"str",0,1);
- if (a.lastIndexOf(true) === 5 && //a[5]=true
- a.lastIndexOf(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.lastIndexOf must return correct index(boolean) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {toString:function (){return true}}; + var _false = false; + var a = new Array(false,true,false,obj,_false,true,"true", undefined,0,null,1,"str",0,1); + if (a.lastIndexOf(true) === 5 && //a[5]=true + a.lastIndexOf(false) === 4) //a[4] =_false + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-10.js index 0032bd3f0..4fa86e05a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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 lastIndexOf *
- *
- * @path ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-10.js
- * @description Array.prototype.lastIndexOf must return correct index (NaN)
- */
-
-
-function testcase() {
- var _NaN = NaN;
- var a = new Array("NaN",_NaN,NaN, undefined,0,false,null,{toString:function (){return NaN}},"false");
- if (a.lastIndexOf(NaN) === -1) // NaN matches nothing, not even 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 lastIndexOf * +description: Array.prototype.lastIndexOf must return correct index (NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + var _NaN = NaN; + var a = new Array("NaN",_NaN,NaN, undefined,0,false,null,{toString:function (){return NaN}},"false"); + if (a.lastIndexOf(NaN) === -1) // NaN matches nothing, not even itself + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-11.js index 7b300fa0b..3cb7efdab 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-11.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf(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.lastIndexOf - 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.lastIndexOf(1) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-2.js index 384aef3b1..6c6476985 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-2.js
- * @description Array.prototype.lastIndexOf must return correct index(Number)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return 0}};
- var one = 1;
- var _float = -(4/3);
- var a = new Array(+0,true,0,-0, false,undefined,null,"0",obj, _float,-(4/3),-1.3333333333333,"str",one, 1, false);
- if (a.lastIndexOf(-(4/3)) === 10 && // a[10]=-(4/3)
- a.lastIndexOf(0) === 3 && // a[3] = -0, but using === -0 and 0 are equal
- a.lastIndexOf(-0) ===3 && // a[3] = -0
- a.lastIndexOf(1) === 14 ) // a[14] = 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.lastIndexOf 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(+0,true,0,-0, false,undefined,null,"0",obj, _float,-(4/3),-1.3333333333333,"str",one, 1, false); + if (a.lastIndexOf(-(4/3)) === 10 && // a[10]=-(4/3) + a.lastIndexOf(0) === 3 && // a[3] = -0, but using === -0 and 0 are equal + a.lastIndexOf(-0) ===3 && // a[3] = -0 + a.lastIndexOf(1) === 14 ) // a[14] = 1 + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-3.js index ceedbf100..b365e1754 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-3.js
- * @description Array.prototype.lastIndexOf must return correct index(string)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return "false"}};
- var szFalse = "false";
- var a = new Array(szFalse, "false","false1",undefined,0,false,null,1,obj,0);
- if (a.lastIndexOf("false") === 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.lastIndexOf must return correct index(string) +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {toString:function (){return "false"}}; + var szFalse = "false"; + var a = new Array(szFalse, "false","false1",undefined,0,false,null,1,obj,0); + if (a.lastIndexOf("false") === 1) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-4.js index 8c86d3be5..4a9c35fe6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-4.js
- * @description Array.prototype.lastIndexOf must return correct index(undefined)
- */
-
-
-function testcase() {
- var obj = {toString:function (){return undefined;}};
- var _undefined1 = undefined;
- var _undefined2;
- var a = new Array(_undefined1,_undefined2,undefined,true,0,false,null,1,"undefined",obj,1);
- if (a.lastIndexOf(undefined) === 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.lastIndexOf 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(_undefined1,_undefined2,undefined,true,0,false,null,1,"undefined",obj,1); + if (a.lastIndexOf(undefined) === 2) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-5.js index cc4db92ef..8d5dd93ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-5.js
- * @description Array.prototype.lastIndexOf 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(obj2,obj1,obj3,false,undefined,0,false,null,{toString:function (){return "false"}},"false");
- if (a.lastIndexOf(obj3) === 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.lastIndexOf 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(obj2,obj1,obj3,false,undefined,0,false,null,{toString:function (){return "false"}},"false"); + if (a.lastIndexOf(obj3) === 2) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-6.js index 6cbde571e..adf207420 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-6.js
- * @description Array.prototype.lastIndexOf 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,null,true,false,undefined,_null,"null",undefined,"str",obj);
- if (a.lastIndexOf(null) === 13 )
- {
- 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.lastIndexOf 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,null,true,false,undefined,_null,"null",undefined,"str",obj); + if (a.lastIndexOf(null) === 13 ) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-7.js index 9f2d329e6..a8f2799eb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-7.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.15/15.4.4.15-8-7.js
- * @description Array.prototype.lastIndexOf must return correct index (self reference)
- */
-
-
-function testcase() {
- var a = new Array(0,1,2,3);
- a[2] = a;
- if (a.lastIndexOf(a) === 2 &&
- a.lastIndexOf(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.lastIndexOf must return correct index (self + reference) +includes: [runTestCase.js] +---*/ + +function testcase() { + var a = new Array(0,1,2,3); + a[2] = a; + if (a.lastIndexOf(a) === 2 && + a.lastIndexOf(3) === 3 ) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-8.js index d2dafcf11..b0311d5e4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-8.js
- * @description Array.prototype.lastIndexOf must return correct index (Array)
- */
-
-
-function testcase() {
- var b = new Array("0,1");
- var a = new Array(0,b,"0,1",3);
- if (a.lastIndexOf(b.toString()) === 2 &&
- a.lastIndexOf("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.lastIndexOf 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.lastIndexOf(b.toString()) === 2 && + a.lastIndexOf("0,1") === 2 ) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-9.js index f4bfc196a..eb33cc4d4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-9.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.15/15.4.4.15-8-9.js
- * @description Array.prototype.lastIndexOf must return correct index (Sparse Array)
- */
-
-
-function testcase() {
- var a = new Array(0,1);
- a[4294967294] = 2; // 2^32-2 - is max array element index
- 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
- // stop searching near the end in case implementation actually tries to test all missing elements!!
- a[4294967200] = 3;
- a[4294967201] = 4;
- a[4294967202] = 5;
-
-
- return (a.lastIndexOf(2) === 4294967294 &&
- a.lastIndexOf(3) === 4294967200 &&
- a.lastIndexOf(4) === 4294967201 &&
- a.lastIndexOf(5) === 4294967202) ;
- }
-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.lastIndexOf 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 index + 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 + // stop searching near the end in case implementation actually tries to test all missing elements!! + a[4294967200] = 3; + a[4294967201] = 4; + a[4294967202] = 5; + + + return (a.lastIndexOf(2) === 4294967294 && + a.lastIndexOf(3) === 4294967200 && + a.lastIndexOf(4) === 4294967201 && + a.lastIndexOf(5) === 4294967202) ; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-1.js index 571d687db..7e20fd837 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-1.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(arr, "length"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-10.js index 885f57487..064405d96 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-10.js
- * @description Array.prototype.lastIndexOf - properties can be added to prototype after current position are visited on an Array
- */
-
-
-function testcase() {
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- Object.defineProperty(Array.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- try {
- return arr.lastIndexOf(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.lastIndexOf - 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, "2", { + get: function () { + Object.defineProperty(Array.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + try { + return arr.lastIndexOf(6.99) === 1; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-11.js index 301f4c0b6..3220e4865 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-11.js
- * @description Array.prototype.lastIndexOf - deleting own property causes index property not to be visited on an Array-like object
- */
-
-
-function testcase() {
-
- var arr = { length: 200 };
-
- Object.defineProperty(arr, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "100", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- return -1 === Array.prototype.lastIndexOf.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.lastIndexOf - deleting own property causes index + property not to be visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { length: 200 }; + + Object.defineProperty(arr, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + + Object.defineProperty(arr, "100", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + return -1 === Array.prototype.lastIndexOf.call(arr, 6.99); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-12.js index 52ca2b2fd..92bfd4bea 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-12.js
- * @description Array.prototype.lastIndexOf - deleting own property causes index property not to be visited on an Array
- */
-
-
-function testcase() {
-
- var arr = [1, 2, 3, 4];
-
- Object.defineProperty(arr, "1", {
- get: function () {
- return "6.99";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "3", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- return -1 === arr.lastIndexOf("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.lastIndexOf - deleting own property causes index + property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [1, 2, 3, 4]; + + Object.defineProperty(arr, "1", { + get: function () { + return "6.99"; + }, + configurable: true + }); + + Object.defineProperty(arr, "3", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + return -1 === arr.lastIndexOf("6.99"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-13.js index 057e1d1d6..9d69f82d6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-13.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.15/15.4.4.15-8-a-13.js
- * @description Array.prototype.lastIndexOf - 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, "3", {
- get: function () {
- delete Object.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- return -1 === Array.prototype.lastIndexOf.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.lastIndexOf - 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, "3", { + get: function () { + delete Object.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + return -1 === Array.prototype.lastIndexOf.call(arr, 1); + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-14.js index 85f549919..27ec13fe1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-14.js
- * @description Array.prototype.lastIndexOf - deleting property of prototype causes prototype index property not to be visited on an Array
- */
-
-
-function testcase() {
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "20", {
- get: function () {
- delete Array.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- return -1 === arr.lastIndexOf(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.lastIndexOf - 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, "20", { + get: function () { + delete Array.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + return -1 === arr.lastIndexOf(1); + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-15.js index c88fa8629..57248b94c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-15.js
- * @description Array.prototype.lastIndexOf - 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, "6", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- return 1 === Array.prototype.lastIndexOf.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.lastIndexOf - 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, "6", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + return 1 === Array.prototype.lastIndexOf.call(arr, 1); + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-16.js index 51488600e..2c5eb8653 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-16.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.15/15.4.4.15-8-a-16.js
- * @description Array.prototype.lastIndexOf - 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, "2", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- return 1 === arr.lastIndexOf(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.lastIndexOf - 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, "2", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + return 1 === arr.lastIndexOf(1); + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-17.js index 4cdf2cbda..4f546d7d3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-17.js
- * @description Array.prototype.lastIndexOf - decreasing length of array causes index property not to be visited
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2, "last", 4];
-
- Object.defineProperty(arr, "4", {
- get: function () {
- arr.length = 3;
- return 0;
- },
- configurable: true
- });
-
- return -1 === arr.lastIndexOf("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.lastIndexOf - decreasing length of array causes + index property not to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2, "last", 4]; + + Object.defineProperty(arr, "4", { + get: function () { + arr.length = 3; + return 0; + }, + configurable: true + }); + + return -1 === arr.lastIndexOf("last"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-18.js index 5a7bcdc88..6151f55e1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-18.js
- * @description Array.prototype.lastIndexOf - decreasing length of array with prototype property causes prototype index property to be visited
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2, 3, 4];
-
- try {
- Object.defineProperty(Array.prototype, "2", {
- get: function () {
- return "prototype";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "3", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- return 2 === arr.lastIndexOf("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.lastIndexOf - decreasing length of array with + prototype property causes prototype index property to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2, 3, 4]; + + try { + Object.defineProperty(Array.prototype, "2", { + get: function () { + return "prototype"; + }, + configurable: true + }); + + Object.defineProperty(arr, "3", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + return 2 === arr.lastIndexOf("prototype"); + } finally { + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-19.js index 785ec810d..b6cedcf8a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-19.js
- * @description Array.prototype.lastIndexOf - decreasing length of array does not delete non-configurable properties
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2, 3];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- return "unconfigurable";
- },
- configurable: false
- });
-
- Object.defineProperty(arr, "3", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- return 2 === arr.lastIndexOf("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.lastIndexOf - decreasing length of array does not + delete non-configurable properties +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2, 3]; + + Object.defineProperty(arr, "2", { + get: function () { + return "unconfigurable"; + }, + configurable: false + }); + + Object.defineProperty(arr, "3", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + return 2 === arr.lastIndexOf("unconfigurable"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-2.js index 18006bb77..4c4ea244c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-2.js
- * @description Array.prototype.lastIndexOf - 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 10;
- }
- };
-
- return 4 === Array.prototype.lastIndexOf.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.lastIndexOf - 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 10; + } + }; + + return 4 === Array.prototype.lastIndexOf.call(arr, targetObj, fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-3.js index bad040b18..aa2f7287c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-3.js
- * @description Array.prototype.lastIndexOf - 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 11;
- }
- };
-
- return 4 === arr.lastIndexOf(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.lastIndexOf - 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 11; + } + }; + + return 4 === arr.lastIndexOf(targetObj, fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-4.js index 3e99faeb1..427fc5eef 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-4.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(arr, 6.99); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-5.js index 2892d1475..93b8f4bf9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-5.js
- * @description Array.prototype.lastIndexOf - deleted properties of 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 15;
- }
- };
-
- return -1 === Array.prototype.lastIndexOf.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.lastIndexOf - deleted properties of 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 15; + } + }; + + return -1 === Array.prototype.lastIndexOf.call(arr, false, fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-6.js index 1fc4c98c1..0e28c0184 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-6.js
- * @description Array.prototype.lastIndexOf - deleted properties of 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 11;
- }
- };
-
- return -1 === arr.lastIndexOf("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.lastIndexOf - deleted properties of 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 11; + } + }; + + return -1 === arr.lastIndexOf("10", fromIndex); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-7.js index 1c14fd2fd..d325cc618 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-7.js
- * @description Array.prototype.lastIndexOf - properties added into own object after current position are visited on an Array-like object
- */
-
-
-function testcase() {
-
- var arr = { length: 8 };
-
- Object.defineProperty(arr, "4", {
- get: function () {
- Object.defineProperty(arr, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- return Array.prototype.lastIndexOf.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.lastIndexOf - properties added into own object + after current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { length: 8 }; + + Object.defineProperty(arr, "4", { + get: function () { + Object.defineProperty(arr, "1", { + get: function () { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + return Array.prototype.lastIndexOf.call(arr, 1) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-8.js index 3564e0488..f370321b1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-a-8.js
- * @description Array.prototype.lastIndexOf - properties added into own object after current position are visited on an Array
- */
-
-
-function testcase() {
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- Object.defineProperty(arr, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- return arr.lastIndexOf(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.lastIndexOf - 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, "2", { + get: function () { + Object.defineProperty(arr, "1", { + get: function () { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + return arr.lastIndexOf(1) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-9.js index a86244a21..7f3f6ee07 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-9.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.15/15.4.4.15-8-a-9.js
- * @description Array.prototype.lastIndexOf - properties can be added to prototype after current position are visited on an Array-like object
- */
-
-
-function testcase() {
-
- var arr = { length: 9 };
-
- Object.defineProperty(arr, "4", {
- get: function () {
- Object.defineProperty(Object.prototype, "1", {
- get: function () {
- return Infinity;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- try {
- return Array.prototype.lastIndexOf.call(arr, Infinity) === 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.lastIndexOf - properties can be added to + prototype after current position are visited on an Array-like + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = { length: 9 }; + + Object.defineProperty(arr, "4", { + get: function () { + Object.defineProperty(Object.prototype, "1", { + get: function () { + return Infinity; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + try { + return Array.prototype.lastIndexOf.call(arr, Infinity) === 1; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-1.js index 12d549640..2c770c88d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-1.js
- * @description Array.prototype.lastIndexOf - undefined property wouldn't be called
- */
-
-
-function testcase() {
-
- return [0, , 2].lastIndexOf(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.lastIndexOf - undefined property wouldn't be called +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [0, , 2].lastIndexOf(undefined) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-1.js index 2fdce2c32..b6150acb7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-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.15/15.4.4.15-8-b-i-1.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.call(obj, 0) === 0 &&
- Array.prototype.lastIndexOf.call(obj, 1) === 1 &&
- Array.prototype.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(obj, 0) === 0 && + Array.prototype.lastIndexOf.call(obj, 1) === 1 && + Array.prototype.lastIndexOf.call(obj, 2) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-10.js index 9fb425002..8e8bcd1cf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-10.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.call(obj, 0) &&
- 1 === Array.prototype.lastIndexOf.call(obj, 1) &&
- 2 === Array.prototype.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(obj, 0) && + 1 === Array.prototype.lastIndexOf.call(obj, 1) && + 2 === Array.prototype.lastIndexOf.call(obj, 2); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-11.js index 1d0e5458a..5275a2118 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-11.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.15/15.4.4.15-8-b-i-11.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf(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.lastIndexOf - 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.lastIndexOf(true); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-12.js index 8698c16e9..277875d89 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-12.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(obj, true); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-13.js index 682098e31..fb95b7d8d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-13.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.15/15.4.4.15-8-b-i-13.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf(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.lastIndexOf - 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.lastIndexOf(true); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-14.js index d7d9d9c6a..63a7cc9a6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-14.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(obj, true); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-15.js index 6c489a8ca..6d2cc034c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-15.js
- * @description Array.prototype.lastIndexOf - 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 === [, , , ].lastIndexOf(10) &&
- 1 === [, , , ].lastIndexOf(20) &&
- 2 === [, , , ].lastIndexOf(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.lastIndexOf - 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 === [, , , ].lastIndexOf(10) && + 1 === [, , , ].lastIndexOf(20) && + 2 === [, , , ].lastIndexOf(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.15/15.4.4.15-8-b-i-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-16.js index 5e147f31a..fd28d83c9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-16.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.call({ length: 3 }, 10) &&
- 1 === Array.prototype.lastIndexOf.call({ length: 3 }, 20) &&
- 2 === Array.prototype.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call({ length: 3 }, 10) && + 1 === Array.prototype.lastIndexOf.call({ length: 3 }, 20) && + 2 === Array.prototype.lastIndexOf.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.15/15.4.4.15-8-b-i-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-17.js index 1d946ca4b..5d9817190 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-17.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf(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.lastIndexOf - 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.lastIndexOf(undefined) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-18.js index 641652241..e7aeb80e4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-18.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(obj, undefined); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-19.js index 46600cc57..9e7f7ebc1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-19.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.15/15.4.4.15-8-b-i-19.js
- * @description Array.prototype.lastIndexOf - 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 obj = { length: 1 };
- try {
- Object.defineProperty(Object.prototype, "0", {
- get: function () {
- return 20;
- },
- configurable: true
- });
- Object.defineProperty(obj, "0", {
- set: function () { },
- configurable: true
- });
-
- return obj.hasOwnProperty(0) && 0 === Array.prototype.lastIndexOf.call(obj, 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.lastIndexOf - 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 obj = { length: 1 }; + try { + Object.defineProperty(Object.prototype, "0", { + get: function () { + return 20; + }, + configurable: true + }); + Object.defineProperty(obj, "0", { + set: function () { }, + configurable: true + }); + + return obj.hasOwnProperty(0) && 0 === Array.prototype.lastIndexOf.call(obj, undefined); + } finally { + delete Object.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-2.js index 01e66dc81..568624953 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-2.js
- * @description Array.prototype.lastIndexOf - element to be retrieved is own data property on an Array
- */
-
-
-function testcase() {
- return [true, true, true].lastIndexOf(true) === 2 &&
- [true, true, false].lastIndexOf(true) === 1 &&
- [true, false, false].lastIndexOf(true) === 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.lastIndexOf - element to be retrieved is own data + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + return [true, true, true].lastIndexOf(true) === 2 && + [true, true, false].lastIndexOf(true) === 1 && + [true, false, false].lastIndexOf(true) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-20.js index 58952fa4e..df3be1e14 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-20.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.15/15.4.4.15-8-b-i-20.js
- * @description Array.prototype.lastIndexOf - element to be retrieved is an own accessor property without a get function that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var arr = [, 1];
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 100;
- },
- configurable: true
- });
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- return arr.hasOwnProperty(0) && arr.lastIndexOf(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.lastIndexOf - element to be retrieved is an own + accessor property without a get function that overrides an + inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [, 1]; + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 100; + }, + configurable: true + }); + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + return arr.hasOwnProperty(0) && arr.lastIndexOf(undefined) === 0; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-21.js index 62e193fce..e21b81f94 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-21.js
- * @description Array.prototype.lastIndexOf - 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 [, ].lastIndexOf(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.lastIndexOf - 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 [, ].lastIndexOf(undefined) === 0; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-22.js index b55226315..629ac7e6a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-22.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-8-b-i-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-23.js index 867c59185..80b2589ec 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-23.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.call(fnGlobalObject(), targetObj) &&
- 100 === Array.prototype.lastIndexOf.call(fnGlobalObject(), "100") &&
- -1 === Array.prototype.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call(fnGlobalObject(), targetObj) && + 100 === Array.prototype.lastIndexOf.call(fnGlobalObject(), "100") && + -1 === Array.prototype.lastIndexOf.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.15/15.4.4.15-8-b-i-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-25.js index b33d89fd8..4a4e2b3ab 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-25.js
- * @description Array.prototype.lastIndexOf 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.lastIndexOf.call(arguments, arguments[0]) &&
- -1 === Array.prototype.lastIndexOf.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.lastIndexOf 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.lastIndexOf.call(arguments, arguments[0]) && + -1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]); + }; + + return func(true); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-26.js index 3f948599e..0d4f9fcdb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-26.js
- * @description Array.prototype.lastIndexOf 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.lastIndexOf.call(arguments, arguments[0]) &&
- 1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]) &&
- -1 === Array.prototype.lastIndexOf.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.lastIndexOf 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.lastIndexOf.call(arguments, arguments[0]) && + 1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]) && + -1 === Array.prototype.lastIndexOf.call(arguments, arguments[2]); + }; + + return func(0, true); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-27.js index b2a215213..6b775a169 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-27.js
- * @description Array.prototype.lastIndexOf 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 2 === Array.prototype.lastIndexOf.call(arguments, arguments[0]) &&
- 3 === Array.prototype.lastIndexOf.call(arguments, arguments[3]) &&
- -1 === Array.prototype.lastIndexOf.call(arguments, arguments[4]);
- };
-
- return func(0, arguments, 0, Object.prototype);
- }
-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.lastIndexOf 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 2 === Array.prototype.lastIndexOf.call(arguments, arguments[0]) && + 3 === Array.prototype.lastIndexOf.call(arguments, arguments[3]) && + -1 === Array.prototype.lastIndexOf.call(arguments, arguments[4]); + }; + + return func(0, arguments, 0, Object.prototype); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-28.js index 8c4a11711..9d4c1e167 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-28.js
- * @description Array.prototype.lastIndexOf - side-effects are visible in subsequent iterations on an Array
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var arr = [];
-
- Object.defineProperty(arr, "2", {
- 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.lastIndexOf(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.lastIndexOf - side-effects are visible in + subsequent iterations on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var arr = []; + + Object.defineProperty(arr, "2", { + 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.lastIndexOf(true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-29.js index fb85b2877..bf038e492 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-29.js
- * @description Array.prototype.lastIndexOf - side-effects are visible in subsequent iterations on an Array-like object
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var obj = { length: 3 };
-
- Object.defineProperty(obj, "2", {
- 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.lastIndexOf.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.lastIndexOf - side-effects are visible in + subsequent iterations on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var obj = { length: 3 }; + + Object.defineProperty(obj, "2", { + 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.lastIndexOf.call(obj, true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-3.js index e7c20a515..7e00670c4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-3.js
- * @description Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
- try {
- Array.prototype[0] = Object;
- return [Object.prototype].lastIndexOf(Object.prototype) === 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.lastIndexOf - 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] = Object; + return [Object.prototype].lastIndexOf(Object.prototype) === 0; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-30.js index fad93dcf5..c465d7e39 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-30.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.15/15.4.4.15-8-b-i-30.js
- * @description Array.prototype.lastIndexOf terminates iteration on unhandled exception on an Array
- */
-
-
-function testcase() {
-
- var accessed = false;
- var arr = [];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- throw new TypeError();
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- accessed = true;
- return true;
- },
- configurable: true
- });
-
- try {
- arr.lastIndexOf(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.lastIndexOf terminates iteration on unhandled + exception on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var arr = []; + + Object.defineProperty(arr, "2", { + get: function () { + throw new TypeError(); + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + accessed = true; + return true; + }, + configurable: true + }); + + try { + arr.lastIndexOf(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.15/15.4.4.15-8-b-i-31.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-31.js index fa491307f..289471163 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-31.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-31.js
- * @description Array.prototype.lastIndexOf terminates iteration on unhandled exception on an Array-like object
- */
-
-
-function testcase() {
-
- var accessed = false;
- var obj = { length: 3 };
-
- Object.defineProperty(obj, "2", {
- get: function () {
- throw new TypeError();
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "1", {
- get: function () {
- accessed = true;
- return true;
- },
- configurable: true
- });
-
- try {
- Array.prototype.lastIndexOf.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.lastIndexOf terminates iteration on unhandled + exception on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var obj = { length: 3 }; + + Object.defineProperty(obj, "2", { + get: function () { + throw new TypeError(); + }, + configurable: true + }); + + Object.defineProperty(obj, "1", { + get: function () { + accessed = true; + return true; + }, + configurable: true + }); + + try { + Array.prototype.lastIndexOf.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.15/15.4.4.15-8-b-i-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-4.js index 8ba62506c..efd347ddd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-4.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-8-b-i-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-5.js index 4f6071186..7d99fc1c4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-5.js
- * @description Array.prototype.lastIndexOf - 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 === [Number].lastIndexOf(Number);
- } 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.lastIndexOf - 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 === [Number].lastIndexOf(Number); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-6.js index b087664b2..bbc1afb0a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-6.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.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.15/15.4.4.15-8-b-i-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-7.js index ae582912e..ec681fef1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-7.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.15/15.4.4.15-8-b-i-7.js
- * @description Array.prototype.lastIndexOf - 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 === [, , , ].lastIndexOf(true) &&
- 1 === [, , , ].lastIndexOf(false) &&
- 2 === [, , , ].lastIndexOf("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.lastIndexOf - 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 === [, , , ].lastIndexOf(true) && + 1 === [, , , ].lastIndexOf(false) && + 2 === [, , , ].lastIndexOf("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.15/15.4.4.15-8-b-i-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-8.js index 6edfb7fcf..eb3e71f6a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-8.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf.call({ length: 3 }, true) &&
- 1 === Array.prototype.lastIndexOf.call({ length: 3 }, false) &&
- 2 === Array.prototype.lastIndexOf.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.lastIndexOf - 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.lastIndexOf.call({ length: 3 }, true) && + 1 === Array.prototype.lastIndexOf.call({ length: 3 }, false) && + 2 === Array.prototype.lastIndexOf.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.15/15.4.4.15-8-b-i-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-9.js index 93137e052..c42598c91 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-i-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-i-9.js
- * @description Array.prototype.lastIndexOf - 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.lastIndexOf(0) === 0 && arr.lastIndexOf(1) === 1 && arr.lastIndexOf(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.lastIndexOf - 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.lastIndexOf(0) === 0 && arr.lastIndexOf(1) === 1 && arr.lastIndexOf(2) === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-1.js index 120e8edc4..abe99d934 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-1.js
- * @description Array.prototype.lastIndexOf - type of array element is different from type of search element
- */
-
-
-function testcase() {
-
- return ["true"].lastIndexOf(true) === -1 &&
- ["0"].lastIndexOf(0) === -1 &&
- [false].lastIndexOf(0) === -1 &&
- [undefined].lastIndexOf(0) === -1 &&
- [null].lastIndexOf(0) === -1 &&
- [[]].lastIndexOf(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.lastIndexOf - type of array element is different + from type of search element +includes: [runTestCase.js] +---*/ + +function testcase() { + + return ["true"].lastIndexOf(true) === -1 && + ["0"].lastIndexOf(0) === -1 && + [false].lastIndexOf(0) === -1 && + [undefined].lastIndexOf(0) === -1 && + [null].lastIndexOf(0) === -1 && + [[]].lastIndexOf(0) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-10.js index 200c71805..f32aa5ad6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-10.js
- * @description Array.prototype.lastIndexOf - both array element and search element are booleans, and they have same value
- */
-
-
-function testcase() {
-
- return [false, true].lastIndexOf(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.lastIndexOf - both array element and search + element are booleans, and they have same value +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [false, true].lastIndexOf(true) === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-11.js index 1c80e5669..e953354f0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-11.js
- * @description Array.prototype.lastIndexOf - both array element and search element are Objects, and they refer to the same object
- */
-
-
-function testcase() {
-
- var obj1 = {};
- var obj2 = {};
- var obj3 = obj2;
- return [obj2, obj1].lastIndexOf(obj3) === 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.lastIndexOf - both array element and search + element are Objects, and they refer to the same object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj1 = {}; + var obj2 = {}; + var obj3 = obj2; + return [obj2, obj1].lastIndexOf(obj3) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-2.js index 3326149bf..851de4d99 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-2.js
- * @description Array.prototype.lastIndexOf - both type of array element and type of search element are Undefined
- */
-
-
-function testcase() {
-
- return [undefined].lastIndexOf() === 0 && [undefined].lastIndexOf(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.lastIndexOf - both type of array element and type + of search element are Undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [undefined].lastIndexOf() === 0 && [undefined].lastIndexOf(undefined) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-3.js index 2d029cdcc..1c62a93ea 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-3.js
- * @description Array.prototype.lastIndexOf - both type of array element and type of search element are Null
- */
-
-
-function testcase() {
-
- return [null].lastIndexOf(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.lastIndexOf - both type of array element and type + of search element are Null +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [null].lastIndexOf(null) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-4.js index 191725903..5aa30af54 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-4.js
- * @description Array.prototype.lastIndexOf - search element is NaN
- */
-
-
-function testcase() {
-
- return [+NaN, NaN, -NaN].lastIndexOf(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.lastIndexOf - search element is NaN +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [+NaN, NaN, -NaN].lastIndexOf(NaN) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-5.js index fbc668f49..89ff4c486 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-5.js @@ -1,15 +1,15 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/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.15/15.4.4.15-8-b-ii-5.js
- * @description Array.prototype.lastIndexOf - search element is -NaN
- */
-
-
-function testcase() {
- return [+NaN, NaN, -NaN].lastIndexOf(-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.lastIndexOf - search element is -NaN +includes: [runTestCase.js] +---*/ + +function testcase() { + return [+NaN, NaN, -NaN].lastIndexOf(-NaN) === -1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-6.js index 408395950..d6872e917 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-6.js
- * @description Array.prototype.lastIndexOf - array element is +0 and search element is -0
- */
-
-
-function testcase() {
-
- return [+0].lastIndexOf(-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.lastIndexOf - array element is +0 and search + element is -0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [+0].lastIndexOf(-0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-7.js index ee2df51c0..2266cba9c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-7.js
- * @description Array.prototype.lastIndexOf - array element is -0 and search element is +0
- */
-
-
-function testcase() {
-
- return [-0].lastIndexOf(+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.lastIndexOf - array element is -0 and search + element is +0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [-0].lastIndexOf(+0) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-8.js index bc32ceecb..697f31377 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-ii-8.js
- * @description Array.prototype.lastIndexOf - both array element and search element are numbers, and they have same value
- */
-
-
-function testcase() {
-
- return [-1, 0, 1].lastIndexOf(-1) === 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.lastIndexOf - both array element and search + element are numbers, and they have same value +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [-1, 0, 1].lastIndexOf(-1) === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-9.js index b14aec8d6..bc8fdc32c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-ii-9.js @@ -1,16 +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.15/15.4.4.15-8-b-ii-9.js
- * @description Array.prototype.lastIndexOf - both array element and search element are strings, and they have exactly the same sequence of characters
- */
-
-
-function testcase() {
-
- return ["abc", "ab", "bca", ""].lastIndexOf("abc") === 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.lastIndexOf - both array element and search + element are strings, and they have exactly the same sequence of + characters +includes: [runTestCase.js] +---*/ + +function testcase() { + + return ["abc", "ab", "bca", ""].lastIndexOf("abc") === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-iii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-iii-1.js index f4a690473..c38ecbafb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-iii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-iii-1.js
- * @description Array.prototype.lastIndexOf returns index of last one when more than two elements in array are eligible
- */
-
-
-function testcase() {
-
- return [2, 1, 2, 2, 1].lastIndexOf(2) === 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.lastIndexOf returns index of last one when more + than two elements in array are eligible +includes: [runTestCase.js] +---*/ + +function testcase() { + + return [2, 1, 2, 2, 1].lastIndexOf(2) === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-iii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-iii-2.js index bdd887ea4..5d3594b25 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-b-iii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-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.15/15.4.4.15-8-b-iii-2.js
- * @description Array.prototype.lastIndexOf returns without visiting subsequent element once search value is found
- */
-
-
-function testcase() {
- var arr = [2, 1, , 1, 2];
- var elementFirstAccessed = false;
- var elementThirdAccessed = false;
-
- Object.defineProperty(arr, "2", {
- get: function () {
- elementThirdAccessed = true;
- return 2;
- },
- configurable: true
- });
- Object.defineProperty(arr, "0", {
- get: function () {
- elementFirstAccessed = true;
- return 2;
- },
- configurable: true
- });
-
- arr.lastIndexOf(2);
- return !elementThirdAccessed && !elementFirstAccessed;
- }
-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.lastIndexOf returns without visiting subsequent + element once search value is found +includes: [runTestCase.js] +---*/ + +function testcase() { + var arr = [2, 1, , 1, 2]; + var elementFirstAccessed = false; + var elementThirdAccessed = false; + + Object.defineProperty(arr, "2", { + get: function () { + elementThirdAccessed = true; + return 2; + }, + configurable: true + }); + Object.defineProperty(arr, "0", { + get: function () { + elementFirstAccessed = true; + return 2; + }, + configurable: true + }); + + arr.lastIndexOf(2); + return !elementThirdAccessed && !elementFirstAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-1.js index 9aacf744b..1fc9d2166 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-1.js @@ -1,37 +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.15/15.4.4.15-9-1.js
- * @description Array.prototype.lastIndexOf returns -1 for elements not present
- */
-
-
-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.lastIndexOf(1) !== 100 ||
- a.lastIndexOf("") !== 99999 ||
- a.lastIndexOf("str") !== 123456 ||
- a.lastIndexOf(5.5) !== 5555 ||
- a.lastIndexOf(1E+309) !== 5 )
- {
- return false;
- }
- if (a.lastIndexOf(true) === -1 &&
- a.lastIndexOf(5) === -1 &&
- a.lastIndexOf("str1") === -1 &&
- a.lastIndexOf(null) === -1 &&
- a.lastIndexOf(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.lastIndexOf returns -1 for elements not present +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.lastIndexOf(1) !== 100 || + a.lastIndexOf("") !== 99999 || + a.lastIndexOf("str") !== 123456 || + a.lastIndexOf(5.5) !== 5555 || + a.lastIndexOf(1E+309) !== 5 ) + { + return false; + } + if (a.lastIndexOf(true) === -1 && + a.lastIndexOf(5) === -1 && + a.lastIndexOf("str1") === -1 && + a.lastIndexOf(null) === -1 && + a.lastIndexOf(new Object()) === -1 ) + { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-2.js index a1135345c..f053ad1f4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.15/15.4.4.15-9-2.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.15/15.4.4.15-9-2.js
- * @description Array.prototype.lastIndexOf 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.lastIndexOf.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.lastIndexOf 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.lastIndexOf.call(f,1); + + if (i === -1 && accessed==false) { + return true; + } + } +runTestCase(testcase); |