diff options
Diffstat (limited to 'test/suite/ch15/15.4/15.4.4/15.4.4.19')
193 files changed, 6025 insertions, 5753 deletions
diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-0-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-0-1.js index 5086ee9e7..6a0dcbf5a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-0-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-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.19/15.4.4.19-0-1.js
- * @description Array.prototype.map must exist as a function
- */
-
-
-function testcase() {
- var f = Array.prototype.map;
- 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.map must exist as a function +includes: [runTestCase.js] +---*/ + +function testcase() { + var f = Array.prototype.map; + if (typeof(f) === "function") { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-0-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-0-2.js index 1a8db8871..3882ac0ea 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-0-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-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.19/15.4.4.19-0-2.js
- * @description Array.prototype.map.length must be 1
- */
-
-
-function testcase() {
- if (Array.prototype.map.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.map.length must be 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + if (Array.prototype.map.length === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-1.js index 8d5e99473..6b293b52c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-1.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.19/15.4.4.19-1-1.js
- * @description Array.prototype.map - applied to undefined
- */
-
-
-function testcase() {
- try {
- Array.prototype.map.call(undefined); // TypeError is thrown if value is undefined
- return false;
- } catch (e) {
- return (e instanceof TypeError);
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.map - applied to undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.map.call(undefined); // TypeError is thrown if value is undefined + return false; + } catch (e) { + return (e instanceof TypeError); + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-10.js index a94fdb553..cacab7397 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-10.js @@ -1,27 +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.19/15.4.4.19-1-10.js
- * @description Array.prototype.map - applied to the Math object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return ('[object Math]' === Object.prototype.toString.call(obj));
- }
-
- try {
- Math.length = 1;
- Math[0] = 1;
- var testResult = Array.prototype.map.call(Math, callbackfn);
- return testResult[0] === true;
- } finally {
- delete Math[0];
- delete Math.length;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.map - applied to the Math object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return ('[object Math]' === Object.prototype.toString.call(obj)); + } + + try { + Math.length = 1; + Math[0] = 1; + var testResult = Array.prototype.map.call(Math, callbackfn); + return testResult[0] === true; + } finally { + delete Math[0]; + delete Math.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-11.js index 0d8c50c8c..4fc5b9081 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-11.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.19/15.4.4.19-1-11.js
- * @description Array.prototype.map - applied to Date object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Date;
- }
-
- var obj = new Date();
- obj.length = 1;
- obj[0] = 1;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[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.map - applied to Date object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Date; + } + + var obj = new Date(); + obj.length = 1; + obj[0] = 1; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-12.js index 3f100dcfe..476506ce7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-12.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.19/15.4.4.19-1-12.js
- * @description Array.prototype.map - applied to RegExp object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof RegExp;
- }
-
- var obj = new RegExp();
- obj.length = 1;
- obj[0] = 1;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[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.map - applied to RegExp object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof RegExp; + } + + var obj = new RegExp(); + obj.length = 1; + obj[0] = 1; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-13.js index 33b5dfb0b..05dcc3124 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-13.js @@ -1,27 +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.19/15.4.4.19-1-13.js
- * @description Array.prototype.map - applied to the JSON object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return ('[object JSON]' === Object.prototype.toString.call(obj));
- }
-
- try {
- JSON.length = 1;
- JSON[0] = 1;
- var testResult = Array.prototype.map.call(JSON, callbackfn);
- return testResult[0] === true;
- } finally {
- delete JSON.length;
- delete JSON[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.map - applied to the JSON object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return ('[object JSON]' === Object.prototype.toString.call(obj)); + } + + try { + JSON.length = 1; + JSON[0] = 1; + var testResult = Array.prototype.map.call(JSON, callbackfn); + return testResult[0] === true; + } finally { + delete JSON.length; + delete JSON[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-14.js index f195f0300..52b9336d9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-14.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.19/15.4.4.19-1-14.js
- * @description Array.prototype.map - applied to Error object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Error;
- }
-
- var obj = new Error();
- obj.length = 1;
- obj[0] = 1;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[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.map - applied to Error object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Error; + } + + var obj = new Error(); + obj.length = 1; + obj[0] = 1; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-15.js index b15213fb4..422ead071 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-15.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.19/15.4.4.19-1-15.js
- * @description Array.prototype.map - applied to the Arguments object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return ('[object Arguments]' === Object.prototype.toString.call(obj));
- }
-
- var obj = (function () {
- return arguments;
- }("a", "b"));
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[1] === 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.map - applied to the Arguments object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return ('[object Arguments]' === Object.prototype.toString.call(obj)); + } + + var obj = (function () { + return arguments; + }("a", "b")); + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-2.js index dd4555294..b9231183e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-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.19/15.4.4.19-1-2.js
- * @description Array.prototype.map - applied to null
- */
-
-
-function testcase() {
- try {
- Array.prototype.map.call(null); // TypeError is thrown if value is null
- return false;
- } catch (e) {
- return (e instanceof TypeError);
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.map - applied to null +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.map.call(null); // TypeError is thrown if value is null + return false; + } catch (e) { + return (e instanceof TypeError); + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-3.js index 0a9e6aee3..c4647262e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-3.js @@ -1,29 +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.19/15.4.4.19-1-3.js
- * @description Array.prototype.map - applied to boolean primitive
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof Boolean;
- }
-
- try {
- Boolean.prototype[0] = true;
- Boolean.prototype.length = 1;
-
- var testResult = Array.prototype.map.call(false, callbackfn);
- return testResult[0] === true;
- } finally {
- delete Boolean.prototype[0];
- 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.map - applied to boolean primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof Boolean; + } + + try { + Boolean.prototype[0] = true; + Boolean.prototype.length = 1; + + var testResult = Array.prototype.map.call(false, callbackfn); + return testResult[0] === true; + } finally { + delete Boolean.prototype[0]; + delete Boolean.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-4.js index 880a1b3f1..d65a48ef3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-4.js @@ -1,26 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-4.js
- * @description Array.prototype.map - applied to Boolean object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Boolean;
- }
-
- var obj = new Boolean(true);
- obj.length = 2;
- obj[0] = 11;
- obj[1] = 12;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[0] === true && testResult[1] === 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.map - applied to Boolean object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Boolean; + } + + var obj = new Boolean(true); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-5.js index 32d4fc48b..b677d53d2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-5.js @@ -1,28 +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.19/15.4.4.19-1-5.js
- * @description Array.prototype.map - applied to number primitive
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Number;
- }
-
- try {
- Number.prototype[0] = 1;
- Number.prototype.length = 1;
-
- var testResult = Array.prototype.map.call(2.5, callbackfn);
- return testResult[0] === true;
- } finally {
- delete Number.prototype[0];
- 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.map - applied to number primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Number; + } + + try { + Number.prototype[0] = 1; + Number.prototype.length = 1; + + var testResult = Array.prototype.map.call(2.5, callbackfn); + return testResult[0] === true; + } finally { + delete Number.prototype[0]; + delete Number.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-6.js index 727d6ac53..cabf25fb4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-6.js @@ -1,26 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-6.js
- * @description Array.prototype.map - applied to Number object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Number;
- }
-
- var obj = new Number(-128);
- obj.length = 2;
- obj[0] = 11;
- obj[1] = 12;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[0] === true && testResult[1] === 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.map - applied to Number object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Number; + } + + var obj = new Number(-128); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-7.js index cb7a6289a..01f117b96 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-7.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-7.js
- * @description Array.prototype.map - applied to string primitive
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof String;
- }
-
- var testResult = Array.prototype.map.call("abc", callbackfn);
-
- return testResult[0] === true && testResult[1] === true && testResult[2] === 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.map - applied to string primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof String; + } + + var testResult = Array.prototype.map.call("abc", callbackfn); + + return testResult[0] === true && testResult[1] === true && testResult[2] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-8.js index d9582dac8..7ae711c07 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-8.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.19/15.4.4.19-1-8.js
- * @description Array.prototype.map - applied to String object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof String;
- }
-
- var obj = new String("abc");
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[0] === true && testResult[1] === true && testResult[2] === 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.map - applied to String object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof String; + } + + var obj = new String("abc"); + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true && testResult[1] === true && testResult[2] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-9.js index 382eeb910..1e95836ac 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-1-9.js @@ -1,27 +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.19/15.4.4.19-1-9.js
- * @description Array.prototype.map - applied to Function object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Function;
- }
-
- var obj = function (a, b) {
- return a + b;
- };
- obj[0] = 11;
- obj[1] = 9;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[0] === true && testResult[1] === 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.map - applied to Function object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Function; + } + + var obj = function (a, b) { + return a + b; + }; + obj[0] = 11; + obj[1] = 9; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-1.js index db8ffe25f..c6536cc3a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-1.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.19/15.4.4.19-2-1.js
- * @description Array.prototype.map - applied to Array-like object when 'length' is an own data property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = {
- 0: 12,
- 1: 11,
- 2: 9,
- length: 2
- };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object when 'length' + is an own data property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 + }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-10.js index 22db2211c..27a3370dc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-10.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.19/15.4.4.19-2-10.js
- * @description Array.prototype.map - applied to Array-like object, 'length' is an inherited accessor property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var proto = {};
-
- Object.defineProperty(proto, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object, 'length' is an + inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var proto = {}; + + Object.defineProperty(proto, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child[0] = 12; + child[1] = 11; + child[2] = 9; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-11.js index df8573a35..55c5ea6f6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-11.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.19/15.4.4.19-2-11.js
- * @description Array.prototype.map - applied to Array-like object when 'length' is an own accessor property without a get function
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = {
- 0: 11,
- 1: 12
- };
- Object.defineProperty(obj, "length", {
- set: function () { },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return 0 === testResult.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.map - applied to Array-like object when 'length' + is an own accessor property without a get function +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { + 0: 11, + 1: 12 + }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return 0 === testResult.length; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-12.js index 56c357069..b828f8242 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-12.js @@ -1,37 +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.19/15.4.4.19-2-12.js
- * @description Array.prototype.map - applied to the Array-like object when 'length' is own accessor property without a get function that overrides an inherited accessor property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- try {
- Object.defineProperty(Object.prototype, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- var obj = { 0: 12, 1: 11 };
- Object.defineProperty(obj, "length", {
- set: function () { },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult.length === 0;
- } 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.map - applied to the Array-like object when + 'length' is own accessor property without a get function that + overrides an inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + try { + Object.defineProperty(Object.prototype, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + var obj = { 0: 12, 1: 11 }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult.length === 0; + } finally { + delete Object.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-13.js index d9389bf6b..9be97c170 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-13.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-13.js
- * @description Array.prototype.map - applied to the Array-like object when 'length' is inherited accessor property without a get function
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var proto = {};
- Object.defineProperty(proto, "length", {
- set: function () { },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child[0] = 11;
- child[1] = 12;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return 0 === testResult.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.map - applied to the Array-like object when + 'length' is inherited accessor property without a get function +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var proto = {}; + Object.defineProperty(proto, "length", { + set: function () { }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child[0] = 11; + child[1] = 12; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return 0 === testResult.length; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-14.js index 76bf3e253..9e4555249 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-14.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.19/15.4.4.19-2-14.js
- * @description Array.prototype.map - applied to the Array-like object that 'length' property doesn't exist
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 11, 1: 12 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return 0 === testResult.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.map - applied to the Array-like object that + 'length' property doesn't exist +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 11, 1: 12 }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return 0 === testResult.length; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-15.js index c4a3c39c7..c8ad17fa0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-15.js @@ -1,32 +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.19/15.4.4.19-2-15.js
- * @description Array.prototype.map - when 'length' is property of the global object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[0] = 12;
- fnGlobalObject()[1] = 11;
- fnGlobalObject()[2] = 9;
- fnGlobalObject().length = 2;
- var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn);
- return testResult.length === 2;
- } finally {
- delete fnGlobalObject()[0];
- 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.map - when 'length' is property of the global + object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[0] = 12; + fnGlobalObject()[1] = 11; + fnGlobalObject()[2] = 9; + fnGlobalObject().length = 2; + var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); + return testResult.length === 2; + } finally { + delete fnGlobalObject()[0]; + 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.19/15.4.4.19-2-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-17.js index f9fe52b75..821bc792c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-17.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.19/15.4.4.19-2-17.js
- * @description Array.prototype.map - applied to Arguments object, which implements its own property get method
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var func = function (a, b) {
- return Array.prototype.map.call(arguments, callbackfn);
- };
-
- var testResult = func(12, 11);
-
- return testResult.length === 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.map - applied to Arguments object, which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var func = function (a, b) { + return Array.prototype.map.call(arguments, callbackfn); + }; + + var testResult = func(12, 11); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-18.js index d9aa220b2..f04a93879 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-18.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.19/15.4.4.19-2-18.js
- * @description Array.prototype.map - applied to String object, which implements its own property get method
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return parseInt(val, 10) > 1;
- }
-
- var str = new String("432");
- try {
- String.prototype[3] = "1";
- var testResult = Array.prototype.map.call(str, callbackfn);
-
- return 3 === testResult.length;
- } 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.map - applied to String object, which implements + its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return parseInt(val, 10) > 1; + } + + var str = new String("432"); + try { + String.prototype[3] = "1"; + var testResult = Array.prototype.map.call(str, callbackfn); + + return 3 === testResult.length; + } finally { + delete String.prototype[3]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-19.js index 91a99f37a..1388552f6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-19.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.19/15.4.4.19-2-19.js
- * @description Array.prototype.map - applied to Function object, which implements its own property get method
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var fun = function (a, b) {
- return a + b;
- };
- fun[0] = 12;
- fun[1] = 11;
- fun[2] = 9;
-
- var testResult = Array.prototype.map.call(fun, callbackfn);
-
- return 2 === testResult.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.map - applied to Function object, which implements + its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var fun = function (a, b) { + return a + b; + }; + fun[0] = 12; + fun[1] = 11; + fun[2] = 9; + + var testResult = Array.prototype.map.call(fun, callbackfn); + + return 2 === testResult.length; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-2.js index d0098f814..f96d15c63 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-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.19/15.4.4.19-2-2.js
- * @description Array.prototype.map - when 'length' is own data property on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var testResult = [12, 11].map(callbackfn);
- return testResult.length === 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.map - when 'length' is own data property on an + Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var testResult = [12, 11].map(callbackfn); + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-3.js index 77a92c38d..2264fa229 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-3.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.19/15.4.4.19-2-3.js
- * @description Array.prototype.map - applied to Array-like object, 'length' is an own data property that overrides an inherited data property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var proto = { length: 3 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 2;
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object, 'length' is an + own data property that overrides an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var proto = { length: 3 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 2; + child[0] = 12; + child[1] = 11; + child[2] = 9; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-4.js index 869d93f20..ac81d0bb8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-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.19/15.4.4.19-2-4.js
- * @description Array.prototype.map - when 'length' is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
- var arrProtoLen;
- try {
- arrProtoLen = Array.prototype.length;
- Array.prototype.length = 0;
- var testResult = [12, 11].map(callbackfn);
- return testResult.length === 2;
- } 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.map - when 'length' is own data property that + overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + var arrProtoLen; + try { + arrProtoLen = Array.prototype.length; + Array.prototype.length = 0; + var testResult = [12, 11].map(callbackfn); + return testResult.length === 2; + } finally { + Array.prototype.length = arrProtoLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-5.js index a5663a4b4..435f30fd1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-5.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.19/15.4.4.19-2-5.js
- * @description Array.prototype.map - applied to Array-like object, 'length' is an own data property that overrides an inherited accessor property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var proto = {};
-
- Object.defineProperty(proto, "length", {
- get: function () {
- return 3;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 2;
- Object.defineProperty(child, "length", {
- value: 2,
- configurable: true
- });
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object, 'length' is an + own data property that overrides an inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var proto = {}; + + Object.defineProperty(proto, "length", { + get: function () { + return 3; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 2; + Object.defineProperty(child, "length", { + value: 2, + configurable: true + }); + child[0] = 12; + child[1] = 11; + child[2] = 9; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-6.js index 0178c7520..5f59242fe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-6.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.19/15.4.4.19-2-6.js
- * @description Array.prototype.map - applied to Array-like object, 'length' is an inherited data property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var proto = { length: 2 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object, 'length' is an + inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var proto = { length: 2 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child[0] = 12; + child[1] = 11; + child[2] = 9; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-7.js index 49376c058..354f1cee6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-7.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.19/15.4.4.19-2-7.js
- * @description Array.prototype.map - applied to Array-like object, 'length' is an own accessor property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- obj[0] = 12;
- obj[1] = 11;
- obj[2] = 9;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object, 'length' is an + own accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + obj[0] = 12; + obj[1] = 11; + obj[2] = 9; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-8.js index 1186f45ec..58227fa94 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-8.js @@ -1,39 +1,41 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-8.js
- * @description Array.prototype.map - applied to Array-like object, 'length' is an own accessor property that overrides an inherited data property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var proto = { length: 3 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
-
- Object.defineProperty(child, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object, 'length' is an + own accessor property that overrides an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var proto = { length: 3 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + child[0] = 12; + child[1] = 11; + child[2] = 9; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-9.js index 9f5fc1562..4966f6d7d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-9.js @@ -1,46 +1,49 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-2-9.js
- * @description Array.prototype.map - applied to Array-like object when 'length' is an own accessor property that overrides an inherited accessor property
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var proto = {};
-
- Object.defineProperty(proto, "length", {
- get: function () {
- return 3;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
-
- Object.defineProperty(child, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult.length === 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.map - applied to Array-like object when 'length' + is an own accessor property that overrides an inherited accessor + property +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var proto = {}; + + Object.defineProperty(proto, "length", { + get: function () { + return 3; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + child[0] = 12; + child[1] = 11; + child[2] = 9; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-1.js index 0d33e8567..c84d7303b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-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.19/15.4.4.19-3-1.js
- * @description Array.prototype.map - value of 'length' is undefined
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { length: undefined };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { length: undefined }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-10.js index 3ab521826..3a156c5a7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-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.19/15.4.4.19-3-10.js
- * @description Array.prototype.map - value of 'length' is a number (value is NaN)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 9, length: NaN };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a number (value is NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 9, length: NaN }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-11.js index 6a43b1a4b..0e70a0e1f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-11.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.19/15.4.4.19-3-11.js
- * @description Array.prototype.map - 'length' is a string containing a positive number
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 11, 1: 9, 2: 12, length: "2" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - 'length' is a string containing a positive + number +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 11, 1: 9, 2: 12, length: "2" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.js index bc8a8bd60..d4fbe2d2f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-12.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.19/15.4.4.19-3-12.js
- * @description Array.prototype.map - 'length' is a string containing a negative number
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 11, 1: 9, 2: 12, length: "-4294967294" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - 'length' is a string containing a negative + number +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 11, 1: 9, 2: 12, length: "-4294967294" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-13.js index 6d6dd4516..f91a0587d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-13.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.19/15.4.4.19-3-13.js
- * @description Array.prototype.map - value of 'length' is string that is able to convert to number primitive (value is a decimal number)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 11, 1: 9, 2: 12, length: "2.5" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is string that is able to + convert to number primitive (value is a decimal number) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 11, 1: 9, 2: 12, length: "2.5" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.js index 12ab69187..20cf1dc03 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-14.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.19/15.4.4.19-3-14.js
- * @description Array.prototype.map - 'length' is a string containing Infinity
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 9, length: "Infinity" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - 'length' is a string containing Infinity +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 9, length: "Infinity" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-15.js index 53ed04cbc..abd918ed6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-15.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.19/15.4.4.19-3-15.js
- * @description Array.prototype.map - 'length' is a string containing an exponential number
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 11, 1: 9, 2: 12, length: "2E0" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - 'length' is a string containing an + exponential number +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 11, 1: 9, 2: 12, length: "2E0" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-16.js index c02d8a271..e9f34c3a9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-16.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.19/15.4.4.19-3-16.js
- * @description Array.prototype.map - 'length' is a string containing a hex number
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 11, 1: 9, 2: 12, length: "0x0002" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - 'length' is a string containing a hex number +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 11, 1: 9, 2: 12, length: "0x0002" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-17.js index b594f2c03..fe7cc8840 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-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.19/15.4.4.19-3-17.js
- * @description Array.prototype.map - when 'length' is a string containing a number with leading zeros
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 11, 1: 9, 2: 12, length: "0002.00" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - when 'length' is a string containing a + number with leading zeros +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 11, 1: 9, 2: 12, length: "0002.00" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-18.js index 19878a1e3..3378ab5c1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-18.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.19/15.4.4.19-3-18.js
- * @description Array.prototype.map - value of 'length' is a string that can't convert to a number
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { length: "asdf!_" };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a string that can't + convert to a number +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { length: "asdf!_" }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-19.js index 7804d0442..0fabe04fa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-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.19/15.4.4.19-3-19.js
- * @description Array.prototype.map - value of 'length' is an Object which has an own toString method
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = {
- 0: 11,
- 1: 9,
-
- length: {
- toString: function () {
- return '2';
- }
- }
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is an Object which has an + own toString method +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { + 0: 11, + 1: 9, + + length: { + toString: function () { + return '2'; + } + } + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-2.js index 940421288..2cbee5c81 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-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.19/15.4.4.19-3-2.js
- * @description Array.prototype.map on an Array-like object if 'length' is 1 (length overridden to true(type conversion))
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 11, length: true };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map on an Array-like object if 'length' is 1 + (length overridden to true(type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 11, length: true }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-20.js index 62fa55bcc..dba2f5a4d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-20.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.19/15.4.4.19-3-20.js
- * @description Array.prototype.map - value of 'length' is an Object which has an own valueOf method
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = {
- 0: 11,
- 1: 9,
-
- length: {
- valueOf: function () {
- return 2;
- }
- }
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is an Object which has an + own valueOf method +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { + 0: 11, + 1: 9, + + length: { + valueOf: function () { + return 2; + } + } + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-21.js index 9af6c7cd8..7cb010a24 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-21.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.19/15.4.4.19-3-21.js
- * @description Array.prototype.map - 'length' is an object that has an own valueOf method that returns an object and toString method that returns a string
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var firstStepOccured = false;
- var secondStepOccured = false;
- var obj = {
- 0: 11,
- 1: 9,
-
- length: {
- valueOf: function () {
- firstStepOccured = true;
- return {};
- },
- toString: function () {
- secondStepOccured = true;
- return '2';
- }
- }
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 2 && firstStepOccured && secondStepOccured;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map - '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() { + + function callbackfn(val, idx, obj) { + return val < 10; + } + + var firstStepOccured = false; + var secondStepOccured = false; + var obj = { + 0: 11, + 1: 9, + + length: { + valueOf: function () { + firstStepOccured = true; + return {}; + }, + toString: function () { + secondStepOccured = true; + return '2'; + } + } + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2 && firstStepOccured && secondStepOccured; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-22.js index a42427771..2961e9a55 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-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.19/15.4.4.19-3-22.js
- * @description Array.prototype.map throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = {
- 1: 11,
- 2: 12,
-
- length: {
- valueOf: function () {
- return {};
- },
- toString: function () {
- return {};
- }
- }
- };
-
- try {
- Array.prototype.map.call(obj, callbackfn);
- return false;
- } catch (ex) {
- return ex instanceof TypeError;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map throws TypeError exception when 'length' is an + object with toString and valueOf methods that don�t return + primitive values +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { + 1: 11, + 2: 12, + + length: { + valueOf: function () { + return {}; + }, + toString: function () { + return {}; + } + } + }; + + try { + Array.prototype.map.call(obj, callbackfn); + return false; + } catch (ex) { + return ex instanceof TypeError; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-23.js index d0a6529cd..c7bb0a34e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-23.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.19/15.4.4.19-3-23.js
- * @description Array.prototype.map uses inherited valueOf method when 'length' is an object with an own toString and inherited valueOf methods
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var valueOfAccessed = false;
- var toStringAccessed = 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 '1';
- };
-
- var obj = {
- 0: 11,
- 1: 9,
- length: child
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 2 && 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.map uses inherited valueOf method when 'length' is + an object with an own toString and inherited valueOf methods +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val < 10; + } + + var valueOfAccessed = false; + var toStringAccessed = 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 '1'; + }; + + var obj = { + 0: 11, + 1: 9, + length: child + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2 && valueOfAccessed && !toStringAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-24.js index e74dfc417..2e3c2de93 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-24.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.19/15.4.4.19-3-24.js
- * @description Array.prototype.map - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = {
- 0: 11,
- 1: 9,
- length: 2.685
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a positive non-integer, + ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { + 0: 11, + 1: 9, + length: 2.685 + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js index fb8650562..43ebce9ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-25.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.19/15.4.4.19-3-25.js
- * @description Array.prototype.map - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = {
- 0: 11,
- 1: 9,
- length: -4294967294.5
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a negative non-integer, + ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { + 0: 11, + 1: 9, + length: -4294967294.5 + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js index 6ec1c9b0c..68cfdd255 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-28.js @@ -1,27 +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.19/15.4.4.19-3-28.js
- * @description Array.prototype.map - value of 'length' is boundary value (2^32)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = {
- 0: 12,
- length: 4294967296
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is boundary value (2^32) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { + 0: 12, + length: 4294967296 + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.js index 17cc5ec77..29002a55b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-29.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.19/15.4.4.19-3-29.js
- * @description Array.prototype.map - value of 'length' is boundary value (2^32 + 1)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = {
- 0: 11,
- 1: 9,
- length: 4294967297
- };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
- return newArr.length === 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.map - value of 'length' is boundary value (2^32 + + 1) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { + 0: 11, + 1: 9, + length: 4294967297 + }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + return newArr.length === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-3.js index 21eaf9a20..07d5b2fb6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-3.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.19/15.4.4.19-3-3.js
- * @description Array.prototype.map - value of 'length' is a number (value is 0)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 11, length: 0 };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a number (value is 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 11, length: 0 }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-4.js index ddcaa5e8a..bac58223a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-4.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.19/15.4.4.19-3-4.js
- * @description Array.prototype.map - value of 'length' is a number (value is +0)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 11, length: +0 };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a number (value is +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 11, length: +0 }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-5.js index df448ed92..b8fe99288 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-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.19/15.4.4.19-3-5.js
- * @description Array.prototype.map - value of 'length' is a number (value is -0)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 11, length: -0 };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a number (value is -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 11, length: -0 }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-6.js index 350f8271a..faa65bf39 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-6.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.19/15.4.4.19-3-6.js
- * @description Array.prototype.map - 'length' is a string containing a positive number
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 10, 1: 12, 2: 9, length: 2 };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - 'length' is a string containing a positive + number +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 10, 1: 12, 2: 9, length: 2 }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.js index 2088b90cc..542837098 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-7.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.19/15.4.4.19-3-7.js
- * @description Array.prototype.map - 'length' is a string containing a negative number
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 10, 1: 12, 2: 9, length: -4294967294 };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - 'length' is a string containing a negative + number +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 10, 1: 12, 2: 9, length: -4294967294 }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.js index 7c6fc4cfa..a932fa894 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-8.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.19/15.4.4.19-3-8.js
- * @description Array.prototype.map - value of 'length' is a number (value is Infinity)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 9, length: Infinity };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a number (value is + Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 9, length: Infinity }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-9.js index 7b3257ed0..e283d35d1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-3-9.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.19/15.4.4.19-3-9.js
- * @description Array.prototype.map - value of 'length' is a number (value is -Infinity)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 10;
- }
-
- var obj = { 0: 9, length: -Infinity };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr.length === 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.map - value of 'length' is a number (value is + -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 10; + } + + var obj = { 0: 9, length: -Infinity }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-1.js index 148503eb6..a0ae16261 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-1.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.19/15.4.4.19-4-1.js
- * @description Array.prototype.map throws TypeError if callbackfn is undefined
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.map();
- }
- 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.map throws TypeError if callbackfn is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.map(); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-10.js index 9fb309af3..3b431abdb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-10.js @@ -1,30 +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.19/15.4.4.19-4-10.js
- * @description Array.prototype.map - the exception is not thrown if exception was thrown by step 2
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, 1: 12 };
-
- Object.defineProperty(obj, "length", {
- get: function () {
- throw new SyntaxError();
- },
- configurable: true
- });
-
- try {
- Array.prototype.map.call(obj, undefined);
- return false;
- } catch (ex) {
- return !(ex instanceof TypeError);
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map - the exception is not thrown if exception was + thrown by step 2 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, 1: 12 }; + + Object.defineProperty(obj, "length", { + get: function () { + throw new SyntaxError(); + }, + configurable: true + }); + + try { + Array.prototype.map.call(obj, undefined); + return false; + } catch (ex) { + return !(ex instanceof TypeError); + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-11.js index 539ca88f6..553e49adb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-11.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.19/15.4.4.19-4-11.js
- * @description Array.prototype.map - the exception is not thrown if exception was thrown by step 3
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, 1: 12 };
-
- Object.defineProperty(obj, "length", {
- get: function () {
- return {
- toString: function () {
- throw new SyntaxError();
- }
- };
- },
- configurable: true
- });
-
- try {
- Array.prototype.map.call(obj, undefined);
- return false;
- } catch (ex) {
- return !(ex instanceof TypeError);
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map - the exception is not thrown if exception was + thrown by step 3 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, 1: 12 }; + + Object.defineProperty(obj, "length", { + get: function () { + return { + toString: function () { + throw new SyntaxError(); + } + }; + }, + configurable: true + }); + + try { + Array.prototype.map.call(obj, undefined); + return false; + } catch (ex) { + return !(ex instanceof TypeError); + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-12.js index 91b6d20f0..158377b4e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-12.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.19/15.4.4.19-4-12.js
- * @description Array.prototype.map - 'callbackfn' is a function
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var testResult = [11, 9].map(callbackfn);
- return testResult.length === 2 && testResult[0] === true && testResult[1] === 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.map - 'callbackfn' is a function +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var testResult = [11, 9].map(callbackfn); + return testResult.length === 2 && testResult[0] === true && testResult[1] === false; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-15.js index 55d5d62d6..08c5588ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-15.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.19/15.4.4.19-4-15.js
- * @description Array.prototype.map - calling with no callbackfn is the same as passing undefined for callbackfn
- */
-
-
-function testcase() {
-
- var obj = { 10: 10 };
- var lengthAccessed = false;
- var loopAccessed = false;
-
- Object.defineProperty(obj, "length", {
- get: function () {
- lengthAccessed = true;
- return 20;
- },
- configurable: true
- });
- Object.defineProperty(obj, "0", {
- get: function () {
- loopAccessed = true;
- return 10;
- },
- configurable: true
- });
-
- try {
- Array.prototype.map.call(obj);
- return false;
- } catch (e) {
- return e instanceof TypeError && lengthAccessed && !loopAccessed;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map - calling with no callbackfn is the same as + passing undefined for callbackfn +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 10: 10 }; + var lengthAccessed = false; + var loopAccessed = false; + + Object.defineProperty(obj, "length", { + get: function () { + lengthAccessed = true; + return 20; + }, + configurable: true + }); + Object.defineProperty(obj, "0", { + get: function () { + loopAccessed = true; + return 10; + }, + configurable: true + }); + + try { + Array.prototype.map.call(obj); + return false; + } catch (e) { + return e instanceof TypeError && lengthAccessed && !loopAccessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-2.js index bfddbb4ce..9f0321828 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-2.js @@ -1,24 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-2.js
- * @description Array.prototype.map throws ReferenceError if callbackfn is unreferenced
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.map(foo);
- }
- catch(e) {
- if(e instanceof ReferenceError)
- 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.map throws ReferenceError if callbackfn is + unreferenced +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.map(foo); + } + catch(e) { + if(e instanceof ReferenceError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-3.js index 05dfe0f0e..0bff093b9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-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.19/15.4.4.19-4-3.js
- * @description Array.prototype.map throws TypeError if callbackfn is null
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.map(null);
- }
- 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.map throws TypeError if callbackfn is null +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.map(null); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-4.js index 342756203..559fdfe83 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-4.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.19/15.4.4.19-4-4.js
- * @description Array.prototype.map throws TypeError if callbackfn is boolean
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.map(true);
- }
- 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.map throws TypeError if callbackfn is boolean +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.map(true); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-5.js index aca5ee86d..5070b5757 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-5.js @@ -1,24 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-5.js
- * @description Array.prototype.map throws TypeError if callbackfn is number
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.map(5);
- }
- 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.map throws TypeError if callbackfn is number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.map(5); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-6.js index a5867eb1f..f10caf6ae 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-6.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.19/15.4.4.19-4-6.js
- * @description Array.prototype.map throws TypeError if callbackfn is string
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.map("abc");
- }
- 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.map throws TypeError if callbackfn is string +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.map("abc"); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-7.js index ce7b92ead..25b04ffac 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-7.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.19/15.4.4.19-4-7.js
- * @description Array.prototype.map throws TypeError if callbackfn is Object without Call internal method
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.map(new Object());
- }
- 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.map throws TypeError if callbackfn is Object + without Call internal method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.map(new Object()); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-8.js index e0d48d431..e6f2a14cc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-8.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.19/15.4.4.19-4-8.js
- * @description Array.prototype.map - Side effects produced by step 2 are visible when an exception occurs
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, 1: 12 };
-
- var accessed = false;
-
- Object.defineProperty(obj, "length", {
- get: function () {
- accessed = true;
- return 2;
- },
- configurable: true
- });
-
- try {
- Array.prototype.map.call(obj, null);
- return false;
- } catch (ex) {
- return ex 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.map - Side effects produced by step 2 are visible + when an exception occurs +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, 1: 12 }; + + var accessed = false; + + Object.defineProperty(obj, "length", { + get: function () { + accessed = true; + return 2; + }, + configurable: true + }); + + try { + Array.prototype.map.call(obj, null); + return false; + } catch (ex) { + return ex instanceof TypeError && accessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-9.js index 4045a508e..2acf07177 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-4-9.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.19/15.4.4.19-4-9.js
- * @description Array.prototype.map - Side effects produced by step 3 are visible when an exception occurs
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, 1: 12 };
-
- var accessed = false;
-
- Object.defineProperty(obj, "length", {
- get: function () {
- return {
- toString: function () {
- accessed = true;
- return "2";
- }
- };
- },
- configurable: true
- });
-
- try {
- Array.prototype.map.call(obj, null);
- return false;
- } catch (ex) {
- return ex 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.map - Side effects produced by step 3 are visible + when an exception occurs +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, 1: 12 }; + + var accessed = false; + + Object.defineProperty(obj, "length", { + get: function () { + return { + toString: function () { + accessed = true; + return "2"; + } + }; + }, + configurable: true + }); + + try { + Array.prototype.map.call(obj, null); + return false; + } catch (ex) { + return ex instanceof TypeError && accessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js index ff305673e..c090e1f1d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.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.19/15.4.4.19-5-1-s.js
- * @description Array.prototype.map - thisArg not passed to strict callbackfn
- * @onlyStrict
- */
-
-
-function testcase() {
- var innerThisCorrect = false;
-
- function callbackfn(val, idx, obj) {
- "use strict";
- innerThisCorrect = this===undefined;
- return true;
- }
-
- [1].map(callbackfn);
- return innerThisCorrect;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.map - thisArg not passed to strict callbackfn +flags: [onlyStrict] +includes: [runTestCase.js] +---*/ + +function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].map(callbackfn); + return innerThisCorrect; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1.js index fa027e13b..1cbe2fae9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1.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.19/15.4.4.19-5-1.js
- * @description Array.prototype.map - thisArg not passed
- */
-
-
-function testcase() {
- try {
- fnGlobalObject()._15_4_4_19_5_1 = true;
- var _15_4_4_19_5_1 = false;
-
- function callbackfn(val, idx, obj) {
- return this._15_4_4_19_5_1;
- }
- var srcArr = [1];
- var resArr = srcArr.map(callbackfn);
- if( resArr[0] === true)
- return true;
-
- return false;
- }
- finally {
- delete fnGlobalObject()._15_4_4_19_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.map - thisArg not passed +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + try { + fnGlobalObject()._15_4_4_19_5_1 = true; + var _15_4_4_19_5_1 = false; + + function callbackfn(val, idx, obj) { + return this._15_4_4_19_5_1; + } + var srcArr = [1]; + var resArr = srcArr.map(callbackfn); + if( resArr[0] === true) + return true; + + return false; + } + finally { + delete fnGlobalObject()._15_4_4_19_5_1; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-10.js index bb8fe0e19..7a8f96f9b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-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.19/15.4.4.19-5-10.js
- * @description Array.prototype.map - Array object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objArray = new Array(2);
-
- function callbackfn(val, idx, obj) {
- return this === objArray;
- }
-
- var testResult = [11].map(callbackfn, objArray);
- return testResult[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.map - Array object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objArray = new Array(2); + + function callbackfn(val, idx, obj) { + return this === objArray; + } + + var testResult = [11].map(callbackfn, objArray); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-11.js index fd09a32f5..b1511578b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-11.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.19/15.4.4.19-5-11.js
- * @description Array.prototype.map - String object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objString = new String();
-
- function callbackfn(val, idx, obj) {
- return this === objString;
- }
-
- var testResult = [11].map(callbackfn, objString);
- return testResult[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.map - String object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objString = new String(); + + function callbackfn(val, idx, obj) { + return this === objString; + } + + var testResult = [11].map(callbackfn, objString); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-12.js index e2ec294c3..ac321d430 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-12.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.19/15.4.4.19-5-12.js
- * @description Array.prototype.map - Boolean object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objBoolean = new Boolean();
-
- function callbackfn(val, idx, obj) {
- return this === objBoolean;
- }
-
- var testResult = [11].map(callbackfn, objBoolean);
- return testResult[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.map - Boolean object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objBoolean = new Boolean(); + + function callbackfn(val, idx, obj) { + return this === objBoolean; + } + + var testResult = [11].map(callbackfn, objBoolean); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-13.js index 586165aef..9bb11a7da 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-13.js @@ -1,23 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-13.js
- * @description Array.prototype.map - Number object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objNumber = new Number();
-
- function callbackfn(val, idx, obj) {
- return this === objNumber;
- }
-
- var testResult = [11].map(callbackfn, objNumber);
- return testResult[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.map - Number object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objNumber = new Number(); + + function callbackfn(val, idx, obj) { + return this === objNumber; + } + + var testResult = [11].map(callbackfn, objNumber); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-14.js index a266476f4..842e1a414 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-14.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.19/15.4.4.19-5-14.js
- * @description Array.prototype.map - the Math object can be used as thisArg
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this === Math;
- }
-
- var testResult = [11].map(callbackfn, Math);
- return testResult[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.map - the Math object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this === Math; + } + + var testResult = [11].map(callbackfn, Math); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-15.js index 408af6ef1..aac4eaea1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-15.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.19/15.4.4.19-5-15.js
- * @description Array.prototype.map - Date object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objDate = new Date();
-
- function callbackfn(val, idx, obj) {
- return this === objDate;
- }
-
- var testResult = [11].map(callbackfn, objDate);
- return testResult[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.map - Date object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objDate = new Date(); + + function callbackfn(val, idx, obj) { + return this === objDate; + } + + var testResult = [11].map(callbackfn, objDate); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-16.js index e71489d42..48d1eab99 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-16.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.19/15.4.4.19-5-16.js
- * @description Array.prototype.map - RegExp object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objRegExp = new RegExp();
-
- function callbackfn(val, idx, obj) {
- return this === objRegExp;
- }
-
- var testResult = [11].map(callbackfn, objRegExp);
- return testResult[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.map - RegExp object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objRegExp = new RegExp(); + + function callbackfn(val, idx, obj) { + return this === objRegExp; + } + + var testResult = [11].map(callbackfn, objRegExp); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-17.js index 12658c653..ba6826fbb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-17.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.19/15.4.4.19-5-17.js
- * @description Array.prototype.map - the JSON object can be used as thisArg
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this === JSON;
- }
-
- var testResult = [11].map(callbackfn, JSON);
- return testResult[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.map - the JSON object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this === JSON; + } + + var testResult = [11].map(callbackfn, JSON); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-18.js index b00f3a28f..0867efc2d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-18.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.19/15.4.4.19-5-18.js
- * @description Array.prototype.map - Error object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objError = new RangeError();
-
- function callbackfn(val, idx, obj) {
- return this === objError;
- }
-
- var testResult = [11].map(callbackfn, objError);
- return testResult[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.map - Error object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objError = new RangeError(); + + function callbackfn(val, idx, obj) { + return this === objError; + } + + var testResult = [11].map(callbackfn, objError); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-19.js index f7def993e..9d81dbe41 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-19.js @@ -1,27 +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.19/15.4.4.19-5-19.js
- * @description Array.prototype.map - the Arguments object can be used as thisArg
- */
-
-
-function testcase() {
-
- var arg;
-
- function callbackfn(val, idx, obj) {
- return this === arg;
- }
-
- arg = (function () {
- return arguments;
- }(1, 2, 3));
-
- var testResult = [11].map(callbackfn, arg);
- return testResult[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.map - the Arguments object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arg; + + function callbackfn(val, idx, obj) { + return this === arg; + } + + arg = (function () { + return arguments; + }(1, 2, 3)); + + var testResult = [11].map(callbackfn, arg); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-2.js index b590aa06c..2a5aa6e18 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-2.js @@ -1,27 +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.19/15.4.4.19-5-2.js
- * @description Array.prototype.map - thisArg is Object
- */
-
-
-function testcase() {
- var res = false;
- var o = new Object();
- o.res = true;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- var srcArr = [1];
- var resArr = srcArr.map(callbackfn,o);
- if( resArr[0] === true)
- 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.map - thisArg is Object +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var o = new Object(); + o.res = true; + function callbackfn(val, idx, obj) + { + return this.res; + } + + var srcArr = [1]; + var resArr = srcArr.map(callbackfn,o); + if( resArr[0] === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-21.js index c8b41eb1b..c798b3f34 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-21.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.19/15.4.4.19-5-21.js
- * @description Array.prototype.map - the global object can be used as thisArg
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this === fnGlobalObject();
- }
-
- var testResult = [11].map(callbackfn, fnGlobalObject());
- return testResult[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.map - the global object can be used as thisArg +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this === fnGlobalObject(); + } + + var testResult = [11].map(callbackfn, fnGlobalObject()); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-22.js index e24a201f0..91fb83cb7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-22.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.19/15.4.4.19-5-22.js
- * @description Array.prototype.map - boolean primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.valueOf() === false;
- }
-
- var testResult = [11].map(callbackfn, false);
- return testResult[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.map - boolean primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.valueOf() === false; + } + + var testResult = [11].map(callbackfn, false); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-23.js index f476eafb6..48cf9d2ad 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-23.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.19/15.4.4.19-5-23.js
- * @description Array.prototype.map - number primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.valueOf() === 101;
- }
-
- var testResult = [11].map(callbackfn, 101);
- return testResult[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.map - number primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.valueOf() === 101; + } + + var testResult = [11].map(callbackfn, 101); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-24.js index 72a81d7c6..42909dbd8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-24.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.19/15.4.4.19-5-24.js
- * @description Array.prototype.map - string primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.valueOf() === "abc";
- }
-
- var testResult = [11].map(callbackfn, "abc");
- return testResult[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.map - string primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.valueOf() === "abc"; + } + + var testResult = [11].map(callbackfn, "abc"); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-3.js index c5f26c12c..3f444ba16 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-3.js @@ -1,27 +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.19/15.4.4.19-5-3.js
- * @description Array.prototype.map - thisArg is Array
- */
-
-
-function testcase() {
- var res = false;
- var a = new Array();
- a.res = true;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- var srcArr = [1];
- var resArr = srcArr.map(callbackfn,a);
- if( resArr[0] === true)
- 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.map - thisArg is Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var a = new Array(); + a.res = true; + function callbackfn(val, idx, obj) + { + return this.res; + } + + var srcArr = [1]; + var resArr = srcArr.map(callbackfn,a); + if( resArr[0] === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-4.js index 00e25c49d..67cf268e0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-4.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.19/15.4.4.19-5-4.js
- * @description Array.prototype.map - thisArg is object from object template(prototype)
- */
-
-
-function testcase() {
- var res = false;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- function foo(){}
- foo.prototype.res = true;
- var f = new foo();
-
- var srcArr = [1];
- var resArr = srcArr.map(callbackfn,f);
- if( resArr[0] === true)
- 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.map - thisArg is object from object + template(prototype) +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } + + function foo(){} + foo.prototype.res = true; + var f = new foo(); + + var srcArr = [1]; + var resArr = srcArr.map(callbackfn,f); + if( resArr[0] === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-5.js index 30c93439e..42941f232 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-5.js @@ -1,29 +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.19/15.4.4.19-5-5.js
- * @description Array.prototype.map - thisArg is object from object template
- */
-
-
-function testcase() {
- var res = false;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- function foo(){}
- var f = new foo();
- f.res = true;
-
- var srcArr = [1];
- var resArr = srcArr.map(callbackfn,f);
- if( resArr[0] === true)
- 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.map - thisArg is object from object template +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } + + function foo(){} + var f = new foo(); + f.res = true; + + var srcArr = [1]; + var resArr = srcArr.map(callbackfn,f); + if( resArr[0] === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-6.js index 51cd1d79c..eae47c804 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-6.js @@ -1,28 +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.19/15.4.4.19-5-6.js
- * @description Array.prototype.map - thisArg is function
- */
-
-
-function testcase() {
- var res = false;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- function foo(){}
- foo.res = true;
-
- var srcArr = [1];
- var resArr = srcArr.map(callbackfn,foo);
- if( resArr[0] === true)
- 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.map - thisArg is function +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } + + function foo(){} + foo.res = true; + + var srcArr = [1]; + var resArr = srcArr.map(callbackfn,foo); + if( resArr[0] === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-7.js index d50832125..c6186c145 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-7.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-7.js
- * @description Array.prototype.map - built-in functions can be used as thisArg
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this === eval;
- }
-
- var testResult = [11].map(callbackfn, eval);
- return testResult[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.map - built-in functions can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this === eval; + } + + var testResult = [11].map(callbackfn, eval); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-9.js index 8977a5579..bb60a638c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-9.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.19/15.4.4.19-5-9.js
- * @description Array.prototype.map - Function object can be used as thisArg
- */
-
-
-function testcase() {
-
- var objFunction = function () { };
-
- function callbackfn(val, idx, obj) {
- return this === objFunction;
- }
-
- var testResult = [11].map(callbackfn, objFunction);
- return testResult[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.map - Function object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var objFunction = function () { }; + + function callbackfn(val, idx, obj) { + return this === objFunction; + } + + var testResult = [11].map(callbackfn, objFunction); + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-6-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-6-1.js index 58cc2d0b0..8c13a5ab3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-6-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-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.19/15.4.4.19-6-1.js
- * @description Array.prototype.map - Array.isArray returns true when input argument is the ourput array
- */
-
-
-function testcase() {
-
- var newArr = [11].map(function () { });
-
- return Array.isArray(newArr);
-
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map - Array.isArray returns true when input + argument is the ourput array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var newArr = [11].map(function () { }); + + return Array.isArray(newArr); + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-6-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-6-2.js index f8a125381..ba44da4c0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-6-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-6-2.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.19/15.4.4.19-6-2.js
- * @description Array.prototype.map - the returned array is instanceof Array
- */
-
-
-function testcase() {
-
- var newArr = [11].map(function () { });
-
- return newArr instanceof Array;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.map - the returned array is instanceof Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var newArr = [11].map(function () { }); + + return newArr instanceof Array; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-1.js index e400b1265..014daab25 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-1.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.19/15.4.4.19-8-1.js
- * @description Array.prototype.map doesn't consider new elements added to array after it is called
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- srcArr[2] = 3;
- srcArr[5] = 6;
- return 1;
- }
-
- var srcArr = [1,2,,4,5];
- var resArr = srcArr.map(callbackfn);
- if(resArr.length === 5)
- 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.map doesn't consider new elements added to array + after it is called +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + srcArr[2] = 3; + srcArr[5] = 6; + return 1; + } + + var srcArr = [1,2,,4,5]; + var resArr = srcArr.map(callbackfn); + if(resArr.length === 5) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-2.js index 988fa0ae6..59c999e11 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-2.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.19/15.4.4.19-8-2.js
- * @description Array.prototype.map considers new value of elements in array after it is called
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- srcArr[4] = -1;
- if(val > 0)
- return 1;
- else
- return 0;
- }
-
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.map(callbackfn);
- if(resArr.length === 5 && resArr[4] === 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.map considers new value of elements in array after + it is called +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + srcArr[4] = -1; + if(val > 0) + return 1; + else + return 0; + } + + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.map(callbackfn); + if(resArr.length === 5 && resArr[4] === 0) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-3.js index a355f41a3..63debe851 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-3.js @@ -1,30 +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.19/15.4.4.19-8-3.js
- * @description Array.prototype.map doesn't visit deleted elements in array after the call
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- delete srcArr[4];
- if(val > 0)
- return 1;
- else
- return 0;
-
- }
-
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.map(callbackfn);
- if(resArr.length === 5 && resArr[4] === undefined)
- 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.map doesn't visit deleted elements in array after + the call +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + delete srcArr[4]; + if(val > 0) + return 1; + else + return 0; + + } + + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.map(callbackfn); + if(resArr.length === 5 && resArr[4] === undefined) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-4.js index 6cfd6f215..f7e154006 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-4.js @@ -1,28 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-4.js
- * @description Array.prototype.map doesn't visit deleted elements when Array.length is decreased
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- srcArr.length = 2;
- callCnt++;
- return 1;
- }
-
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.map(callbackfn);
- if(resArr.length === 5 && callCnt === 2 && resArr[2] === undefined)
- 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.map doesn't visit deleted elements when + Array.length is decreased +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + srcArr.length = 2; + callCnt++; + return 1; + } + + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.map(callbackfn); + if(resArr.length === 5 && callCnt === 2 && resArr[2] === undefined) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-5.js index 4711eeb11..60e6d5ef9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-5.js @@ -1,30 +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.19/15.4.4.19-8-5.js
- * @description Array.prototype.map doesn't consider newly added elements in sparse array
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- srcArr[1000] = 3;
- callCnt++;
- return val;
- }
-
- var srcArr = new Array(10);
- srcArr[1] = 1;
- srcArr[2] = 2;
- var resArr = srcArr.map(callbackfn);
- if( resArr.length === 10 && callCnt === 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.map doesn't consider newly added elements in + sparse array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + srcArr[1000] = 3; + callCnt++; + return val; + } + + var srcArr = new Array(10); + srcArr[1] = 1; + srcArr[2] = 2; + var resArr = srcArr.map(callbackfn); + if( resArr.length === 10 && callCnt === 2) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-6.js index 54f41e899..5ba4dc5bc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-6.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.19/15.4.4.19-8-6.js
- * @description Array.prototype.map visits deleted element in array after the call when same index is also present in prototype
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- delete srcArr[4];
- if(val > 0)
- return 1;
- else
- return 0;
-
- }
-
- Array.prototype[4] = 5;
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.map(callbackfn);
- delete Array.prototype[4];
- if(resArr.length === 5 && resArr[4] === 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.map visits deleted element in array after the call + when same index is also present in prototype +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + delete srcArr[4]; + if(val > 0) + return 1; + else + return 0; + + } + + Array.prototype[4] = 5; + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.map(callbackfn); + delete Array.prototype[4]; + if(resArr.length === 5 && resArr[4] === 1) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-7.js index e0edd25ca..03d0fbe1c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-7.js @@ -1,27 +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.19/15.4.4.19-8-7.js
- * @description Array.prototype.map successful to delete the object in callbackfn
- */
-
-
-function testcase() {
- var obj = {};
- obj.srcArr = [1, 2, 3, 4, 5];
-
- function callbackfn(val, idx, obj) {
- delete obj.srcArr;
- if (val > 0)
- return 1;
- else
- return 0;
- }
-
- var resArr = obj.srcArr.map(callbackfn);
- return resArr.toString() === "1,1,1,1,1" && !obj.hasOwnProperty("arr");
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.map successful to delete the object in callbackfn +includes: [runTestCase.js] +---*/ + +function testcase() { + var obj = {}; + obj.srcArr = [1, 2, 3, 4, 5]; + + function callbackfn(val, idx, obj) { + delete obj.srcArr; + if (val > 0) + return 1; + else + return 0; + } + + var resArr = obj.srcArr.map(callbackfn); + return resArr.toString() === "1,1,1,1,1" && !obj.hasOwnProperty("arr"); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-8.js index f31c5e23b..daeda023d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-8.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.19/15.4.4.19-8-8.js
- * @description Array.prototype.map - no observable effects occur if length is 0 on an Array-like object
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return val > 10;
- }
-
- var obj = { 0: 11, 1: 12, length: 0 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult.length === 0 && !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.map - no observable effects occur if length is 0 + on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; + } + + var obj = { 0: 11, 1: 12, length: 0 }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-9.js index 76d39b411..7bad55985 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-9.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.19/15.4.4.19-8-9.js
- * @description Array.prototype.map - modifications to length don't change number of iterations on an Array
- */
-
-
-function testcase() {
- var called = 0;
- function callbackfn(val, idx, obj) {
- called += 1;
- return val > 10;
- }
-
- var arr = [9, , 12];
-
- Object.defineProperty(arr, "1", {
- get: function () {
- arr.length = 2;
- return 8;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
-
- return testResult.length === 3 && called === 2 && typeof testResult[2] === "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.map - modifications to length don't change number + of iterations on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var called = 0; + function callbackfn(val, idx, obj) { + called += 1; + return val > 10; + } + + var arr = [9, , 12]; + + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 8; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + + return testResult.length === 3 && called === 2 && typeof testResult[2] === "undefined"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-1.js index be5986522..4dd593cb0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-1.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.19/15.4.4.19-8-b-1.js
- * @description Array.prototype.map - callbackfn not called for indexes never been assigned values
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- callCnt++;
- return 1;
- }
-
- var srcArr = new Array(10);
- srcArr[1] = undefined; //explicitly assigning a value
- var resArr = srcArr.map(callbackfn);
- if( resArr.length === 10 && callCnt === 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.map - callbackfn not called for indexes never been + assigned values +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + return 1; + } + + var srcArr = new Array(10); + srcArr[1] = undefined; //explicitly assigning a value + var resArr = srcArr.map(callbackfn); + if( resArr.length === 10 && callCnt === 1) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-10.js index 729b4cb76..c2565ca0b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-10.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.19/15.4.4.19-8-b-10.js
- * @description Array.prototype.map - deleting property of prototype causes prototype index property not to be visited on an Array-like Object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return idx === 1 && typeof val === "undefined";
- }
- var obj = { 2: 2, length: 20 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- delete Object.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult.length === 20 && typeof testResult[1] === "undefined";
- } 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.map - deleting property of prototype causes + prototype index property not to be visited on an Array-like Object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return idx === 1 && typeof val === "undefined"; + } + var obj = { 2: 2, length: 20 }; + + Object.defineProperty(obj, "0", { + get: function () { + delete Object.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult.length === 20 && typeof testResult[1] === "undefined"; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-11.js index 0f8e4ecfc..7415de060 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-11.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.19/15.4.4.19-8-b-11.js
- * @description Array.prototype.map - deleting property of prototype causes prototype index property not to be visited on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return idx === 1 && typeof val === "undefined";
- }
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete Array.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- var testResult = arr.map(callbackfn);
- return testResult.length === 3 && typeof testResult[1] === "undefined";
- } 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.map - deleting property of prototype causes + prototype index property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return idx === 1 && typeof val === "undefined"; + } + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + delete Array.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + var testResult = arr.map(callbackfn); + return testResult.length === 3 && typeof testResult[1] === "undefined"; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-12.js index be4b5fdb6..916772507 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-12.js @@ -1,38 +1,41 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-12.js
- * @description Array.prototype.map - deleting own property with prototype property causes prototype index property to be visited on an Array-like object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 3) {
- return false;
- } else {
- return true;
- }
- }
- var obj = { 0: 0, 1: 1, 2: 2, length: 10 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- delete obj[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 3;
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult[1] === false;
- } 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.map - deleting own property with prototype + property causes prototype index property to be visited on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 3) { + return false; + } else { + return true; + } + } + var obj = { 0: 0, 1: 1, 2: 2, length: 10 }; + + Object.defineProperty(obj, "0", { + get: function () { + delete obj[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 3; + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult[1] === false; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-13.js index 19564a33e..647a4d53d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-13.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.19/15.4.4.19-8-b-13.js
- * @description Array.prototype.map - deleting own property with prototype property causes prototype index property to be visited on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 3) {
- return false;
- } else {
- return true;
- }
- }
- var arr = [0, 1, 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 3;
- var testResult = arr.map(callbackfn);
- return testResult[1] === false;
- } 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.map - deleting own property with prototype + property causes prototype index property to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 3) { + return false; + } else { + return true; + } + } + var arr = [0, 1, 2]; + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 3; + var testResult = arr.map(callbackfn); + return testResult[1] === false; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-14.js index ae6b51385..c66004fc0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-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.19/15.4.4.19-8-b-14.js
- * @description Array.prototype.map - decreasing length of array causes index property not to be visited
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return idx === 3 && typeof val === "undefined";
- }
-
- var arr = [0, 1, 2, "last"];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- arr.length = 3;
- return 0;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
- return typeof testResult[3] === "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.map - decreasing length of array causes index + property not to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return idx === 3 && typeof val === "undefined"; + } + + var arr = [0, 1, 2, "last"]; + + Object.defineProperty(arr, "0", { + get: function () { + arr.length = 3; + return 0; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + return typeof testResult[3] === "undefined"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-15.js index b1efefacb..f6cd6953e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-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.19/15.4.4.19-8-b-15.js
- * @description Array.prototype.map - decreasing length of array with prototype property causes prototype index property to be visited
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 2 && val === "prototype") {
- return false;
- } else {
- return true;
- }
- }
- var arr = [0, 1, 2];
-
- try {
- Object.defineProperty(Array.prototype, "2", {
- get: function () {
- return "prototype";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
- return testResult.length === 3 && testResult[2] === false;
- } 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.map - decreasing length of array with prototype + property causes prototype index property to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 2 && val === "prototype") { + return false; + } else { + return true; + } + } + var arr = [0, 1, 2]; + + try { + Object.defineProperty(Array.prototype, "2", { + get: function () { + return "prototype"; + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + return testResult.length === 3 && testResult[2] === false; + } finally { + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-16.js index 340679e96..cefeceb33 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-16.js @@ -1,41 +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.19/15.4.4.19-8-b-16.js
- * @description Array.prototype.map - decreasing length of array does not delete non-configurable properties
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 2 && val === "unconfigurable") {
- return false;
- } else {
- return true;
- }
- }
-
- var arr = [0, 1, 2];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- return "unconfigurable";
- },
- configurable: false
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
- return testResult.length === 3 && testResult[2] === 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.map - decreasing length of array does not delete + non-configurable properties +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + return false; + } else { + return true; + } + } + + var arr = [0, 1, 2]; + + Object.defineProperty(arr, "2", { + get: function () { + return "unconfigurable"; + }, + configurable: false + }); + + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + return testResult.length === 3 && testResult[2] === false; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-2.js index 1f9eb92b7..031d67e0b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-2.js @@ -1,34 +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.19/15.4.4.19-8-b-2.js
- * @description Array.prototype.map - added properties in step 2 are visible here
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 2 && val === "length") {
- return false;
- } else {
- return true;
- }
- }
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- obj[2] = "length";
- return 3;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult[2] === 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.map - added properties in step 2 are visible here +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 2 && val === "length") { + return false; + } else { + return true; + } + } + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + obj[2] = "length"; + return 3; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult[2] === false; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-3.js index 542c8b53e..ea5bf9ce6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-3.js @@ -1,33 +1,33 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-3.js
- * @description Array.prototype.map - deleted properties in step 2 are visible here
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 2) {
- return false;
- } else {
- return true;
- }
- }
- var obj = { 2: 6.99, 8: 19 };
-
- Object.defineProperty(obj, "length", {
- get: function () {
- delete obj[2];
- return 10;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return typeof testResult[2] === "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.map - deleted properties in step 2 are visible here +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 2) { + return false; + } else { + return true; + } + } + var obj = { 2: 6.99, 8: 19 }; + + Object.defineProperty(obj, "length", { + get: function () { + delete obj[2]; + return 10; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + return typeof testResult[2] === "undefined"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-4.js index fbd3f3a2a..6ceef9d3e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-4.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.19/15.4.4.19-8-b-4.js
- * @description Array.prototype.map - properties added into own object after current position are visited on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 1) {
- return false;
- } else {
- return true;
- }
- }
-
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- Object.defineProperty(obj, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult[0] === true && testResult[1] === 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.map - properties added into own object after + current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } + } + + var obj = { length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + Object.defineProperty(obj, "1", { + get: function () { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult[0] === true && testResult[1] === false; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-5.js index 288e30201..d6ffe2b80 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-5.js @@ -1,39 +1,41 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-5.js
- * @description Array.prototype.map - properties added into own object after current position are visited on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 1) {
- return false;
- } else {
- return true;
- }
- }
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(arr, "1", {
- get: function () {
- return 1;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
- return testResult[0] === true && testResult[1] === 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.map - properties added into own object after + current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + return false; + } else { + return true; + } + } + + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(arr, "1", { + get: function () { + return 1; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + return testResult[0] === true && testResult[1] === false; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-6.js index 0d4b09edc..bca7520b9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-6.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.19/15.4.4.19-8-b-6.js
- * @description Array.prototype.map - properties can be added to prototype after current position are visited on an Array-like object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 6.99) {
- return false;
- } else {
- return true;
- }
- }
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- Object.defineProperty(Object.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- try {
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult[0] === true && testResult[1] === false;
- } 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.map - properties can be added to prototype after + current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return false; + } else { + return true; + } + } + var obj = { length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + Object.defineProperty(Object.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + try { + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult[0] === true && testResult[1] === false; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-7.js index 3261923d1..9e886b8cb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-7.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.19/15.4.4.19-8-b-7.js
- * @description Array.prototype.map - properties can be added to prototype after current position are visited on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 6.99) {
- return false;
- } else {
- return true;
- }
- }
- var arr = [0, , 2];
-
- try {
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(Array.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
- return testResult[0] === true && testResult[1] === false;
- } 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.map - properties can be added to prototype after + current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + return false; + } else { + return true; + } + } + var arr = [0, , 2]; + + try { + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(Array.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + return testResult[0] === true && testResult[1] === false; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-8.js index 342bc67db..73699e042 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-8.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.19/15.4.4.19-8-b-8.js
- * @description Array.prototype.map - deleting own property causes index property not to be visited on an Array-like object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- return false;
- } else {
- return true;
- }
- }
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "0", {
- get: function () {
- delete obj[1];
- return 0;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult[0] === true && typeof testResult[1] === "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.map - deleting own property causes index property + not to be visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 1) { + return false; + } else { + return true; + } + } + var obj = { length: 2 }; + + Object.defineProperty(obj, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + + Object.defineProperty(obj, "0", { + get: function () { + delete obj[1]; + return 0; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult[0] === true && typeof testResult[1] === "undefined"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-9.js index d227af7f9..880fa2e38 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-b-9.js @@ -1,41 +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.19/15.4.4.19-8-b-9.js
- * @description Array.prototype.map - deleting own property causes index property not to be visited on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- return false;
- } else {
- return true;
- }
- }
- var arr = [1, 2];
-
- Object.defineProperty(arr, "1", {
- get: function () {
- return "6.99";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
- return testResult[0] === true && typeof testResult[1] === "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.map - deleting own property causes index property + not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 1) { + return false; + } else { + return true; + } + } + var arr = [1, 2]; + + Object.defineProperty(arr, "1", { + get: function () { + return "6.99"; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + return testResult[0] === true && typeof testResult[1] === "undefined"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-1.js index 98bfa49bf..84aa04742 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-1.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.19/15.4.4.19-8-c-i-1.js
- * @description Array.prototype.map - element to be retrieved is own data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = {};
-
- function callbackfn(val, idx, obj) {
- if (idx === 5) {
- return val === kValue;
- }
- return false;
- }
-
- var obj = { 5: kValue, length: 100 };
-
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr[5] === 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.map - element to be retrieved is own data property + on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = {}; + + function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; + } + + var obj = { 5: kValue, length: 100 }; + + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr[5] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-10.js index 40c52743b..2f3e85027 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-10.js @@ -1,36 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-10.js
- * @description Array.prototype.map - element to be retrieved is own accessor property on an Array
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
-
- return testResult[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.map - element to be retrieved is own accessor + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var arr = []; + + Object.defineProperty(arr, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-11.js index 405fd550e..124ac9d7d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-11.js @@ -1,41 +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.19/15.4.4.19-8-c-i-11.js
- * @description Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var proto = { 0: 5, length: 2 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
-
- Object.defineProperty(child, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult[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.map - 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 kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var proto = { 0: 5, length: 2 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + + Object.defineProperty(child, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-12.js index eefb1f985..c7f3f3432 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-12.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.19/15.4.4.19-8-c-i-12.js
- * @description Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var arr = [];
-
- try {
- Array.prototype[0] = 11;
-
- Object.defineProperty(arr, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
-
- return testResult[0] === 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.map - element to be retrieved is own accessor + property that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var arr = []; + + try { + Array.prototype[0] = 11; + + Object.defineProperty(arr, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + + return testResult[0] === true; + } finally { + delete Array.prototype[0]; + } + + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-13.js index 0ad61ef0d..0ff24f8ba 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-13.js @@ -1,48 +1,51 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-13.js
- * @description Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var proto = { length: 2 };
-
- Object.defineProperty(proto, "0", {
- get: function () {
- return 5;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
-
- Object.defineProperty(child, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult[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.map - 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 kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var proto = { length: 2 }; + + Object.defineProperty(proto, "0", { + get: function () { + return 5; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + + Object.defineProperty(child, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-14.js index 5afe034ff..dc3d473b2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-14.js @@ -1,47 +1,49 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-14.js
- * @description Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var arr = [];
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
-
- return testResult[0] === 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.map - element to be retrieved is own accessor + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var arr = []; + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 11; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + + return testResult[0] === true; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-15.js index 8caa229ba..b184a9028 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-15.js @@ -1,41 +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.19/15.4.4.19-8-c-i-15.js
- * @description Array.prototype.map - element to be retrieved is inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var proto = { length: 2 };
-
- Object.defineProperty(proto, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult[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.map - element to be retrieved is inherited + accessor property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var proto = { length: 2 }; + + Object.defineProperty(proto, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-16.js index ece87a078..cf8d04736 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-16.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.19/15.4.4.19-8-c-i-16.js
- * @description Array.prototype.map - element to be retrieved is inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var testResult = [, ].map(callbackfn);
-
- return testResult[0] === 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.map - element to be retrieved is inherited + accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var testResult = [, ].map(callbackfn); + + return testResult[0] === true; + } finally { + delete Array.prototype[0]; + } + + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-17.js index 307ae70c4..9b0e0ec67 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-17.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.19/15.4.4.19-8-c-i-17.js
- * @description Array.prototype.map - element to be retrieved is own accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- return typeof val === "undefined";
- }
- return false;
- }
-
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "1", {
- set: function () { },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[1] === 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.map - element to be retrieved is own accessor + property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 1) { + return typeof val === "undefined"; + } + return false; + } + + var obj = { length: 2 }; + + Object.defineProperty(obj, "1", { + set: function () { }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-18.js index 2e3cab974..55711e093 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-18.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.19/15.4.4.19-8-c-i-18.js
- * @description Array.prototype.map - element to be retrieved is own accessor property without a get function on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- return typeof val === "undefined";
- }
- return false;
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "1", {
- set: function () { },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
-
- return testResult[1] === 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.map - element to be retrieved is own accessor + property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 1) { + return typeof val === "undefined"; + } + return false; + } + + var arr = []; + + Object.defineProperty(arr, "1", { + set: function () { }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + + return testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-19.js index 2c82e3086..ccb373cc6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-19.js @@ -1,43 +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.19/15.4.4.19-8-c-i-19.js
- * @description Array.prototype.map - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return typeof val === "undefined";
- }
- return false;
- }
-
- var arr = [];
-
- try {
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 100;
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
-
- return testResult[0] === 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.map - element to be retrieved is own accessor + property without a get function that overrides an inherited + accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; + } + + var arr = []; + + try { + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 100; + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + + return testResult[0] === true; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-2.js index 35fc8b31d..6cdee80ce 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-2.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.19/15.4.4.19-8-c-i-2.js
- * @description Array.prototype.map - element to be retrieved is own data property on an Array
- */
-
-
-function testcase() {
-
- var kValue = {};
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var arr = [kValue];
-
- var newArr = arr.map(callbackfn);
-
- return newArr[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.map - element to be retrieved is own data property + on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = {}; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var arr = [kValue]; + + var newArr = arr.map(callbackfn); + + return newArr[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-20.js index 3efa5bb8b..0b59a1ad4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-20.js @@ -1,45 +1,48 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-20.js
- * @description Array.prototype.map - 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() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return typeof val === "undefined";
- }
- return false;
- }
-
- var proto = {};
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 2;
-
- Object.defineProperty(child, "0", {
- set: function () { },
- configurable: true
- });
-
- Object.defineProperty(proto, "0", {
- get: function () {
- return 100;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult[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.map - 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() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; + } + + var proto = {}; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 2; + + Object.defineProperty(child, "0", { + set: function () { }, + configurable: true + }); + + Object.defineProperty(proto, "0", { + get: function () { + return 100; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-21.js index 30b967488..234855949 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-21.js @@ -1,36 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-21.js
- * @description Array.prototype.map - element to be retrieved is inherited accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return typeof val === "undefined";
- }
- return false;
- }
-
- var proto = { length: 2 };
- Object.defineProperty(proto, "0", {
- set: function () { },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult[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.map - element to be retrieved is inherited + accessor property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; + } + + var proto = { length: 2 }; + Object.defineProperty(proto, "0", { + set: function () { }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-22.js index 03f98b42b..a630d288a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-22.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.19/15.4.4.19-8-c-i-22.js
- * @description Array.prototype.map - element to be retrieved is inherited accessor property without a get function on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return typeof val === "undefined";
- }
- return false;
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- set: function () { },
- configurable: true
- });
-
- var testResult = [,].map(callbackfn);
-
- return testResult[0] === 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.map - element to be retrieved is inherited + accessor property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return typeof val === "undefined"; + } + return false; + } + + try { + Object.defineProperty(Array.prototype, "0", { + set: function () { }, + configurable: true + }); + + var testResult = [,].map(callbackfn); + + return testResult[0] === true; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-23.js index 8281b371e..27acab70f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-23.js @@ -1,36 +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.19/15.4.4.19-8-c-i-23.js
- * @description Array.prototype.map - This object is the global object which contains index property
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[0] = kValue;
- fnGlobalObject().length = 2;
-
- var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn);
-
- return testResult[0] === true;
- } finally {
- delete fnGlobalObject()[0];
- 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.map - This object is the global object which + contains index property +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[0] = kValue; + fnGlobalObject().length = 2; + + var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); + + return testResult[0] === true; + } finally { + delete fnGlobalObject()[0]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-25.js index 0fbb3c334..34fa630d2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-25.js @@ -1,30 +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.19/15.4.4.19-8-c-i-25.js
- * @description Array.prototype.map - This object is the Arguments object which implements its own property get method (number of arguments is less than number of parameters)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 9;
- } else {
- return false;
- }
- }
-
- var func = function (a, b) {
- return Array.prototype.map.call(arguments, callbackfn);
- };
-
- var testResult = func(9);
-
- return testResult[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.map - This object is the Arguments object which + implements its own property get method (number of arguments is + less than number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 9; + } else { + return false; + } + } + + var func = function (a, b) { + return Array.prototype.map.call(arguments, callbackfn); + }; + + var testResult = func(9); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-26.js index 7e3fc7e37..b8100b16f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-26.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.19/15.4.4.19-8-c-i-26.js
- * @description Array.prototype.map - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 9;
- } else if (idx === 1) {
- return val === 11;
- } else {
- return false;
- }
- }
-
- var func = function (a, b) {
- return Array.prototype.map.call(arguments, callbackfn);
- };
-
- var testResult = func(9, 11);
-
- return testResult[0] === true && testResult[1] === 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.map - This object is the Arguments object which + implements its own property get method (number of arguments equals + number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 9; + } else if (idx === 1) { + return val === 11; + } else { + return false; + } + } + + var func = function (a, b) { + return Array.prototype.map.call(arguments, callbackfn); + }; + + var testResult = func(9, 11); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-27.js index 4ef582ef1..a3a0de5fa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-27.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.19/15.4.4.19-8-c-i-27.js
- * @description Array.prototype.map - This object is the Arguments object which implements its own property get method (number of arguments is greater than number of parameters)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 9;
- } else if (idx === 1) {
- return val === 11;
- } else if (idx === 2) {
- return val === 12;
- } else {
- return false;
- }
-
- }
-
- var func = function (a, b) {
- return Array.prototype.map.call(arguments, callbackfn);
- };
-
- var testResult = func(9, 11, 12);
-
- return testResult[0] === true && testResult[1] === true && testResult[2] === 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.map - This object is the Arguments object which + implements its own property get method (number of arguments is + greater than number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 9; + } else if (idx === 1) { + return val === 11; + } else if (idx === 2) { + return val === 12; + } else { + return false; + } + + } + + var func = function (a, b) { + return Array.prototype.map.call(arguments, callbackfn); + }; + + var testResult = func(9, 11, 12); + + return testResult[0] === true && testResult[1] === true && testResult[2] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-28.js index d67e0a3f0..a0460b377 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-28.js @@ -1,50 +1,52 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-28.js
- * @description Array.prototype.map - element changed by getter on previous iterations is observed on an Array
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var arr = [];
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 11;
- } else if (idx === 1) {
- return val === 9;
- } else {
- return false;
- }
- }
-
- Object.defineProperty(arr, "0", {
- get: function () {
- preIterVisible = true;
- return 11;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- if (preIterVisible) {
- return 9;
- } else {
- return 11;
- }
- },
- configurable: true
- });
-
- var testResult = arr.map(callbackfn);
-
- return testResult[0] === true && testResult[1] === 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.map - element changed by getter on previous + iterations is observed on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var arr = []; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 9; + } else { + return false; + } + } + + Object.defineProperty(arr, "0", { + get: function () { + preIterVisible = true; + return 11; + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + if (preIterVisible) { + return 9; + } else { + return 11; + } + }, + configurable: true + }); + + var testResult = arr.map(callbackfn); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-29.js index ee077355c..00ae71c91 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-29.js @@ -1,50 +1,52 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-29.js
- * @description Array.prototype.map - element changed by getter on previous iterations is observed on an Array-like object
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var obj = { length: 2 };
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 11;
- } else if (idx === 1) {
- return val === 9;
- } else {
- return false;
- }
- }
-
- Object.defineProperty(obj, "0", {
- get: function () {
- preIterVisible = true;
- return 11;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "1", {
- get: function () {
- if (preIterVisible) {
- return 9;
- } else {
- return 11;
- }
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[0] === true && testResult[1] === 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.map - element changed by getter on previous + iterations is observed on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var obj = { length: 2 }; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 9; + } else { + return false; + } + } + + Object.defineProperty(obj, "0", { + get: function () { + preIterVisible = true; + return 11; + }, + configurable: true + }); + + Object.defineProperty(obj, "1", { + get: function () { + if (preIterVisible) { + return 9; + } else { + return 11; + } + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-3.js index c1cab57fd..ec47bb2db 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-3.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.19/15.4.4.19-8-c-i-3.js
- * @description Array.prototype.map - element to be retrieved is own data property that overrides an inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 5) {
- return val === kValue;
- }
- return false;
- }
-
- var proto = { 5: 12, length: 10 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child[5] = kValue;
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult[5] === 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.map - element to be retrieved is own data property + that overrides an inherited data property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; + } + + var proto = { 5: 12, length: 10 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child[5] = kValue; + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult[5] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-30.js index b8e280792..872b3f22b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-30.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.19/15.4.4.19-8-c-i-30.js
- * @description Array.prototype.map - unhandled exceptions happened in getter terminate iteration on an Array-like object
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, 5: 10, 10: 8, length: 20 };
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- if (idx > 1) {
- accessed = true;
- }
- }
-
- Object.defineProperty(obj, "1", {
- get: function () {
- throw new RangeError("unhandle exception happened in getter");
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "2", {
- get: function () {
- accessed = true;
- return 100;
- },
- configurable: true
- });
-
- try {
- Array.prototype.map.call(obj, callbackfn);
- return false;
- } catch (ex) {
- return (ex instanceof RangeError) && !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.map - unhandled exceptions happened in getter + terminate iteration on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; + var accessed = false; + + function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + } + + Object.defineProperty(obj, "1", { + get: function () { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true + }); + + Object.defineProperty(obj, "2", { + get: function () { + accessed = true; + return 100; + }, + configurable: true + }); + + try { + Array.prototype.map.call(obj, callbackfn); + return false; + } catch (ex) { + return (ex instanceof RangeError) && !accessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-31.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-31.js index 81068dfdf..da8baf0b3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-31.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-31.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.19/15.4.4.19-8-c-i-31.js
- * @description Array.prototype.map - unhandled exceptions happened in getter terminate iteration on an Array
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- if (idx > 1) {
- accessed = true;
- }
- }
-
- var arr = [];
- arr[5] = 10;
- arr[10] = 100;
-
- Object.defineProperty(arr, "1", {
- get: function () {
- throw new RangeError("unhandle exception happened in getter");
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "2", {
- get: function () {
- accessed = true;
- return 100;
- },
- configurable: true
- });
-
- try {
- arr.map(callbackfn);
- return false;
- } catch (ex) {
- return (ex instanceof RangeError) && !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.map - unhandled exceptions happened in getter + terminate iteration on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + } + + var arr = []; + arr[5] = 10; + arr[10] = 100; + + Object.defineProperty(arr, "1", { + get: function () { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true + }); + + Object.defineProperty(arr, "2", { + get: function () { + accessed = true; + return 100; + }, + configurable: true + }); + + try { + arr.map(callbackfn); + return false; + } catch (ex) { + return (ex instanceof RangeError) && !accessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-4.js index 7994d2bb8..f83953e96 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-4.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.19/15.4.4.19-8-c-i-4.js
- * @description Array.prototype.map - element to be retrieved is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- try {
- Array.prototype[0] = 11;
-
- var testResult = [kValue].map(callbackfn);
-
- return testResult[0] === 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.map - element to be retrieved is own data property + that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + try { + Array.prototype[0] = 11; + + var testResult = [kValue].map(callbackfn); + + return testResult[0] === true; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-5.js index 13bb10f7b..137e9dc65 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-5.js @@ -1,46 +1,49 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-5.js
- * @description Array.prototype.map - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 5) {
- return val === kValue;
- }
- return false;
- }
-
- var proto = {};
-
- Object.defineProperty(proto, "5", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 10;
- Object.defineProperty(child, "5", {
- value: kValue,
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(child, callbackfn);
-
- return testResult[5] === 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.map - element to be retrieved is own data property + that overrides an inherited accessor property on an Array-like + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; + } + + var proto = {}; + + Object.defineProperty(proto, "5", { + get: function () { + return 11; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 10; + Object.defineProperty(child, "5", { + value: kValue, + configurable: true + }); + + var testResult = Array.prototype.map.call(child, callbackfn); + + return testResult[5] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-6.js index 78f4afd3c..615ddfa1f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-6.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.19/15.4.4.19-8-c-i-6.js
- * @description Array.prototype.map - element to be retrieved is own data property that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 9;
- },
- configurable: true
- });
-
- var testResult = [kValue].map(callbackfn);
- return testResult[0] === 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.map - element to be retrieved is own data property + that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 9; + }, + configurable: true + }); + + var testResult = [kValue].map(callbackfn); + return testResult[0] === true; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-7.js index 4f00964a7..520e91b3b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-7.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.19/15.4.4.19-8-c-i-7.js
- * @description Array.prototype.map - element to be retrieved is inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 5) {
- return val === kValue;
- }
- return false;
- }
-
- var proto = { 5: kValue, length: 10 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
-
- var newArr = Array.prototype.map.call(child, callbackfn);
-
- return newArr[5] === 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.map - element to be retrieved is inherited data + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 5) { + return val === kValue; + } + return false; + } + + var proto = { 5: kValue, length: 10 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + + var newArr = Array.prototype.map.call(child, callbackfn); + + return newArr[5] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-8.js index 2b6b46668..114a4e72e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-8.js @@ -1,30 +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.19/15.4.4.19-8-c-i-8.js
- * @description Array.prototype.map - element to be retrieved is inherited data property on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- return val === 13;
- }
- return false;
- }
-
- try {
- Array.prototype[1] = 13;
-
- var newArr = [, , , ].map(callbackfn);
-
- return newArr[1] === true;
- } 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.map - element to be retrieved is inherited data + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 13; + } + return false; + } + + try { + Array.prototype[1] = 13; + + var newArr = [, , , ].map(callbackfn); + + return newArr[1] === true; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-9.js index 796e6e541..736e11596 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-9.js @@ -1,36 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-9.js
- * @description Array.prototype.map - element to be retrieved is own accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = "abc";
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === kValue;
- }
- return false;
- }
-
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- return kValue;
- },
- configurable: true
- });
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[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.map - element to be retrieved is own accessor + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = "abc"; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === kValue; + } + return false; + } + + var obj = { length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + return kValue; + }, + configurable: true + }); + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-1.js index ed414f850..966511f3c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-1.js @@ -1,30 +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.19/15.4.4.19-8-c-ii-1.js
- * @description Array.prototype.map - callbackfn called with correct parameters
- */
-
-
-function testcase() {
-
- var bPar = true;
- var bCalled = false;
- function callbackfn(val, idx, obj)
- {
- bCalled = true;
- if(obj[idx] !== val)
- bPar = false;
- }
-
- var srcArr = [0,1,true,null,new Object(),"five"];
- srcArr[999999] = -6.6;
- resArr = srcArr.map(callbackfn);
-
- if(bCalled === true && bPar === true)
- 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.map - callbackfn called with correct parameters +includes: [runTestCase.js] +---*/ + +function testcase() { + + var bPar = true; + var bCalled = false; + function callbackfn(val, idx, obj) + { + bCalled = true; + if(obj[idx] !== val) + bPar = false; + } + + var srcArr = [0,1,true,null,new Object(),"five"]; + srcArr[999999] = -6.6; + resArr = srcArr.map(callbackfn); + + if(bCalled === true && bPar === true) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-10.js index bfaddec68..7f0a154bc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-10.js @@ -1,22 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-10.js
- * @description Array.prototype.map - callbackfn is called with 1 formal parameter
- */
-
-
-function testcase() {
-
- function callbackfn(val) {
- return val > 10;
- }
-
- var testResult = [11].map(callbackfn);
-
- return testResult[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.map - callbackfn is called with 1 formal parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val) { + return val > 10; + } + + var testResult = [11].map(callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-11.js index a39bcc3b8..8d6e1d612 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-11.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.19/15.4.4.19-8-c-ii-11.js
- * @description Array.prototype.map - callbackfn is called with 2 formal parameters
- */
-
-
-function testcase() {
- function callbackfn(val, idx) {
- return (val > 10 && arguments[2][idx] === val);
- }
-
- var testResult = [11].map(callbackfn);
-
- return testResult[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.map - callbackfn is called with 2 formal parameters +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx) { + return (val > 10 && arguments[2][idx] === val); + } + + var testResult = [11].map(callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-12.js index c5ea2da22..1412f2cb2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-12.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.19/15.4.4.19-8-c-ii-12.js
- * @description Array.prototype.map - callbackfn is called with 3 formal parameters
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return (val > 10 && obj[idx] === val);
- }
-
- var testResult = [11].map(callbackfn);
-
- return testResult[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.map - callbackfn is called with 3 formal parameters +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return (val > 10 && obj[idx] === val); + } + + var testResult = [11].map(callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-13.js index b66463f99..ae614ed83 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-13.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.19/15.4.4.19-8-c-ii-13.js
- * @description Array.prototype.map - callbackfn that uses arguments object to get parameter value
- */
-
-
-function testcase() {
-
- function callbackfn() {
- return arguments[2][arguments[1]] === arguments[0];
- }
-
- var testResult = [11].map(callbackfn);
-
- return testResult[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.map - callbackfn that uses arguments object to get + parameter value +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn() { + return arguments[2][arguments[1]] === arguments[0]; + } + + var testResult = [11].map(callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-16.js index 6c315797d..6684948fb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-16.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.19/15.4.4.19-8-c-ii-16.js
- * @description Array.prototype.map - 'this' object when T is not an object (T is a boolean primitive)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.valueOf() === false;
- }
-
- var obj = { 0: 11, length: 2 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn, false);
-
- return testResult[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.map - 'this' object when T is not an object (T is + a boolean primitive) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.valueOf() === false; + } + + var obj = { 0: 11, length: 2 }; + + var testResult = Array.prototype.map.call(obj, callbackfn, false); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-17.js index bbb97698f..ecdf28f42 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-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.19/15.4.4.19-8-c-ii-17.js
- * @description Array.prototype.map - 'this' object when T is not an object (T is a number)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.valueOf() === 5;
- }
-
- var obj = { 0: 11, length: 2 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn, 5);
-
- return testResult[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.map - 'this' object when T is not an object (T is + a number) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.valueOf() === 5; + } + + var obj = { 0: 11, length: 2 }; + + var testResult = Array.prototype.map.call(obj, callbackfn, 5); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-18.js index 045b9bb98..e75a09eab 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-18.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.19/15.4.4.19-8-c-ii-18.js
- * @description Array.prototype.map - 'this' object when T is not an object (T is a string primitive)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.valueOf() === "hello!";
- }
-
- var obj = { 0: 11, length: 2 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn, "hello!");
-
- return testResult[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.map - 'this' object when T is not an object (T is + a string primitive) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.valueOf() === "hello!"; + } + + var obj = { 0: 11, length: 2 }; + + var testResult = Array.prototype.map.call(obj, callbackfn, "hello!"); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-19.js index fed11c63f..4f4234432 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-19.js @@ -1,31 +1,31 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-19.js
- * @description Array.prototype.map - non-indexed properties are not called.
- */
-
-
-function testcase() {
-
- var called = 0;
- var result = false;
-
- function callbackfn(val, idx, obj) {
- called++;
- if (val === 11) {
- result = true;
- }
- return true;
- }
-
- var obj = { 0: 9, non_index_property: 11, length: 20 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return !result && testResult[0] === true && called === 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.map - non-indexed properties are not called. +includes: [runTestCase.js] +---*/ + +function testcase() { + + var called = 0; + var result = false; + + function callbackfn(val, idx, obj) { + called++; + if (val === 11) { + result = true; + } + return true; + } + + var obj = { 0: 9, non_index_property: 11, length: 20 }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return !result && testResult[0] === true && called === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-2.js index c9dabd69d..f8444d029 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-2.js @@ -1,30 +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.19/15.4.4.19-8-c-ii-2.js
- * @description Array.prototype.map - callbackfn takes 3 arguments
- */
-
-
-function testcase() {
-
- var parCnt = 3;
- var bCalled = false
- function callbackfn(val, idx, obj)
- {
- bCalled = true;
- if(arguments.length !== 3)
- parCnt = arguments.length; //verify if callbackfn was called with 3 parameters
- }
-
- var srcArr = [0,1,2,3,4,5,6,7,8,9];
- var resArr = srcArr.map(callbackfn);
- if(bCalled === true && parCnt === 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.map - callbackfn takes 3 arguments +includes: [runTestCase.js] +---*/ + +function testcase() { + + var parCnt = 3; + var bCalled = false + function callbackfn(val, idx, obj) + { + bCalled = true; + if(arguments.length !== 3) + parCnt = arguments.length; //verify if callbackfn was called with 3 parameters + } + + var srcArr = [0,1,2,3,4,5,6,7,8,9]; + var resArr = srcArr.map(callbackfn); + if(bCalled === true && parCnt === 3) + return true; + + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-20.js index b1688283d..b1dbfaef1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-20.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.19/15.4.4.19-8-c-ii-20.js
- * @description Array.prototype.map - callbackfn called with correct parameters (thisArg is correct)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.threshold === 10;
- }
-
- var thisArg = { threshold: 10 };
-
- var obj = { 0: 11, 1: 9, length: 2 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn, thisArg);
-
- return testResult[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.map - callbackfn called with correct parameters + (thisArg is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.threshold === 10; + } + + var thisArg = { threshold: 10 }; + + var obj = { 0: 11, 1: 9, length: 2 }; + + var testResult = Array.prototype.map.call(obj, callbackfn, thisArg); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-21.js index 93a6fbe20..dd09278c9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-21.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.19/15.4.4.19-8-c-ii-21.js
- * @description Array.prototype.map - callbackfn called with correct parameters (kValue is correct)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 11;
- }
-
- if (idx === 1) {
- return val === 12;
- }
-
- return false;
- }
-
- var obj = { 0: 11, 1: 12, length: 2 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[0] === true && testResult[1] === 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.map - callbackfn called with correct parameters + (kValue is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } + + if (idx === 1) { + return val === 12; + } + + return false; + } + + var obj = { 0: 11, 1: 12, length: 2 }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-22.js index 1505e5f08..a827cc53b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-22.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.19/15.4.4.19-8-c-ii-22.js
- * @description Array.prototype.map - callbackfn called with correct parameters (the index k is correct)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (val === 11) {
- return idx === 0;
- }
-
- if (val === 12) {
- return idx === 1;
- }
-
- return false;
- }
-
- var obj = { 0: 11, 1: 12, length: 2 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[0] === true && testResult[1] === 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.map - callbackfn called with correct parameters + (the index k is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (val === 11) { + return idx === 0; + } + + if (val === 12) { + return idx === 1; + } + + return false; + } + + var obj = { 0: 11, 1: 12, length: 2 }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true && testResult[1] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-23.js index ab87c8715..0de7f9e64 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-23.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.19/15.4.4.19-8-c-ii-23.js
- * @description Array.prototype.map - callbackfn called with correct parameters (this object O is correct)
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, length: 2 };
-
- function callbackfn(val, idx, o) {
- return obj === o;
- }
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[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.map - callbackfn called with correct parameters + (this object O is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, length: 2 }; + + function callbackfn(val, idx, o) { + return obj === o; + } + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-4.js index 5e512111a..1032ef7d6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-4.js @@ -1,30 +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.19/15.4.4.19-8-c-ii-4.js
- * @description Array.prototype.map - k values are passed in acending numeric order
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2, 3, 4, 5];
- var lastIdx = 0;
- var called = 0;
- var result = true;
- function callbackfn(val, idx, o) {
- called++;
- if (lastIdx !== idx) {
- result = false;
- } else {
- lastIdx++;
- }
- }
-
- arr.map(callbackfn);
- return result && arr.length === called;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.map - k values are passed in acending numeric order +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2, 3, 4, 5]; + var lastIdx = 0; + var called = 0; + var result = true; + function callbackfn(val, idx, o) { + called++; + if (lastIdx !== idx) { + result = false; + } else { + lastIdx++; + } + } + + arr.map(callbackfn); + return result && arr.length === called; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-5.js index c37394d4e..13acf9006 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-5.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.19/15.4.4.19-8-c-ii-5.js
- * @description Array.prototype.map - k values are accessed during each iteration and not prior to starting the loop.
- */
-
-
-function testcase() {
-
- var kIndex = [];
-
- //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time.
- function callbackfn(val, idx, obj) {
- //Each position should be visited one time, which means k is accessed one time during iterations.
- if (typeof kIndex[idx] === "undefined") {
- //when current position is visited, its previous index should has been visited.
- if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") {
- return true;
- }
- kIndex[idx] = 1;
- return false;
- } else {
- return true;
- }
- }
-
- var testResult = [11, 12, 13, 14].map(callbackfn);
-
- return testResult.length === 4 && testResult[0] === false &&
- testResult[1] === false && testResult[2] === false &&
- testResult[3] === 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.map - k values are accessed during each iteration + and not prior to starting the loop. +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kIndex = []; + + //By below way, we could verify that k would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. + function callbackfn(val, idx, obj) { + //Each position should be visited one time, which means k is accessed one time during iterations. + if (typeof kIndex[idx] === "undefined") { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && typeof kIndex[idx - 1] === "undefined") { + return true; + } + kIndex[idx] = 1; + return false; + } else { + return true; + } + } + + var testResult = [11, 12, 13, 14].map(callbackfn); + + return testResult.length === 4 && testResult[0] === false && + testResult[1] === false && testResult[2] === false && + testResult[3] === false; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-6.js index e3378b640..60fc22c43 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-6.js @@ -1,28 +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.19/15.4.4.19-8-c-ii-6.js
- * @description Array.prototype.map - arguments to callbackfn are self consistent.
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, length: 1 };
- var thisArg = {};
-
- function callbackfn() {
- return this === thisArg &&
- arguments[0] === 11 &&
- arguments[1] === 0 &&
- arguments[2] === obj;
- }
-
- var testResult = Array.prototype.map.call(obj, callbackfn, thisArg);
-
- return testResult[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.map - arguments to callbackfn are self consistent. +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, length: 1 }; + var thisArg = {}; + + function callbackfn() { + return this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj; + } + + var testResult = Array.prototype.map.call(obj, callbackfn, thisArg); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-7.js index a0bffca6b..ff8c60922 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-7.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.19/15.4.4.19-8-c-ii-7.js
- * @description Array.prototype.map - unhandled exceptions happened in callbackfn terminate iteration
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- if (idx > 0) {
- accessed = true;
- }
- if (idx === 0) {
- throw new Error("Exception occurred in callbackfn");
- }
- }
-
- var obj = { 0: 11, 4: 10, 10: 8, length: 20 };
-
- try {
- Array.prototype.map.call(obj, callbackfn);
- return false;
- } catch (ex) {
- return ex instanceof Error && !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.map - unhandled exceptions happened in callbackfn + terminate iteration +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + if (idx > 0) { + accessed = true; + } + if (idx === 0) { + throw new Error("Exception occurred in callbackfn"); + } + } + + var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; + + try { + Array.prototype.map.call(obj, callbackfn); + return false; + } catch (ex) { + return ex instanceof Error && !accessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-8.js index ab4c90fc6..d7a6b851e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-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.19/15.4.4.19-8-c-ii-8.js
- * @description Array.prototype.map - element changed by callbackfn on previous iterations is observed
- */
-
-
-function testcase() {
-
- var obj = { 0: 9, 1: 12, length: 2 };
-
- function callbackfn(val, idx, o) {
- if (idx === 0) {
- obj[idx + 1] = 8;
- }
- return val > 10;
- }
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult[1] === 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.map - element changed by callbackfn on previous + iterations is observed +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 9, 1: 12, length: 2 }; + + function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } + return val > 10; + } + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult[1] === false; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-9.js index 745ea3f56..ef70b5825 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-ii-9.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.19/15.4.4.19-8-c-ii-9.js
- * @description Array.prototype.map - callbackfn with 0 formal parameter
- */
-
-
-function testcase() {
-
- function callbackfn() {
- return true;
- }
-
- var testResult = [11].map(callbackfn);
-
- return testResult[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.map - callbackfn with 0 formal parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn() { + return true; + } + + var testResult = [11].map(callbackfn); + + return testResult[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-1.js index 491130bca..bca75fcfd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-1.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.19/15.4.4.19-8-c-iii-1.js
- * @description Array.prototype.map - getOwnPropertyDescriptor(all true) of returned array element
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj){
- if(val % 2)
- return (2 * val + 1);
- else
- return (val / 2);
- }
- var srcArr = [0,1,2,3,4];
- var resArr = srcArr.map(callbackfn);
- if (resArr.length > 0){
- var desc = Object.getOwnPropertyDescriptor(resArr, 1)
- if(desc.value === 3 && //srcArr[1] = 2*1+1 = 3
- desc.writable === true &&
- desc.enumerable === true &&
- desc.configurable === true){
- 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.map - getOwnPropertyDescriptor(all true) of + returned array element +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj){ + if(val % 2) + return (2 * val + 1); + else + return (val / 2); + } + var srcArr = [0,1,2,3,4]; + var resArr = srcArr.map(callbackfn); + if (resArr.length > 0){ + var desc = Object.getOwnPropertyDescriptor(resArr, 1) + if(desc.value === 3 && //srcArr[1] = 2*1+1 = 3 + desc.writable === true && + desc.enumerable === true && + desc.configurable === true){ + return true; + } + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-2.js index c9a22395c..01dcb7a26 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-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.19/15.4.4.19-8-c-iii-2.js
- * @description Array.prototype.map - value of returned array element equals to 'mappedValue'
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val;
- }
-
- var obj = { 0: 11, 1: 9, length: 2 };
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- return newArr[0] === obj[0] && newArr[1] === obj[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.map - value of returned array element equals to + 'mappedValue' +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val; + } + + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.map.call(obj, callbackfn); + + return newArr[0] === obj[0] && newArr[1] === obj[1]; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-3.js index 4d7edbc9a..6850fd361 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-3.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.19/15.4.4.19-8-c-iii-3.js
- * @description Array.prototype.map - value of returned array element can be overwritten
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 11;
- }
-
- var obj = { 0: 11, 1: 9, length: 2 };
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- try {
- var tempVal = newArr[1];
- newArr[1] += 1;
- return newArr[1] !== tempVal;
- } 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.map - value of returned array element can be + overwritten +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 11; + } + + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.map.call(obj, callbackfn); + + try { + var tempVal = newArr[1]; + newArr[1] += 1; + return newArr[1] !== tempVal; + } catch (ex) { + return false; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-4.js index dffbb011f..c5d4c8753 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-4.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.19/15.4.4.19-8-c-iii-4.js
- * @description Array.prototype.map - value of returned array element can be enumerated
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, length: 2 };
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- var prop;
- var enumerable = false;
- for (prop in newArr) {
- if (newArr.hasOwnProperty(prop)) {
- if (prop === "0") {
- enumerable = true;
- }
- }
- }
-
- return enumerable;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map - value of returned array element can be + enumerated +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.map.call(obj, callbackfn); + + var prop; + var enumerable = false; + for (prop in newArr) { + if (newArr.hasOwnProperty(prop)) { + if (prop === "0") { + enumerable = true; + } + } + } + + return enumerable; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-5.js index 254249f0f..987a7406b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-iii-5.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.19/15.4.4.19-8-c-iii-5.js
- * @description Array.prototype.map - value of returned array element can be changed or deleted
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, 1: 9, length: 2 };
- var newArr = Array.prototype.map.call(obj, callbackfn);
-
- try {
- var tempVal = newArr[1];
- delete newArr[1];
- return tempVal !== undefined && newArr[1] === undefined;
- } 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.map - value of returned array element can be + changed or deleted +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.map.call(obj, callbackfn); + + try { + var tempVal = newArr[1]; + delete newArr[1]; + return tempVal !== undefined && newArr[1] === undefined; + } catch (ex) { + return false; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-1.js index 66ca32101..205ccc630 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-1.js @@ -1,30 +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.19/15.4.4.19-9-1.js
- * @description Array.prototype.map doesn't mutate the Array on which it is called on
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- return true;
- }
- var srcArr = [1,2,3,4,5];
- srcArr.map(callbackfn);
- if(srcArr[0] === 1 &&
- srcArr[1] === 2 &&
- srcArr[2] === 3 &&
- srcArr[3] === 4 &&
- srcArr[4] === 5)
- {
- 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.map doesn't mutate the Array on which it is called + on +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + return true; + } + var srcArr = [1,2,3,4,5]; + srcArr.map(callbackfn); + if(srcArr[0] === 1 && + srcArr[1] === 2 && + srcArr[2] === 3 && + srcArr[3] === 4 && + srcArr[4] === 5) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-10.js index c7c13cb00..b1f4c66e5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-10.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.19/15.4.4.19-9-10.js
- * @description Array.prototype.map - empty array to be returned if 'length' is 0 (subclassed Array, length overridden with obj with valueOf)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return val > 10;
- }
-
- var Foo = function () { };
- Foo.prototype = [1, 2, 3];
- var obj = new Foo();
- obj.length = {
- valueOf: function () {
- return 0;
- }
- };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult.length === 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.map - empty array to be returned if 'length' is 0 + (subclassed Array, length overridden with obj with valueOf) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; + } + + var Foo = function () { }; + Foo.prototype = [1, 2, 3]; + var obj = new Foo(); + obj.length = { + valueOf: function () { + return 0; + } + }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-11.js index d7ae2792b..eb750fe4b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-11.js @@ -1,38 +1,41 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-11.js
- * @description Array.prototype.map - returns an empty array if 'length' is 0 (subclassed Array, length overridden with obj w/o valueOf (toString))
- */
-
-
-function testcase() {
- function Foo() { }
- Foo.prototype = [1, 2, 3];
-
- 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.
-
- function cb() { }
- var a = Array.prototype.map.call(f, cb);
-
- if (Array.isArray(a) && a.length === 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.map - returns an empty array if 'length' is 0 + (subclassed Array, length overridden with obj w/o valueOf + (toString)) +includes: [runTestCase.js] +---*/ + +function testcase() { + function Foo() { } + Foo.prototype = [1, 2, 3]; + + 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. + + function cb() { } + var a = Array.prototype.map.call(f, cb); + + if (Array.isArray(a) && a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-12.js index 3c2c1549e..005988348 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-12.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.19/15.4.4.19-9-12.js
- * @description Array.prototype.map - returns an empty array if 'length' is 0 (subclassed Array, length overridden with [])
- */
-
-
-function testcase() {
- function Foo() { }
- Foo.prototype = [1, 2, 3];
- var f = new Foo();
-
- f.length = [];
-
- // 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.
-
- function cb() { }
- var a = Array.prototype.map.call(f, cb);
-
- if (Array.isArray(a) && a.length === 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.map - returns an empty array if 'length' is 0 + (subclassed Array, length overridden with []) +includes: [runTestCase.js] +---*/ + +function testcase() { + function Foo() { } + Foo.prototype = [1, 2, 3]; + var f = new Foo(); + + f.length = []; + + // 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. + + function cb() { } + var a = Array.prototype.map.call(f, cb); + + if (Array.isArray(a) && a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-13.js index 61295822b..aa760e4f1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-13.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.19/15.4.4.19-9-13.js
- * @description Array.prototype.map - if there are no side effects of the functions, O is unmodified
- */
-
-
-function testcase() {
-
- var called = 0;
-
- function callbackfn(val, idx, obj) {
- called++;
- return val > 2;
- }
-
- var arr = [1, 2, 3, 4];
-
- arr.map(callbackfn);
-
- return 1 === arr[0] && 2 === arr[1] && 3 === arr[2] && 4 === arr[3] && 4 === called;
-
-
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.map - if there are no side effects of the + functions, O is unmodified +includes: [runTestCase.js] +---*/ + +function testcase() { + + var called = 0; + + function callbackfn(val, idx, obj) { + called++; + return val > 2; + } + + var arr = [1, 2, 3, 4]; + + arr.map(callbackfn); + + return 1 === arr[0] && 2 === arr[1] && 3 === arr[2] && 4 === arr[3] && 4 === called; + + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-2.js index dbec9daae..122554182 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-2.js @@ -1,30 +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.19/15.4.4.19-9-2.js
- * @description Array.prototype.map returns new Array with same number of elements and values the result of callbackfn
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- return val + 10;
- }
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.map(callbackfn);
- if(resArr[0] === 11 &&
- resArr[1] === 12 &&
- resArr[2] === 13 &&
- resArr[3] === 14 &&
- resArr[4] === 15)
- {
- 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.map returns new Array with same number of elements + and values the result of callbackfn +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + return val + 10; + } + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.map(callbackfn); + if(resArr[0] === 11 && + resArr[1] === 12 && + resArr[2] === 13 && + resArr[3] === 14 && + resArr[4] === 15) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-3.js index e187329f7..8a3b274a8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-3.js @@ -1,26 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-3.js
- * @description Array.prototype.map - subclassed array when length is reduced
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = 1;
-
- function cb(){}
- var a = f.map(cb);
-
- if (Array.isArray(a) &&
- a.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.map - subclassed array when length is reduced +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = 1; + + function cb(){} + var a = f.map(cb); + + if (Array.isArray(a) && + a.length === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-4.js index 1fbf80b26..201a709ee 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-4.js @@ -1,30 +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.19/15.4.4.19-9-4.js
- * @description Array.prototype.map doesn't visit expandos
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- callCnt++;
- }
- var srcArr = [1,2,3,4,5];
- srcArr["i"] = 10;
- srcArr[true] = 11;
-
- var resArr = srcArr.map(callbackfn);
- if(callCnt == 5)
- {
- 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.map doesn't visit expandos +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + } + var srcArr = [1,2,3,4,5]; + srcArr["i"] = 10; + srcArr[true] = 11; + + var resArr = srcArr.map(callbackfn); + if(callCnt == 5) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-5.js index 2d6641aa4..9268e2c49 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-5.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.19/15.4.4.19-9-5.js
- * @description Array.prototype.map - empty array to be returned if 'length' is 0 (empty array)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var obj = { 0: 9, 1: 8, length: 0 };
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
-
- return testResult.length === 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.map - empty array to be returned if 'length' is 0 + (empty array) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var obj = { 0: 9, 1: 8, length: 0 }; + + var testResult = Array.prototype.map.call(obj, callbackfn); + + return testResult.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-6.js index 0673b91e6..fbdd987c9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-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.19/15.4.4.19-9-6.js
- * @description Array.prototype.map - empty array to be returned if 'length' is 0 (subclassed Array, length overridden to null (type conversion))
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10;
- }
-
- var Foo = function () { };
- Foo.prototype = [1, 2, 3];
- var obj = new Foo();
- obj.length = null;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult.length === 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.map - empty array to be returned if 'length' is 0 + (subclassed Array, length overridden to null (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10; + } + + var Foo = function () { }; + Foo.prototype = [1, 2, 3]; + var obj = new Foo(); + obj.length = null; + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-7.js index b9c0d86d2..105e68193 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-7.js @@ -1,30 +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.19/15.4.4.19-9-7.js
- * @description Array.prototype.map - empty array to be returned if 'length' is 0 (subclassed Array, length overridden to false (type conversion))
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return val > 10;
- }
-
- var Foo = function () { };
- Foo.prototype = [1, 2, 3];
- var obj = new Foo();
- obj.length = false;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult.length === 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.map - empty array to be returned if 'length' is 0 + (subclassed Array, length overridden to false (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; + } + + var Foo = function () { }; + Foo.prototype = [1, 2, 3]; + var obj = new Foo(); + obj.length = false; + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult.length === 0; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-8.js index d5e85b719..9d0d85f98 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-8.js @@ -1,30 +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.19/15.4.4.19-9-8.js
- * @description Array.prototype.map - empty array to be returned if 'length' is 0 (subclassed Array, length overridden to 0 (type conversion))
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return val > 10;
- }
-
- var Foo = function () { };
- Foo.prototype = [1, 2, 3];
- var obj = new Foo();
- obj.length = 0;
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult.length === 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.map - empty array to be returned if 'length' is 0 + (subclassed Array, length overridden to 0 (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; + } + + var Foo = function () { }; + Foo.prototype = [1, 2, 3]; + var obj = new Foo(); + obj.length = 0; + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult.length === 0; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-9.js index 673462058..c851ffd7b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-9-9.js @@ -1,30 +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.19/15.4.4.19-9-9.js
- * @description Array.prototype.map - empty array to be returned if 'length' is 0 (subclassed Array, length overridden to '0' (type conversion))
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return val > 10;
- }
-
- var Foo = function () { };
- Foo.prototype = [1, 2, 3];
- var obj = new Foo();
- obj.length = '0';
-
- var testResult = Array.prototype.map.call(obj, callbackfn);
- return testResult.length === 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.map - empty array to be returned if 'length' is 0 + (subclassed Array, length overridden to '0' (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; + } + + var Foo = function () { }; + Foo.prototype = [1, 2, 3]; + var obj = new Foo(); + obj.length = '0'; + + var testResult = Array.prototype.map.call(obj, callbackfn); + return testResult.length === 0; + + } +runTestCase(testcase); |