diff options
Diffstat (limited to 'test/suite/ch15/15.4/15.4.4/15.4.4.18')
188 files changed, 5977 insertions, 5700 deletions
diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-0-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-0-1.js index aaace70cd..9e159e691 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-0-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-0-1.js
- * @description Array.prototype.forEach must exist as a function
- */
-
-
-function testcase() {
- var f = Array.prototype.forEach;
- 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.forEach must exist as a function +includes: [runTestCase.js] +---*/ + +function testcase() { + var f = Array.prototype.forEach; + if (typeof(f) === "function") { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-0-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-0-2.js index 0eb353f2b..4999b2b6b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-0-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-0-2.js
- * @description Array.prototype.forEach.length must be 1
- */
-
-
-function testcase() {
- if (Array.prototype.forEach.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.forEach.length must be 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + if (Array.prototype.forEach.length === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-1.js index 286dbc412..12fdda9df 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-1.js
- * @description Array.prototype.forEach applied to undefined
- */
-
-
-function testcase() {
- try {
- Array.prototype.forEach.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.forEach applied to undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.forEach.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.18/15.4.4.18-1-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-10.js index b41760d9a..4913c0072 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-10.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.18/15.4.4.18-1-10.js
- * @description Array.prototype.forEach applied to the Math object
- */
-
-
-function testcase() {
- var result = false;
-
- function callbackfn(val, idx, obj) {
- result = ('[object Math]' === Object.prototype.toString.call(obj));
- }
-
- try {
- Math.length = 1;
- Math[0] = 1;
- Array.prototype.forEach.call(Math, callbackfn);
- return result;
- } 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.forEach applied to the Math object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + + function callbackfn(val, idx, obj) { + result = ('[object Math]' === Object.prototype.toString.call(obj)); + } + + try { + Math.length = 1; + Math[0] = 1; + Array.prototype.forEach.call(Math, callbackfn); + return result; + } finally { + delete Math[0]; + delete Math.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-11.js index e069be276..6cba63c14 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-11.js
- * @description Array.prototype.forEach applied to Date object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof Date;
- }
-
- var obj = new Date();
- obj.length = 1;
- obj[0] = 1;
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to Date object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof Date; + } + + var obj = new Date(); + obj.length = 1; + obj[0] = 1; + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-12.js index dab1e0f2b..2f8dd72b7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-12.js
- * @description Array.prototype.forEach applied to RegExp object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof RegExp;
- }
-
- var obj = new RegExp();
- obj.length = 1;
- obj[0] = 1;
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to RegExp object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof RegExp; + } + + var obj = new RegExp(); + obj.length = 1; + obj[0] = 1; + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-13.js index 65b6847d7..b08446a0f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-13.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.18/15.4.4.18-1-13.js
- * @description Array.prototype.forEach applied to the JSON object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = ('[object JSON]' === Object.prototype.toString.call(obj));
- }
-
- try {
- JSON.length = 1;
- JSON[0] = 1;
- Array.prototype.forEach.call(JSON, callbackfn);
- return result;
- } 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.forEach applied to the JSON object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = ('[object JSON]' === Object.prototype.toString.call(obj)); + } + + try { + JSON.length = 1; + JSON[0] = 1; + Array.prototype.forEach.call(JSON, callbackfn); + return result; + } finally { + delete JSON.length; + delete JSON[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-14.js index fd042c85f..39e4f9790 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-14.js
- * @description Array.prototype.forEach applied to Error object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof Error;
- }
-
- var obj = new Error();
- obj.length = 1;
- obj[0] = 1;
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to Error object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof Error; + } + + var obj = new Error(); + obj.length = 1; + obj[0] = 1; + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-15.js index ed5ac1271..93763ee79 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-15.js
- * @description Array.prototype.forEach applied to the Arguments object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = ('[object Arguments]' === Object.prototype.toString.call(obj));
- }
-
- var obj = (function () {
- return arguments;
- }("a", "b"));
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to the Arguments object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = ('[object Arguments]' === Object.prototype.toString.call(obj)); + } + + var obj = (function () { + return arguments; + }("a", "b")); + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-2.js index e12c85e94..88962fce5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-2.js
- * @description Array.prototype.forEach applied to null
- */
-
-
-function testcase() {
- try {
- Array.prototype.forEach.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.forEach applied to null +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.forEach.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.18/15.4.4.18-1-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-3.js index 3acafbedf..0eed4fa8d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-3.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.18/15.4.4.18-1-3.js
- * @description Array.prototype.forEach applied to boolean primitive
- */
-
-
-function testcase() {
- var result = false;
-
- function callbackfn(val, idx, obj) {
- result = obj instanceof Boolean;
- }
-
- try {
- Boolean.prototype[0] = true;
- Boolean.prototype.length = 1;
-
- Array.prototype.forEach.call(false, callbackfn);
- return result;
-
- } 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.forEach applied to boolean primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + + function callbackfn(val, idx, obj) { + result = obj instanceof Boolean; + } + + try { + Boolean.prototype[0] = true; + Boolean.prototype.length = 1; + + Array.prototype.forEach.call(false, callbackfn); + return result; + + } 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.18/15.4.4.18-1-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-4.js index b8b20f5c2..c316d4e72 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-4.js
- * @description Array.prototype.forEach applied to Boolean object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof Boolean;
- }
-
- var obj = new Boolean(true);
- obj.length = 2;
- obj[0] = 11;
- obj[1] = 12;
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to Boolean object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof Boolean; + } + + var obj = new Boolean(true); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-5.js index 277082584..88c22670a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-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.18/15.4.4.18-1-5.js
- * @description Array.prototype.forEach applied to number primitive
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof Number;
- }
-
- try {
- Number.prototype[0] = 1;
- Number.prototype.length = 1;
-
- Array.prototype.forEach.call(2.5, callbackfn);
- return result;
- } 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.forEach applied to number primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof Number; + } + + try { + Number.prototype[0] = 1; + Number.prototype.length = 1; + + Array.prototype.forEach.call(2.5, callbackfn); + return result; + } 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.18/15.4.4.18-1-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-6.js index 0e2113ef4..d4fc10657 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-6.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.18/15.4.4.18-1-6.js
- * @description Array.prototype.forEach applied to Number object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof Number;
- }
-
- var obj = new Number(-128);
- obj.length = 2;
- obj[0] = 11;
- obj[1] = 12;
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to Number object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof Number; + } + + var obj = new Number(-128); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; + + Array.prototype.forEach.call(obj, callbackfn); + + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-7.js index 5a71e0fd9..55e9dac91 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-7.js
- * @description Array.prototype.forEach applied to string primitive
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof String;
- }
-
- Array.prototype.forEach.call("abc", callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to string primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof String; + } + + Array.prototype.forEach.call("abc", callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-8.js index 3264dd569..c509fa091 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-8.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.18/15.4.4.18-1-8.js
- * @description Array.prototype.forEach applied to String object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof String;
- }
-
- var obj = new String("abc");
- Array.prototype.forEach.call(obj, callbackfn);
-
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to String object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof String; + } + + var obj = new String("abc"); + Array.prototype.forEach.call(obj, callbackfn); + + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-9.js index c5111a8de..69a2cbc43 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-1-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-1-9.js
- * @description Array.prototype.forEach applied to Function object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = obj instanceof Function;
- }
-
- var obj = function (a, b) {
- return a + b;
- };
- obj[0] = 11;
- obj[1] = 9;
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach applied to Function object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = obj instanceof Function; + } + + var obj = function (a, b) { + return a + b; + }; + obj[0] = 11; + obj[1] = 9; + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-1.js index bc2f65321..32c19ff63 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-1.js
- * @description Array.prototype.forEach - 'length' is own data property on an Array-like object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- var obj = {
- 0: 12,
- 1: 11,
- 2: 9,
- length: 2
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is own data property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 + }; + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-10.js index a7c2799ac..24b41e749 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-10.js
- * @description Array.prototype.forEach applied to Array-like object, 'length' is an inherited accessor property
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- 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;
-
- Array.prototype.forEach.call(child, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to Array-like object, 'length' is + an inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + 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; + + Array.prototype.forEach.call(child, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-11.js index a5bf38f41..e1499b3d3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-11.js
- * @description Array.prototype.forEach applied to Array-like object, 'length' is an own accessor property without a get function
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = {
- 0: 11,
- 1: 12
- };
- Object.defineProperty(obj, "length", {
- set: function () { },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
- return !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.forEach applied to Array-like object, 'length' is + an own accessor property without a get function +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { + 0: 11, + 1: 12 + }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-12.js index b5cfa8e5b..35f61584e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-12.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.18/15.4.4.18-2-12.js
- * @description Array.prototype.forEach - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- 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
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
- return !accessed;
- } 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.forEach - 'length' is own accessor property + without a get function that overrides an inherited accessor + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + } + + 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 + }); + + Array.prototype.forEach.call(obj, callbackfn); + return !accessed; + } finally { + delete Object.prototype.length; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-13.js index 912637473..4525ee470 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-13.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.18/15.4.4.18-2-13.js
- * @description Array.prototype.forEach applied to the Array-like object that 'length' is inherited accessor property without a get function
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- 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;
-
- Array.prototype.forEach.call(child, callbackfn);
- return !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.forEach applied to the Array-like object that + 'length' is inherited accessor property without a get function +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + 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; + + Array.prototype.forEach.call(child, callbackfn); + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-14.js index 3e49e8964..70d3aec14 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-14.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.18/15.4.4.18-2-14.js
- * @description Array.prototype.forEach applied to the Array-like object that 'length' property doesn't exist
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 11, 1: 12 };
-
- Array.prototype.forEach.call(obj, callbackfn);
- return !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.forEach applied to the Array-like object that + 'length' property doesn't exist +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 11, 1: 12 }; + + Array.prototype.forEach.call(obj, callbackfn); + return !accessed; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-15.js index cf0c62867..a8c5a53c8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-15.js @@ -1,33 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-15.js
- * @description Array.prototype.forEach - 'length' is property of the global object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[0] = 12;
- fnGlobalObject()[1] = 11;
- fnGlobalObject()[2] = 9;
- fnGlobalObject().length = 2;
- Array.prototype.forEach.call(fnGlobalObject(), callbackfn);
- return result;
- } 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.forEach - 'length' is property of the global object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[0] = 12; + fnGlobalObject()[1] = 11; + fnGlobalObject()[2] = 9; + fnGlobalObject().length = 2; + Array.prototype.forEach.call(fnGlobalObject(), callbackfn); + return result; + } 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.18/15.4.4.18-2-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-17.js index 052d84dc2..78f033a96 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-17.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-17.js
- * @description Array.prototype.forEach applied to the Arguments object, which implements its own property get method
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- var func = function (a, b) {
- arguments[2] = 9;
- Array.prototype.forEach.call(arguments, callbackfn);
- return result;
- };
-
- return func(12, 11);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to the Arguments object, which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + var func = function (a, b) { + arguments[2] = 9; + Array.prototype.forEach.call(arguments, callbackfn); + return result; + }; + + return func(12, 11); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-18.js index 9e879953c..4be359934 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-18.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-18.js
- * @description Array.prototype.forEach applied to String object, which implements its own property get method
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 3);
- }
-
- var str = new String("012");
-
- Array.prototype.forEach.call(str, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to String object, which implements + its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 3); + } + + var str = new String("012"); + + Array.prototype.forEach.call(str, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-19.js index 91a7c1933..47aaac2f8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-19.js
- * @description Array.prototype.forEach applied to Function object, which implements its own property get method
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- var fun = function (a, b) {
- return a + b;
- };
- fun[0] = 12;
- fun[1] = 11;
- fun[2] = 9;
-
- Array.prototype.forEach.call(fun, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to Function object, which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + var fun = function (a, b) { + return a + b; + }; + fun[0] = 12; + fun[1] = 11; + fun[2] = 9; + + Array.prototype.forEach.call(fun, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-2.js index d6a859b95..d71ef253f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-2.js @@ -1,21 +1,21 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-2.js
- * @description Array.prototype.forEach - 'length' is own data property on an Array
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- [12, 11].forEach(callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - 'length' is own data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + [12, 11].forEach(callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-3.js index 6991dc484..9286fbe74 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-3.js
- * @description Array.prototype.forEach - 'length' is an own data property that overrides an inherited data property on an Array-like object
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- 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;
-
- Array.prototype.forEach.call(child, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is an own data property that + overrides an inherited data property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + 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; + + Array.prototype.forEach.call(child, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-4.js index 1c3dda70f..e0f31c2d2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-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.18/15.4.4.18-2-4.js
- * @description Array.prototype.forEach - 'length' is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
- var result = false;
- var arrProtoLen;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- try {
- arrProtoLen = Array.prototype.length;
- Array.prototype.length = 0;
- [12, 11].forEach(callbackfn);
- return result;
- } 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.forEach - 'length' is own data property that + overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + var arrProtoLen; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + try { + arrProtoLen = Array.prototype.length; + Array.prototype.length = 0; + [12, 11].forEach(callbackfn); + return result; + } finally { + Array.prototype.length = arrProtoLen; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-5.js index 8a84c6e76..0137d2997 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-5.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.18/15.4.4.18-2-5.js
- * @description Array.prototype.forEach applied to Array-like object, 'length' is an own data property that overrides an inherited accessor property
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- 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", {
- value: 2,
- configurable: true
- });
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- Array.prototype.forEach.call(child, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to Array-like object, 'length' is + an own data property that overrides an inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + 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", { + value: 2, + configurable: true + }); + child[0] = 12; + child[1] = 11; + child[2] = 9; + + Array.prototype.forEach.call(child, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-6.js index 1fa7c9992..8c9ae99a5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-6.js
- * @description Array.prototype.forEach applied to Array-like object, 'length' is an inherited data property
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- var proto = { length: 2 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child[0] = 12;
- child[1] = 11;
- child[2] = 9;
-
- Array.prototype.forEach.call(child, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to Array-like object, 'length' is + an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + var proto = { length: 2 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child[0] = 12; + child[1] = 11; + child[2] = 9; + + Array.prototype.forEach.call(child, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-7.js index 1abf9a291..a476e6405 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-7.js
- * @description Array.prototype.forEach applied to Array-like object, 'length' is an own accessor property
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- obj[0] = 12;
- obj[1] = 11;
- obj[2] = 9;
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to Array-like object, 'length' is + an own accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + obj[0] = 12; + obj[1] = 11; + obj[2] = 9; + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-8.js index 20b155cd3..3a9994e8f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-8.js
- * @description Array.prototype.forEach applied to Array-like object, 'length' is an own accessor property that overrides an inherited data property
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- 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;
-
- Array.prototype.forEach.call(child, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to Array-like object, 'length' is + an own accessor property that overrides an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + 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; + + Array.prototype.forEach.call(child, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-9.js index 5be4ff967..8b3804652 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-2-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-2-9.js
- * @description Array.prototype.forEach applied to Array-like object, 'length' is an own accessor property that overrides an inherited accessor property
- */
-
-
-function testcase() {
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (obj.length === 2);
- }
-
- 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;
-
- Array.prototype.forEach.call(child, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach applied to Array-like object, 'length' is + an own accessor property that overrides an inherited accessor + property +includes: [runTestCase.js] +---*/ + +function testcase() { + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } + + 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; + + Array.prototype.forEach.call(child, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-1.js index 7a90bd229..4efc21afc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-1.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.18/15.4.4.18-3-1.js
- * @description Array.prototype.forEach - value of 'length' is undefined
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 0, 1: 1, length: undefined };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 0, 1: 1, length: undefined }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-10.js index a9167a61f..33c10645f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-10.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.18/15.4.4.18-3-10.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is NaN)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 9, length: NaN };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is a number (value is + NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 9, length: NaN }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-11.js index ca8235704..62ac23a55 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-11.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-11.js
- * @description Array.prototype.forEach - 'length' is a string containing a positive number
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = { 1: 11, 2: 9, length: "2" };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is a string containing a + positive number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { 1: 11, 2: 9, length: "2" }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.js index b9379bb8d..0ac8a594f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-12.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.18/15.4.4.18-3-12.js
- * @description Array.prototype.forEach - 'length' is a string containing a negative number
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = { 1: 11, 2: 9, length: "-4294967294" };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is a string containing a + negative number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { 1: 11, 2: 9, length: "-4294967294" }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-13.js index 13922034c..b2b963d94 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-13.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.18/15.4.4.18-3-13.js
- * @description Array.prototype.forEach - 'length' is a string containing a decimal number
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
- var obj = { 1: 11, 2: 9, length: "2.5" };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is a string containing a + decimal number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + var obj = { 1: 11, 2: 9, length: "2.5" }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js index a3bb7e521..5763d8bae 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-14.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.18/15.4.4.18-3-14.js
- * @description Array.prototype.forEach - 'length' is a string containing +/-Infinity
- */
-
-
-function testcase() {
-
- var accessed1 = false;
- var accessed2 = false;
- var accessed3 = false;
-
- function callbackfn1(val, idx, obj) {
- accessed1 = true;
- }
-
- function callbackfn2(val, idx, obj) {
- accessed2 = true;
- }
-
- function callbackfn3(val, idx, obj) {
- accessed3 = true;
- }
-
- var obj1 = { 0: 9, length: "Infinity" };
- var obj2 = { 0: 9, length: "-Infinity" };
- var obj3 = { 0: 9, length: "+Infinity" };
-
- Array.prototype.forEach.call(obj1, callbackfn1);
- Array.prototype.forEach.call(obj2, callbackfn2);
- Array.prototype.forEach.call(obj3, callbackfn3);
-
- return !accessed1 && !accessed2 && !accessed3;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is a string containing + +/-Infinity +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed1 = false; + var accessed2 = false; + var accessed3 = false; + + function callbackfn1(val, idx, obj) { + accessed1 = true; + } + + function callbackfn2(val, idx, obj) { + accessed2 = true; + } + + function callbackfn3(val, idx, obj) { + accessed3 = true; + } + + var obj1 = { 0: 9, length: "Infinity" }; + var obj2 = { 0: 9, length: "-Infinity" }; + var obj3 = { 0: 9, length: "+Infinity" }; + + Array.prototype.forEach.call(obj1, callbackfn1); + Array.prototype.forEach.call(obj2, callbackfn2); + Array.prototype.forEach.call(obj3, callbackfn3); + + return !accessed1 && !accessed2 && !accessed3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-15.js index 824ec11ca..03bde681d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-15.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.18/15.4.4.18-3-15.js
- * @description Array.prototype.forEach - 'length' is a string containing an exponential number
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = { 1: 11, 2: 9, length: "2E0" };
-
- Array.prototype.forEach.call(obj, callbackfn);
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is a string containing an + exponential number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { 1: 11, 2: 9, length: "2E0" }; + + Array.prototype.forEach.call(obj, callbackfn); + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-16.js index 1c58c53b1..a36ecbfe5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-16.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.18/15.4.4.18-3-16.js
- * @description Array.prototype.forEach - 'length' is a string containing a hex number
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = { 1: 11, 2: 9, length: "0x0002" };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is a string containing a hex + number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { 1: 11, 2: 9, length: "0x0002" }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-17.js index 60f9a03b2..cc7fb3919 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-17.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-17.js
- * @description Array.prototype.forEach - 'length' is a string containing a number with leading zeros
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = { 1: 11, 2: 9, length: "0002.00" };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'length' is a string containing a number + with leading zeros +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { 1: 11, 2: 9, length: "0002.00" }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-18.js index 7db29a244..617bc84a3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-18.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.18/15.4.4.18-3-18.js
- * @description Array.prototype.forEach - value of 'length' is a string that can't convert to a number
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 9, length: "asdf!_" };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is a string that can't + convert to a number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 9, length: "asdf!_" }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-19.js index a22d20758..576d55c2c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-19.js @@ -1,34 +1,36 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-19.js
- * @description Array.prototype.forEach - value of 'length' is an Object which has an own toString method.
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: {
- toString: function () {
- return '2';
- }
- }
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is an Object which has + an own toString method. +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { + 1: 11, + 2: 9, + length: { + toString: function () { + return '2'; + } + } + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-2.js index 93416a9c0..1ec9a2575 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-2.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.18/15.4.4.18-3-2.js
- * @description Array.prototype.forEach - value of 'length' is a boolean (value is true)
- */
-
-
-function testcase() {
-
- var testResult = false;
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = { 0: 11, 1: 9, length: true };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is a boolean (value is + true) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { 0: 11, 1: 9, length: true }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-20.js index 98ae5e6a5..bb8005e9a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-20.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.18/15.4.4.18-3-20.js
- * @description Array.prototype.forEach - value of 'length' is an Object which has an own valueOf method.
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: {
- valueOf: function () {
- return 2;
- }
- }
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is an Object which has + an own valueOf method. +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function () { + return 2; + } + } + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-21.js index 30a9dbb2b..a955956af 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-21.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.18/15.4.4.18-3-21.js
- * @description Array.prototype.forEach - 'length' is an object that has an own valueOf method that returns an object and toString method that returns a string
- */
-
-
-function testcase() {
-
- var testResult = false;
- var firstStepOccured = false;
- var secondStepOccured = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: {
- valueOf: function () {
- firstStepOccured = true;
- return {};
- },
- toString: function () {
- secondStepOccured = true;
- return '2';
- }
- }
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult && 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.forEach - 'length' is an object that has an own + valueOf method that returns an object and toString method that + returns a string +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + var firstStepOccured = false; + var secondStepOccured = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function () { + firstStepOccured = true; + return {}; + }, + toString: function () { + secondStepOccured = true; + return '2'; + } + } + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult && firstStepOccured && secondStepOccured; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-22.js index 9ee0a8398..9819aef27 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-22.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.18/15.4.4.18-3-22.js
- * @description Array.prototype.forEach throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values
- */
-
-
-function testcase() {
-
- var accessed = false;
- var firstStepOccured = false;
- var secondStepOccured = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = {
- 1: 11,
- 2: 12,
-
- length: {
- valueOf: function () {
- firstStepOccured = true;
- return {};
- },
- toString: function () {
- secondStepOccured = true;
- return {};
- }
- }
- };
-
- try {
- Array.prototype.forEach.call(obj, callbackfn);
- 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.forEach throws TypeError exception when 'length' + is an object with toString and valueOf methods that don�t return + primitive values +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var firstStepOccured = false; + var secondStepOccured = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { + 1: 11, + 2: 12, + + length: { + valueOf: function () { + firstStepOccured = true; + return {}; + }, + toString: function () { + secondStepOccured = true; + return {}; + } + } + }; + + try { + Array.prototype.forEach.call(obj, callbackfn); + 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.18/15.4.4.18-3-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-23.js index 0fb5185f2..8ffbc47a0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-23.js @@ -1,49 +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.18/15.4.4.18-3-23.js
- * @description Array.prototype.forEach uses inherited valueOf method when 'length' is an object with an own toString and inherited valueOf methods
- */
-
-
-function testcase() {
-
- var testResult = false;
- var valueOfAccessed = false;
- var toStringAccessed = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- 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 = {
- 1: 11,
- 2: 9,
- length: child
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult && 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.forEach uses inherited valueOf method when + 'length' is an object with an own toString and inherited valueOf + methods +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + var valueOfAccessed = false; + var toStringAccessed = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + 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 = { + 1: 11, + 2: 9, + length: child + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult && valueOfAccessed && !toStringAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-24.js index 0e6996360..c1feef8f4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-24.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.18/15.4.4.18-3-24.js
- * @description Array.prototype.forEach - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: 2.685
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is a positive + non-integer, ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { + 1: 11, + 2: 9, + length: 2.685 + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js index 61264d3ba..01dda51a6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-25.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.18/15.4.4.18-3-25.js
- * @description Array.prototype.forEach - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: -4294967294.5
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is a negative + non-integer, ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { + 1: 11, + 2: 9, + length: -4294967294.5 + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-28.js index 0d20931c2..101d969c9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-28.js @@ -1,29 +1,31 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-28.js
- * @description Array.prototype.forEach - value of 'length' is boundary value (2^32)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = {
- 0: 12,
- length: 4294967296
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is boundary value + (2^32) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { + 0: 12, + length: 4294967296 + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-29.js index 5fe2138a0..c64f058cf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-29.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.18/15.4.4.18-3-29.js
- * @description Array.prototype.forEach - value of 'length' is boundary value (2^32 + 1)
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- testResult = (val > 10);
- }
-
- var obj = {
- 0: 11,
- 1: 9,
- length: 4294967297
- };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is boundary value + (2^32 + 1) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + testResult = (val > 10); + } + + var obj = { + 0: 11, + 1: 9, + length: 4294967297 + }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-3.js index 2059b02eb..975f61ab6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-3.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.18/15.4.4.18-3-3.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is 0)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 1, 1: 1, length: 0 };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is a number (value is + 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 1, 1: 1, length: 0 }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-4.js index 372620953..18e918034 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-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.18/15.4.4.18-3-4.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is +0)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 11, length: +0 };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is a number (value is + +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 11, length: +0 }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-5.js index 471dae714..69cc786ac 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-5.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.18/15.4.4.18-3-5.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is -0)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 11, length: -0 };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is a number (value is + -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 11, length: -0 }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-6.js index 96ffec650..93431221e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-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.18/15.4.4.18-3-6.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is positive)
- */
-
-
-function testcase() {
-
- var testResult1 = false;
-
- function callbackfn(val, idx, obj) {
- testResult1 = (val > 10);
- }
-
- var obj = { 1: 11, 2: 9, length: 2 };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is a number (value is + positive) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult1 = false; + + function callbackfn(val, idx, obj) { + testResult1 = (val > 10); + } + + var obj = { 1: 11, 2: 9, length: 2 }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js index 255465da1..a8a325eca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-7.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is negative)
- */
-
-
-function testcase() {
-
- var testResult1 = false;
-
- function callbackfn(val, idx, obj) {
- testResult1 = (val > 10);
- }
-
- var obj = { 1: 11, 2: 9, length: -4294967294 };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - value of 'length' is a number (value is + negative) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult1 = false; + + function callbackfn(val, idx, obj) { + testResult1 = (val > 10); + } + + var obj = { 1: 11, 2: 9, length: -4294967294 }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-8.js index 187e7af77..69037623c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-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.18/15.4.4.18-3-8.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is Infinity)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 9, length: Infinity };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is a number (value is + Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 9, length: Infinity }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-9.js index 55a7ba6ad..bdbbface1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-3-9.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.18/15.4.4.18-3-9.js
- * @description Array.prototype.forEach - value of 'length' is a number (value is -Infinity)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 9, length: -Infinity };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return !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.forEach - value of 'length' is a number (value is + -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 9, length: -Infinity }; + + Array.prototype.forEach.call(obj, callbackfn); + + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-1.js index 1d12e60eb..0c239b547 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-1.js
- * @description Array.prototype.forEach throws TypeError if callbackfn is undefined
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.forEach();
- }
- 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.forEach throws TypeError if callbackfn is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.forEach(); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-10.js index 7cd901935..22056cc7f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-10.js
- * @description Array.prototype.forEach - 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.forEach.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.forEach - 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.forEach.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.18/15.4.4.18-4-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-11.js index 11069b210..3b97e54e1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-11.js
- * @description Array.prototype.forEach - 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.forEach.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.forEach - 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.forEach.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.18/15.4.4.18-4-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-12.js index 3c61e06c3..e21a32287 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-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.18/15.4.4.18-4-12.js
- * @description Array.prototype.forEach - 'callbackfn' is a function
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- [11, 9].forEach(callbackfn);
- return 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.forEach - 'callbackfn' is a function +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + } + + [11, 9].forEach(callbackfn); + return accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-15.js index 98e15b5c6..2a082adcf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-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.18/15.4.4.18-4-15.js
- * @description Array.prototype.forEach - 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.forEach.call(obj);
- return false;
- } catch (ex) {
- return (ex 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.forEach - 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.forEach.call(obj); + return false; + } catch (ex) { + return (ex instanceof TypeError) && lengthAccessed && !loopAccessed; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-2.js index 659651ca3..a6db6cb34 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-2.js
- * @description Array.prototype.forEach throws ReferenceError if callbackfn is unreferenced
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.forEach(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.forEach throws ReferenceError if callbackfn is + unreferenced +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.forEach(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.18/15.4.4.18-4-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-3.js index 1fc8e93aa..db0651f5d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-3.js
- * @description Array.prototype.forEach throws TypeError if callbackfn is null
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.forEach(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.forEach throws TypeError if callbackfn is null +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.forEach(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.18/15.4.4.18-4-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-4.js index ab4ad4458..4344dd6e8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-4.js
- * @description Array.prototype.forEach throws TypeError if callbackfn is boolean
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.forEach(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.forEach throws TypeError if callbackfn is boolean +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.forEach(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.18/15.4.4.18-4-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-5.js index 5075cd500..a0935212b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-5.js
- * @description Array.prototype.forEach throws TypeError if callbackfn is number
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.forEach(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.forEach throws TypeError if callbackfn is number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.forEach(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.18/15.4.4.18-4-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-6.js index 5cbc27b42..51865c285 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-6.js
- * @description Array.prototype.forEach throws TypeError if callbackfn is string
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.forEach("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.forEach throws TypeError if callbackfn is string +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.forEach("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.18/15.4.4.18-4-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-7.js index 04d5ce8d9..eb9594308 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-7.js
- * @description Array.prototype.forEach throws TypeError if callbackfn is Object without Call internal method
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.forEach(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.forEach throws TypeError if callbackfn is Object + without Call internal method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.forEach(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.18/15.4.4.18-4-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-8.js index 9a6c649a0..c2816798c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-8.js
- * @description Array.prototype.forEach - 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.forEach.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.forEach - 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.forEach.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.18/15.4.4.18-4-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-9.js index 0d2ae0a3e..7a1b1c31e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-4-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-4-9.js
- * @description Array.prototype.forEach - 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.forEach.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.forEach - 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.forEach.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.18/15.4.4.18-5-1-s.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js index 05a592b7c..d2479d22c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-5-1-s.js
- * @description Array.prototype.forEach - 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].forEach(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.forEach - 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].forEach(callbackfn); + return innerThisCorrect; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js index d2ad769bc..67c09e63b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-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.18/15.4.4.18-5-1.js
- * @description Array.prototype.forEach - thisArg is passed
- */
-
-
-function testcase() {
- this._15_4_4_18_5_1 = false;
- var _15_4_4_18_5_1 = true;
- var result;
- function callbackfn(val, idx, obj) {
- result = this._15_4_4_18_5_1;
- }
- var arr = [1];
- arr.forEach(callbackfn)
- return !result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - thisArg is passed +includes: [runTestCase.js] +---*/ + +function testcase() { + this._15_4_4_18_5_1 = false; + var _15_4_4_18_5_1 = true; + var result; + function callbackfn(val, idx, obj) { + result = this._15_4_4_18_5_1; + } + var arr = [1]; + arr.forEach(callbackfn) + return !result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-10.js index 59cf58961..6823ecd39 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-10.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.18/15.4.4.18-5-10.js
- * @description Array.prototype.forEach - Array Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objArray = [];
-
- function callbackfn(val, idx, obj) {
- result = (this === objArray);
- }
-
- [11].forEach(callbackfn, objArray);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - Array Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objArray = []; + + function callbackfn(val, idx, obj) { + result = (this === objArray); + } + + [11].forEach(callbackfn, objArray); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-11.js index 3fce7ac5b..1fbb4acc0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-11.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.18/15.4.4.18-5-11.js
- * @description Array.prototype.forEach - String Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objString = new String();
-
- function callbackfn(val, idx, obj) {
- result = (this === objString);
- }
-
- [11].forEach(callbackfn, objString);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - String Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objString = new String(); + + function callbackfn(val, idx, obj) { + result = (this === objString); + } + + [11].forEach(callbackfn, objString); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-12.js index 32f66ddf9..48e72d6a7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-12.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.18/15.4.4.18-5-12.js
- * @description Array.prototype.forEach - Boolean Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objBoolean = new Boolean();
-
- function callbackfn(val, idx, obj) {
- result = (this === objBoolean);
- }
-
- [11].forEach(callbackfn, objBoolean);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - Boolean Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objBoolean = new Boolean(); + + function callbackfn(val, idx, obj) { + result = (this === objBoolean); + } + + [11].forEach(callbackfn, objBoolean); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-13.js index d16af30a7..ef8203613 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-13.js @@ -1,24 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-13.js
- * @description Array.prototype.forEach - Number Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objNumber = new Number();
-
- function callbackfn(val, idx, obj) {
- result = (this === objNumber);
- }
-
- [11].forEach(callbackfn, objNumber);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - Number Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objNumber = new Number(); + + function callbackfn(val, idx, obj) { + result = (this === objNumber); + } + + [11].forEach(callbackfn, objNumber); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-14.js index f0f3b10a3..0ec3b15d5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-14.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.18/15.4.4.18-5-14.js
- * @description Array.prototype.forEach - the Math object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (this === Math);
- }
-
- [11].forEach(callbackfn, Math);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - the Math object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (this === Math); + } + + [11].forEach(callbackfn, Math); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-15.js index b0f456c46..644dfe4ef 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-15.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.18/15.4.4.18-5-15.js
- * @description Array.prototype.forEach - Date Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objDate = new Date();
-
- function callbackfn(val, idx, obj) {
- result = (this === objDate);
- }
-
- [11].forEach(callbackfn, objDate);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - Date Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objDate = new Date(); + + function callbackfn(val, idx, obj) { + result = (this === objDate); + } + + [11].forEach(callbackfn, objDate); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-16.js index 9d2c2e722..72c118be4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-16.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.18/15.4.4.18-5-16.js
- * @description Array.prototype.forEach - RegExp Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objRegExp = new RegExp();
-
- function callbackfn(val, idx, obj) {
- result = (this === objRegExp);
- }
-
- [11].forEach(callbackfn, objRegExp);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - RegExp Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objRegExp = new RegExp(); + + function callbackfn(val, idx, obj) { + result = (this === objRegExp); + } + + [11].forEach(callbackfn, objRegExp); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-17.js index b1ce03ff3..15cbd86fc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-17.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.18/15.4.4.18-5-17.js
- * @description Array.prototype.forEach - the JSON object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (this === JSON);
- }
-
- [11].forEach(callbackfn, JSON);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - the JSON object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (this === JSON); + } + + [11].forEach(callbackfn, JSON); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-18.js index 299ee5dda..2ec5915d1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-18.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.18/15.4.4.18-5-18.js
- * @description Array.prototype.forEach - Error Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objError = new RangeError();
-
- function callbackfn(val, idx, obj) {
- result = (this === objError);
- }
-
- [11].forEach(callbackfn, objError);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - Error Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objError = new RangeError(); + + function callbackfn(val, idx, obj) { + result = (this === objError); + } + + [11].forEach(callbackfn, objError); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-19.js index 5f9f16050..1affe6b0a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-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.18/15.4.4.18-5-19.js
- * @description Array.prototype.forEach - the Arguments object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var arg;
-
- function callbackfn(val, idx, obj) {
- result = (this === arg);
- }
-
- (function fun() {
- arg = arguments;
- }(1, 2, 3));
-
- [11].forEach(callbackfn, arg);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - the Arguments object can be used as + thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var arg; + + function callbackfn(val, idx, obj) { + result = (this === arg); + } + + (function fun() { + arg = arguments; + }(1, 2, 3)); + + [11].forEach(callbackfn, arg); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-2.js index cb3a5df5b..af5dd7605 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-2.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.18/15.4.4.18-5-2.js
- * @description Array.prototype.forEach - thisArg is Object
- */
-
-
-function testcase() {
- var res = false;
- var o = new Object();
- o.res = true;
- var result;
- function callbackfn(val, idx, obj)
- {
- result = this.res;
- }
-
- var arr = [1];
- arr.forEach(callbackfn,o)
- if( result === 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.forEach - thisArg is Object +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var o = new Object(); + o.res = true; + var result; + function callbackfn(val, idx, obj) + { + result = this.res; + } + + var arr = [1]; + arr.forEach(callbackfn,o) + if( result === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-21.js index 397b4bec7..260a2d10e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-21.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.18/15.4.4.18-5-21.js
- * @description Array.prototype.forEach - the global object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (this === fnGlobalObject());
- }
-
- [11].forEach(callbackfn, fnGlobalObject());
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - the global object can be used as thisArg +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (this === fnGlobalObject()); + } + + [11].forEach(callbackfn, fnGlobalObject()); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-22.js index f53a9402e..a8fc7de88 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-22.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.18/15.4.4.18-5-22.js
- * @description Array.prototype.forEach - boolean primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
-
- function callbackfn(val, idx, obj) {
- result = (this.valueOf() === false);
- }
-
- [11].forEach(callbackfn, false);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - boolean primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + + function callbackfn(val, idx, obj) { + result = (this.valueOf() === false); + } + + [11].forEach(callbackfn, false); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-23.js index aa162bc93..78be66e48 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-23.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.18/15.4.4.18-5-23.js
- * @description Array.prototype.forEach - number primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (this.valueOf() === 101);
- }
-
- [11].forEach(callbackfn, 101);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - number primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (this.valueOf() === 101); + } + + [11].forEach(callbackfn, 101); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-24.js index 24ae537d3..e282bbb38 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-24.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.18/15.4.4.18-5-24.js
- * @description Array.prototype.forEach - string primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (this.valueOf() === "abc");
- }
-
- [11].forEach(callbackfn, "abc");
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - string primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (this.valueOf() === "abc"); + } + + [11].forEach(callbackfn, "abc"); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-25.js index 809c940d2..85f2f1312 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-25.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.18/15.4.4.18-5-25.js
- * @description Array.prototype.forEach - thisArg not passed
- */
-
-
-function testcase() {
- function innerObj() {
- this._15_4_4_18_5_25 = true;
- var _15_4_4_18_5_25 = false;
- var result;
- function callbackfn(val, idx, obj) {
- result = this._15_4_4_18_5_25;
- }
- var arr = [1];
- arr.forEach(callbackfn)
- this.retVal = !result;
- }
- return new innerObj().retVal;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - thisArg not passed +includes: [runTestCase.js] +---*/ + +function testcase() { + function innerObj() { + this._15_4_4_18_5_25 = true; + var _15_4_4_18_5_25 = false; + var result; + function callbackfn(val, idx, obj) { + result = this._15_4_4_18_5_25; + } + var arr = [1]; + arr.forEach(callbackfn) + this.retVal = !result; + } + return new innerObj().retVal; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-3.js index 5d3b224ad..927c2cf8f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-3.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.18/15.4.4.18-5-3.js
- * @description Array.prototype.forEach - thisArg is Array
- */
-
-
-function testcase() {
- var res = false;
- var a = new Array();
- a.res = true;
- var result;
- function callbackfn(val, idx, obj)
- {
- result = this.res;
- }
-
- var arr = [1];
- arr.forEach(callbackfn,a)
- if( result === 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.forEach - thisArg is Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var a = new Array(); + a.res = true; + var result; + function callbackfn(val, idx, obj) + { + result = this.res; + } + + var arr = [1]; + arr.forEach(callbackfn,a) + if( result === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-4.js index 02f578a9c..d3940805c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-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.18/15.4.4.18-5-4.js
- * @description Array.prototype.forEach - thisArg is object from object template(prototype)
- */
-
-
-function testcase() {
- var res = false;
- var result;
- function callbackfn(val, idx, obj)
- {
- result = this.res;
- }
-
- function foo(){}
- foo.prototype.res = true;
- var f = new foo();
- var arr = [1];
- arr.forEach(callbackfn,f)
- if( result === 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.forEach - thisArg is object from object + template(prototype) +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var result; + function callbackfn(val, idx, obj) + { + result = this.res; + } + + function foo(){} + foo.prototype.res = true; + var f = new foo(); + var arr = [1]; + arr.forEach(callbackfn,f) + if( result === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-5.js index d3f60de44..cf8a203fc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-5.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.18/15.4.4.18-5-5.js
- * @description Array.prototype.forEach - thisArg is object from object template
- */
-
-
-function testcase() {
- var res = false;
- var result;
- function callbackfn(val, idx, obj)
- {
- result = this.res;
- }
-
- function foo(){}
- var f = new foo();
- f.res = true;
-
- var arr = [1];
- arr.forEach(callbackfn,f)
- if( result === 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.forEach - thisArg is object from object template +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var result; + function callbackfn(val, idx, obj) + { + result = this.res; + } + + function foo(){} + var f = new foo(); + f.res = true; + + var arr = [1]; + arr.forEach(callbackfn,f) + if( result === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-6.js index 61e45d230..63127f484 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-6.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.18/15.4.4.18-5-6.js
- * @description Array.prototype.forEach - thisArg is function
- */
-
-
-function testcase() {
- var res = false;
- var result;
- function callbackfn(val, idx, obj)
- {
- result = this.res;
- }
-
- function foo(){}
- foo.res = true;
-
- var arr = [1];
- arr.forEach(callbackfn,foo)
- if( result === 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.forEach - thisArg is function +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var result; + function callbackfn(val, idx, obj) + { + result = this.res; + } + + function foo(){} + foo.res = true; + + var arr = [1]; + arr.forEach(callbackfn,foo) + if( result === true) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-7.js index 47d7181d1..3e379d368 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-7.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.18/15.4.4.18-5-7.js
- * @description Array.prototype.forEach - built-in functions can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
-
- function callbackfn(val, idx, obj) {
- result = (this === eval);
- }
-
- [11].forEach(callbackfn, eval);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - built-in functions can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + + function callbackfn(val, idx, obj) { + result = (this === eval); + } + + [11].forEach(callbackfn, eval); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-9.js index b0d08bc3b..f61c88c8d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-9.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.18/15.4.4.18-5-9.js
- * @description Array.prototype.forEach - Function Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var result = false;
- var objString = function () { };
-
- function callbackfn(val, idx, obj) {
- result = (this === objString);
- }
-
- [11].forEach(callbackfn, objString);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - Function Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var objString = function () { }; + + function callbackfn(val, idx, obj) { + result = (this === objString); + } + + [11].forEach(callbackfn, objString); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-1.js index 18b48d1d6..9c755a4ea 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-1.js
- * @description Array.prototype.forEach doesn't consider new elements added to array after the call
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- callCnt++;
- arr[2] = 3;
- arr[5] = 6;
- }
-
- var arr = [1,2,,4,5];
- arr.forEach(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.forEach doesn't consider new elements added to + array after the call +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + arr[2] = 3; + arr[5] = 6; + } + + var arr = [1,2,,4,5]; + arr.forEach(callbackfn); + if( callCnt === 5) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-2.js index 3363a21c6..1bd0d68ec 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-2.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.18/15.4.4.18-7-2.js
- * @description Array.prototype.forEach doesn't visit deleted elements in array after the call
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- if(callCnt == 0)
- delete arr[3];
- callCnt++;
- }
-
- var arr = [1,2,3,4,5];
- arr.forEach(callbackfn)
- if( callCnt === 4)
- 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.forEach doesn't visit deleted elements in array + after the call +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + if(callCnt == 0) + delete arr[3]; + callCnt++; + } + + var arr = [1,2,3,4,5]; + arr.forEach(callbackfn) + if( callCnt === 4) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-3.js index 9210b60e5..66fc34c7d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-3.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-3.js
- * @description Array.prototype.forEach doesn't visit deleted elements when Array.length is decreased
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- arr.length=3;
- callCnt++;
- }
-
- var arr = [1,2,3,4,5];
- arr.forEach(callbackfn);
- if( callCnt === 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.forEach doesn't visit deleted elements when + Array.length is decreased +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + arr.length=3; + callCnt++; + } + + var arr = [1,2,3,4,5]; + arr.forEach(callbackfn); + if( callCnt === 3) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-4.js index 72b756f21..2aae38532 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-4.js
- * @description Array.prototype.forEach doesn't consider newly added elements in sparse array
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- arr[1000] = 3;
- callCnt++;
- }
-
- var arr = new Array(10);
- arr[1] = 1;
- arr[2] = 2;
- arr.forEach(callbackfn);
- if( 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.forEach doesn't consider newly added elements in + sparse array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + arr[1000] = 3; + callCnt++; + } + + var arr = new Array(10); + arr[1] = 1; + arr[2] = 2; + arr.forEach(callbackfn); + if( callCnt === 2) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-5.js index 0e503543b..9c9cdc59f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-5.js
- * @description Array.prototype.forEach visits deleted element in array after the call when same index is also present in prototype
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- delete arr[4];
- callCnt++;
- }
-
- Array.prototype[4] = 5;
-
- var arr = [1,2,3,4,5];
- arr.forEach(callbackfn)
- delete Array.prototype[4];
- 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.forEach visits deleted element in array after the + call when same index is also present in prototype +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + delete arr[4]; + callCnt++; + } + + Array.prototype[4] = 5; + + var arr = [1,2,3,4,5]; + arr.forEach(callbackfn) + delete Array.prototype[4]; + if( callCnt === 5) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-7.js index c88e5c537..b5f5c17e3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-7.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-7.js
- * @description Array.prototype.forEach - considers new value of elements in array after the call
- */
-
-
-function testcase() {
-
- var result = false;
- var arr = [1, 2, 3, 4, 5];
-
- function callbackfn(val, Idx, obj) {
- arr[4] = 6;
- if (val >= 6) {
- result = true;
- }
- }
-
- arr.forEach(callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - considers new value of elements in array + after the call +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var arr = [1, 2, 3, 4, 5]; + + function callbackfn(val, Idx, obj) { + arr[4] = 6; + if (val >= 6) { + result = true; + } + } + + arr.forEach(callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-8.js index 6cf913d41..99a81e1ff 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-8.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.18/15.4.4.18-7-8.js
- * @description Array.prototype.forEach - no observable effects occur if len is 0
- */
-
-
-function testcase() {
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var obj = { 0: 11, 1: 12, length: 0 };
-
- Array.prototype.forEach.call(obj, callbackfn);
- return !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.forEach - no observable effects occur if len is 0 +includes: [runTestCase.js] +---*/ + +function testcase() { + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + } + + var obj = { 0: 11, 1: 12, length: 0 }; + + Array.prototype.forEach.call(obj, callbackfn); + return !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-9.js index b5d031328..6d814c44c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-9.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.18/15.4.4.18-7-9.js
- * @description Array.prototype.forEach - modifications to length don't change number of iterations
- */
-
-
-function testcase() {
-
- var called = 0;
- function callbackfn(val, idx, obj) {
- called++;
- }
-
- var obj = { 1: 12, 2: 9, length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- obj.length = 3;
- return 11;
- },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
- return 2 === 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.forEach - modifications to length don't change + number of iterations +includes: [runTestCase.js] +---*/ + +function testcase() { + + var called = 0; + function callbackfn(val, idx, obj) { + called++; + } + + var obj = { 1: 12, 2: 9, length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + obj.length = 3; + return 11; + }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + return 2 === called; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-1.js index 7e360a99e..551463184 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-1.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-1.js
- * @description Array.prototype.forEach - callbackfn not called for indexes never been assigned values
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- callCnt++;
- }
-
- var arr = new Array(10);
- arr[1] = undefined;
- arr.forEach(callbackfn);
- if( 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.forEach - callbackfn not called for indexes never + been assigned values +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + } + + var arr = new Array(10); + arr[1] = undefined; + arr.forEach(callbackfn); + if( callCnt === 1) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-10.js index 3a0266cf7..850d9678e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-10.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.18/15.4.4.18-7-b-10.js
- * @description Array.prototype.forEach - deleting property of prototype causes prototype index property not to be visited on an Array-like Object
- */
-
-
-function testcase() {
-
- var accessed = false;
- var testResult = true;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- if (idx === 3) {
- testResult = false;
- }
- }
-
- 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;
- Array.prototype.forEach.call(obj, callbackfn);
- return testResult && accessed;
- } 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.forEach - deleting property of prototype causes + prototype index property not to be visited on an Array-like Object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var testResult = true; + + function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } + } + + 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; + Array.prototype.forEach.call(obj, callbackfn); + return testResult && accessed; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-11.js index 5e6b89e1c..3ea09c3a9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-11.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.18/15.4.4.18-7-b-11.js
- * @description Array.prototype.forEach - deleting property of prototype causes prototype index property not to be visited on an Array
- */
-
-
-function testcase() {
-
- var accessed = false;
- var testResult = true;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- if (idx === 1) {
- testResult = false;
- }
- }
-
- var arr = [0, , ];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete Array.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- arr.forEach(callbackfn);
- return testResult && accessed;
- } 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.forEach - deleting property of prototype causes + prototype index property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var testResult = true; + + function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } + } + + var arr = [0, , ]; + + Object.defineProperty(arr, "0", { + get: function () { + delete Array.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + arr.forEach(callbackfn); + return testResult && accessed; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-12.js index e280b8cb6..466ee0430 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-12.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.18/15.4.4.18-7-b-12.js
- * @description Array.prototype.forEach - deleting own property with prototype property causes prototype index property to be visited on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 1) {
- testResult = true;
- }
- }
-
- var obj = { 0: 0, 1: 111, length: 10 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- delete obj[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- Array.prototype.forEach.call(obj, callbackfn);
- return testResult;
- } 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.forEach - deleting own property with prototype + property causes prototype index property to be visited on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } + } + + var obj = { 0: 0, 1: 111, length: 10 }; + + Object.defineProperty(obj, "0", { + get: function () { + delete obj[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + Array.prototype.forEach.call(obj, callbackfn); + return testResult; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-13.js index a32bcdfd8..7df01dc33 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-13.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.18/15.4.4.18-7-b-13.js
- * @description Array.prototype.forEach - deleting own property with prototype property causes prototype index property to be visited on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 1) {
- testResult = true;
- }
- }
- var arr = [0, 111];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- arr.forEach(callbackfn);
- return testResult;
- } 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.forEach - deleting own property with prototype + property causes prototype index property to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = true; + } + } + var arr = [0, 111]; + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + arr.forEach(callbackfn); + return testResult; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-14.js index f0b1b12ec..59c60dd39 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-14.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.18/15.4.4.18-7-b-14.js
- * @description Array.prototype.forEach - decreasing length of array causes index property not to be visited
- */
-
-
-function testcase() {
-
- var accessed = false;
- var testResult = true;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- if (idx === 3) {
- testResult = false;
- }
- }
-
- var arr = [0, 1, 2, "last"];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- arr.length = 3;
- return 0;
- },
- configurable: true
- });
-
- arr.forEach(callbackfn);
-
- return testResult && 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.forEach - decreasing length of array causes index + property not to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var testResult = true; + + function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 3) { + testResult = false; + } + } + + var arr = [0, 1, 2, "last"]; + + Object.defineProperty(arr, "0", { + get: function () { + arr.length = 3; + return 0; + }, + configurable: true + }); + + arr.forEach(callbackfn); + + return testResult && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-15.js index 6de098225..8b27761cd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-15.js @@ -1,46 +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.18/15.4.4.18-7-b-15.js
- * @description Array.prototype.forEach - decreasing length of array with prototype property causes prototype index property to be visited
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 2 && val === "prototype") {
- testResult = 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
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- } 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.forEach - decreasing length of array with + prototype property causes prototype index property to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 2 && val === "prototype") { + testResult = 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 + }); + + arr.forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-16.js index e0464b1dc..237a71175 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-16.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.18/15.4.4.18-7-b-16.js
- * @description Array.prototype.forEach - decreasing length of array does not delete non-configurable properties
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 2 && val === "unconfigurable") {
- testResult = 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
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - decreasing length of array does not + delete non-configurable properties +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 2 && val === "unconfigurable") { + testResult = 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 + }); + + arr.forEach(callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-2.js index 7cd120006..83389f35f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-2.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.18/15.4.4.18-7-b-2.js
- * @description Array.prototype.forEach - added properties in step 2 are visible here
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 2 && val === "length") {
- testResult = true;
- }
- }
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- obj[2] = "length";
- return 3;
- },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - added properties in step 2 are visible + here +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 2 && val === "length") { + testResult = true; + } + } + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + obj[2] = "length"; + return 3; + }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-3.js index a6dcb5135..444e75526 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-3.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.18/15.4.4.18-7-b-3.js
- * @description Array.prototype.forEach - deleted properties in step 2 are visible here
- */
-
-
-function testcase() {
-
- var accessed = false;
- var testResult = true;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- if (idx === 8) {
- testResult = false;
- }
- }
- var obj = { 2: 6.99, 8: 19 };
-
- Object.defineProperty(obj, "length", {
- get: function () {
- delete obj[8];
- return 10;
- },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
- return testResult && 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.forEach - deleted properties in step 2 are visible + here +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var testResult = true; + + function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 8) { + testResult = false; + } + } + var obj = { 2: 6.99, 8: 19 }; + + Object.defineProperty(obj, "length", { + get: function () { + delete obj[8]; + return 10; + }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + return testResult && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-4.js index 146ca7ab5..cd57adfc5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-b-4.js
- * @description Array.prototype.forEach - properties added into own object after current position are visited on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 1) {
- testResult = 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
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - properties added into own object after + current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = 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 + }); + + Array.prototype.forEach.call(obj, callbackfn); + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-5.js index de690b5d5..88c9a9aab 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-5.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.18/15.4.4.18-7-b-5.js
- * @description Array.prototype.forEach - properties added into own object after current position are visited on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 1) {
- testResult = 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
- });
-
- arr.forEach(callbackfn);
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - properties added into own object after + current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 1) { + testResult = 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 + }); + + arr.forEach(callbackfn); + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-6.js index 47a05b1de..3c8f3b746 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-6.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.18/15.4.4.18-7-b-6.js
- * @description Array.prototype.forEach - properties can be added to prototype after current position are visited on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 6.99) {
- testResult = 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 {
- Array.prototype.forEach.call(obj, callbackfn);
- return testResult;
- } 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.forEach - properties can be added to prototype + after current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = 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 { + Array.prototype.forEach.call(obj, callbackfn); + return testResult; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-7.js index 8836367ba..a1fb023a0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-7.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.18/15.4.4.18-7-b-7.js
- * @description Array.prototype.forEach - properties can be added to prototype after current position are visited on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1 && val === 6.99) {
- testResult = true;
- }
- }
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(Array.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- try {
- arr.forEach(callbackfn);
- return testResult;
- } 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.forEach - properties can be added to prototype + after current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1 && val === 6.99) { + testResult = true; + } + } + + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(Array.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + try { + arr.forEach(callbackfn); + return testResult; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-8.js index 178c1f2ab..ad82364e8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-8.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.18/15.4.4.18-7-b-8.js
- * @description Array.prototype.forEach - deleting own property causes index property not to be visited on an Array-like object
- */
-
-
-function testcase() {
-
- var accessed = false;
- var testResult = true;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- if (idx === 1) {
- testResult = false;
- }
- }
-
- 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
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
- return testResult && 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.forEach - deleting own property causes index + property not to be visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var testResult = true; + + function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } + } + + 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 + }); + + Array.prototype.forEach.call(obj, callbackfn); + return testResult && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-9.js index 4e6d3d613..5bd5e2067 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-b-9.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.18/15.4.4.18-7-b-9.js
- * @description Array.prototype.forEach - deleting own property causes index property not to be visited on an Array
- */
-
-
-function testcase() {
-
- var accessed = false;
- var testResult = true;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- if (idx === 1) {
- testResult = false;
- }
- }
-
- 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
- });
-
- arr.forEach(callbackfn);
- return testResult && 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.forEach - deleting own property causes index + property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var testResult = true; + + function callbackfn(val, idx, obj) { + accessed = true; + if (idx === 1) { + testResult = false; + } + } + + 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 + }); + + arr.forEach(callbackfn); + return testResult && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-1.js index 9c06e483d..a3707da25 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-1.js
- * @description Array.prototype.forEach - element to be retrieved is own data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = { };
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 5) {
- testResult = (val === kValue);
- }
- }
-
- var obj = { 5: kValue, length: 100 };
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is own data + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = { }; + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 5) { + testResult = (val === kValue); + } + } + + var obj = { 5: kValue, length: 100 }; + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-10.js index e7548600f..57c6b5996 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-10.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-10.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 2) {
- testResult = (val === 12);
- }
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- return 12;
- },
- configurable: true
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is own accessor + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 2) { + testResult = (val === 12); + } + } + + var arr = []; + + Object.defineProperty(arr, "2", { + get: function () { + return 12; + }, + configurable: true + }); + + arr.forEach(callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-11.js index afea5de86..4df544d3a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-11.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- var proto = { 0: 5 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 10;
-
- Object.defineProperty(child, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- Array.prototype.forEach.call(child, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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 testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + var proto = { 0: 5 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 10; + + Object.defineProperty(child, "0", { + get: function () { + return 11; + }, + configurable: true + }); + + Array.prototype.forEach.call(child, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-12.js index efdafa55f..a871ed146 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-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.18/15.4.4.18-7-c-i-12.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 111);
- }
- }
-
- var arr = [];
- try {
- Array.prototype[0] = 10;
-
- Object.defineProperty(arr, "0", {
- get: function () {
- return 111;
- },
- configurable: true
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is own accessor + property that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 111); + } + } + + var arr = []; + try { + Array.prototype[0] = 10; + + Object.defineProperty(arr, "0", { + get: function () { + return 111; + }, + configurable: true + }); + + arr.forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-13.js index 46cbb325a..b66773759 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-13.js @@ -1,49 +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.18/15.4.4.18-7-c-i-13.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (val === 12);
- }
- }
-
- var proto = {};
-
- Object.defineProperty(proto, "1", {
- get: function () {
- return 6;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 10;
-
- Object.defineProperty(child, "1", {
- get: function () {
- return 12;
- },
- configurable: true
- });
-
-
- Array.prototype.forEach.call(child, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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 testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 12); + } + } + + var proto = {}; + + Object.defineProperty(proto, "1", { + get: function () { + return 6; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 10; + + Object.defineProperty(child, "1", { + get: function () { + return 12; + }, + configurable: true + }); + + + Array.prototype.forEach.call(child, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-14.js index 773c09a7d..2ed8f42c8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-14.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.18/15.4.4.18-7-c-i-14.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- var arr = [];
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 5;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is own accessor + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + var arr = []; + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 5; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + return 11; + }, + configurable: true + }); + + arr.forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-15.js index 0d27c3403..269092a10 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-15.js
- * @description Array.prototype.forEach - element to be retrieved is inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (val === 11);
- }
- }
-
- var proto = {};
-
- Object.defineProperty(proto, "1", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 20;
-
- Array.prototype.forEach.call(child, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is inherited + accessor property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 11); + } + } + + var proto = {}; + + Object.defineProperty(proto, "1", { + get: function () { + return 11; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 20; + + Array.prototype.forEach.call(child, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-16.js index 5be24a005..736a416f5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-16.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.18/15.4.4.18-7-c-i-16.js
- * @description Array.prototype.forEach - element to be retrieved is inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- [, , , ].forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is inherited + accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 11; + }, + configurable: true + }); + + [, , , ].forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-17.js index 875a75e77..c5634862f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-17.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (typeof val === "undefined");
- }
- }
-
- var obj = { length: 2 };
- Object.defineProperty(obj, "1", {
- set: function () { },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is own accessor + property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (typeof val === "undefined"); + } + } + + var obj = { length: 2 }; + Object.defineProperty(obj, "1", { + set: function () { }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-18.js index 6e1cdb5ee..62d052379 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-18.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.18/15.4.4.18-7-c-i-18.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property without a get function on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (typeof val === "undefined");
- }
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is own accessor + property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (typeof val === "undefined"); + } + } + + var arr = []; + + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + arr.forEach(callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-19.js index d4ce754c0..9620b3fc1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-19.js @@ -1,44 +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.18/15.4.4.18-7-c-i-19.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (typeof val === "undefined");
- }
- }
-
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "1", {
- set: function () { },
- configurable: true
- });
-
- try {
- Object.defineProperty(Object.prototype, "1", {
- get: function () {
- return 10;
- },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is own accessor + property without a get function that overrides an inherited + accessor property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (typeof val === "undefined"); + } + } + + var obj = { length: 2 }; + + Object.defineProperty(obj, "1", { + set: function () { }, + configurable: true + }); + + try { + Object.defineProperty(Object.prototype, "1", { + get: function () { + return 10; + }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-2.js index 40e028c55..2e609638f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-2.js @@ -1,26 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-2.js
- * @description Array.prototype.forEach - element to be retrieved is own data property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- [11].forEach(callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is own data + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + [11].forEach(callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-20.js index cc11fbf94..123fd9dc4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-20.js @@ -1,44 +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.18/15.4.4.18-7-c-i-20.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (typeof val === "undefined");
- }
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 100;
- },
- configurable: true
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is own accessor + property without a get function that overrides an inherited + accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (typeof val === "undefined"); + } + } + + var arr = []; + + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 100; + }, + configurable: true + }); + + arr.forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-21.js index 43add6a0f..92deb403a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-21.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.18/15.4.4.18-7-c-i-21.js
- * @description Array.prototype.forEach - element to be retrieved is inherited accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (typeof val === "undefined");
- }
- }
-
- var proto = {};
- Object.defineProperty(proto, "1", {
- set: function () { },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 2;
-
- Array.prototype.forEach.call(child, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is inherited + accessor property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (typeof val === "undefined"); + } + } + + var proto = {}; + Object.defineProperty(proto, "1", { + set: function () { }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 2; + + Array.prototype.forEach.call(child, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-22.js index 646b9b455..383c03e86 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-22.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.18/15.4.4.18-7-c-i-22.js
- * @description Array.prototype.forEach - element to be retrieved is inherited accessor property without a get function on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (typeof val === "undefined");
- }
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- set: function () { },
- configurable: true
- });
-
- [, 1].forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is inherited + accessor property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (typeof val === "undefined"); + } + } + + try { + Object.defineProperty(Array.prototype, "0", { + set: function () { }, + configurable: true + }); + + [, 1].forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[0]; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-23.js index 6e2fbbdc9..cf0c7ded1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-23.js @@ -1,35 +1,39 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-23.js
- * @description Array.prototype.forEach - This object is an global object which contains index property
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[0] = 11;
- fnGlobalObject().length = 1;
-
- Array.prototype.forEach.call(fnGlobalObject(), callbackfn);
-
- return testResult;
- } 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.forEach - This object is an global object which + contains index property +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[0] = 11; + fnGlobalObject().length = 1; + + Array.prototype.forEach.call(fnGlobalObject(), callbackfn); + + return testResult; + } finally { + delete fnGlobalObject()[0]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-25.js index f95c5e9bd..a2630fdb4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-25.js
- * @description Array.prototype.forEach - This object is the Arguments object which implements its own property get method (number of arguments is less than number of parameters)
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- var func = function (a, b) {
- return Array.prototype.forEach.call(arguments, callbackfn);
- };
-
- func(11);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + var func = function (a, b) { + return Array.prototype.forEach.call(arguments, callbackfn); + }; + + func(11); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-26.js index 879b7d481..9e47df567 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-26.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.18/15.4.4.18-7-c-i-26.js
- * @description Array.prototype.forEach - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters)
- */
-
-
-function testcase() {
-
- var called = 0;
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- called++;
- if (called !== 1 && !testResult) {
- return;
- }
- if (idx === 0) {
- testResult = (val === 11);
- } else if (idx === 1) {
- testResult = (val === 9);
- } else {
- testResult = false;
- }
- }
-
- var func = function (a, b) {
- Array.prototype.forEach.call(arguments, callbackfn);
- };
-
- func(11, 9);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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() { + + var called = 0; + var testResult = false; + + function callbackfn(val, idx, obj) { + called++; + if (called !== 1 && !testResult) { + return; + } + if (idx === 0) { + testResult = (val === 11); + } else if (idx === 1) { + testResult = (val === 9); + } else { + testResult = false; + } + } + + var func = function (a, b) { + Array.prototype.forEach.call(arguments, callbackfn); + }; + + func(11, 9); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-27.js index 64bec297a..906112ad3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-27.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.18/15.4.4.18-7-c-i-27.js
- * @description Array.prototype.forEach - This object is the Arguments object which implements its own property get method (number of arguments is greater than number of parameters)
- */
-
-
-function testcase() {
-
- var called = 0;
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- called++;
- if (called !== 1 && !testResult) {
- return;
- }
- if (idx === 0) {
- testResult = (val === 11);
- } else if (idx === 1) {
- testResult = (val === 12);
- } else if (idx === 2) {
- testResult = (val === 9);
- } else {
- testResult = false;
- }
- }
-
- var func = function (a, b) {
- return Array.prototype.forEach.call(arguments, callbackfn);
- };
-
- func(11, 12, 9);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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() { + + var called = 0; + var testResult = false; + + function callbackfn(val, idx, obj) { + called++; + if (called !== 1 && !testResult) { + return; + } + if (idx === 0) { + testResult = (val === 11); + } else if (idx === 1) { + testResult = (val === 12); + } else if (idx === 2) { + testResult = (val === 9); + } else { + testResult = false; + } + } + + var func = function (a, b) { + return Array.prototype.forEach.call(arguments, callbackfn); + }; + + func(11, 12, 9); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-28.js index e1626e74f..5eeae4be2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-28.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.18/15.4.4.18-7-c-i-28.js
- * @description Array.prototype.forEach - element changed by getter on previous iterations is observed on an Array
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var arr = [];
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (val === 9);
- }
- }
-
- Object.defineProperty(arr, "0", {
- get: function () {
- preIterVisible = true;
- return 11;
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- if (preIterVisible) {
- return 9;
- } else {
- return 13;
- }
- },
- configurable: true
- });
-
- arr.forEach(callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element changed by getter on previous + iterations is observed on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var arr = []; + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 9); + } + } + + Object.defineProperty(arr, "0", { + get: function () { + preIterVisible = true; + return 11; + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + if (preIterVisible) { + return 9; + } else { + return 13; + } + }, + configurable: true + }); + + arr.forEach(callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-29.js index a3e241f0e..805c76b10 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-29.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.18/15.4.4.18-7-c-i-29.js
- * @description Array.prototype.forEach - element changed by getter on previous iterations is observed on an Array-like object
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var obj = { length: 2 };
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (val === 9);
- }
- }
-
- Object.defineProperty(obj, "0", {
- get: function () {
- preIterVisible = true;
- return 11;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "1", {
- get: function () {
- if (preIterVisible) {
- return 9;
- } else {
- return 13;
- }
- },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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 }; + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 9); + } + } + + Object.defineProperty(obj, "0", { + get: function () { + preIterVisible = true; + return 11; + }, + configurable: true + }); + + Object.defineProperty(obj, "1", { + get: function () { + if (preIterVisible) { + return 9; + } else { + return 13; + } + }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-3.js index 74d590199..0a6a6700b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-3.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.18/15.4.4.18-7-c-i-3.js
- * @description Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
-
- var kValue = "abc";
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 5) {
- testResult = (val === kValue);
- }
- }
-
- var proto = { 5: 100 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child[5] = kValue;
- child.length = 10;
-
- Array.prototype.forEach.call(child, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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"; + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 5) { + testResult = (val === kValue); + } + } + + var proto = { 5: 100 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child[5] = kValue; + child.length = 10; + + Array.prototype.forEach.call(child, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-30.js index 65a0fa917..d5b99a591 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-30.js
- * @description Array.prototype.forEach - unnhandled 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.forEach.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.forEach - unnhandled 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.forEach.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.18/15.4.4.18-7-c-i-31.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-31.js index e041ff16f..3656709d5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-31.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-31.js
- * @description Array.prototype.forEach - unnhandled exceptions happened in getter terminate iteration on an Array-like object
- */
-
-
-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.forEach(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.forEach - unnhandled exceptions happened in getter + terminate iteration on an Array-like object +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.forEach(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.18/15.4.4.18-7-c-i-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-4.js index 4f8f016f9..922afb196 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-4.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.18/15.4.4.18-7-c-i-4.js
- * @description Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 12);
- }
- }
-
- try {
- Array.prototype[0] = 11;
-
- [12].forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is own data + property that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 12); + } + } + + try { + Array.prototype[0] = 11; + + [12].forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-5.js index 4f5962e3e..e8f411e15 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-5.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.18/15.4.4.18-7-c-i-5.js
- * @description Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- var proto = {};
-
- Object.defineProperty(proto, "0", {
- get: function () {
- return 5;
- },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 2;
- Object.defineProperty(child, "0", {
- value: 11,
- configurable: true
- });
-
- Array.prototype.forEach.call(child, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 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 testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + var proto = {}; + + Object.defineProperty(proto, "0", { + get: function () { + return 5; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 2; + Object.defineProperty(child, "0", { + value: 11, + configurable: true + }); + + Array.prototype.forEach.call(child, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-6.js index e0a2300c3..3551ba87e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-i-6.js
- * @description Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 9;
- },
- configurable: true
- });
-
- [11].forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is own data + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 9; + }, + configurable: true + }); + + [11].forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-7.js index 3397b227a..d428b8f31 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-7.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.18/15.4.4.18-7-c-i-7.js
- * @description Array.prototype.forEach - element to be retrieved is inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = 'abc';
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 5) {
- testResult = (val === kValue);
- }
- }
-
- var proto = { 5: kValue };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 10;
-
- Array.prototype.forEach.call(child, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is inherited + data property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = 'abc'; + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 5) { + testResult = (val === kValue); + } + } + + var proto = { 5: kValue }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 10; + + Array.prototype.forEach.call(child, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-8.js index 1b1d09052..de6517745 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-8.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.18/15.4.4.18-7-c-i-8.js
- * @description Array.prototype.forEach - element to be retrieved is inherited data property on an Array
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- testResult = (val === 13);
- }
- }
-
- try {
- Array.prototype[1] = 13;
-
- [, , , ].forEach(callbackfn);
-
- return testResult;
- } 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.forEach - element to be retrieved is inherited + data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 1) { + testResult = (val === 13); + } + } + + try { + Array.prototype[1] = 13; + + [, , , ].forEach(callbackfn); + + return testResult; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-9.js index f2869ff6d..81bec442c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-9.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-9.js
- * @description Array.prototype.forEach - element to be retrieved is own accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- var testResult = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- testResult = (val === 11);
- }
- }
-
- var obj = { 10: 10, length: 20 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- Array.prototype.forEach.call(obj, callbackfn);
-
- return testResult;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element to be retrieved is own accessor + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var testResult = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + testResult = (val === 11); + } + } + + var obj = { 10: 10, length: 20 }; + + Object.defineProperty(obj, "0", { + get: function () { + return 11; + }, + configurable: true + }); + + Array.prototype.forEach.call(obj, callbackfn); + + return testResult; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-1.js index 370b848b0..ed461ae2d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-1.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.18/15.4.4.18-7-c-ii-1.js
- * @description Array.prototype.forEach - 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 arr = [0,1,true,null,new Object(),"five"];
- arr[999999] = -6.6;
- arr.forEach(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.forEach - 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 arr = [0,1,true,null,new Object(),"five"]; + arr[999999] = -6.6; + arr.forEach(callbackfn); + if(bCalled === true && bPar === true) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-10.js index 21613ef03..1cd6b6a75 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-10.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.18/15.4.4.18-7-c-ii-10.js
- * @description Array.prototype.forEach - callbackfn is called with 1 formal parameter
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val) {
- result = (val > 10);
- }
-
- [11].forEach(callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - callbackfn is called with 1 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val) { + result = (val > 10); + } + + [11].forEach(callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-11.js index b16202909..b175409ac 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-11.js @@ -1,22 +1,24 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-11.js
- * @description Array.prototype.forEach - callbackfn is called with 2 formal parameter
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx) {
- result = (val > 10 && arguments[2][idx] === val);
- }
-
- [11].forEach(callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - callbackfn is called with 2 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx) { + result = (val > 10 && arguments[2][idx] === val); + } + + [11].forEach(callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-12.js index bf20a006b..93316c067 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-12.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.18/15.4.4.18-7-c-ii-12.js
- * @description Array.prototype.forEach - callbackfn is called with 3 formal parameter
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (val > 10 && obj[idx] === val);
- }
-
- [11].forEach(callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - callbackfn is called with 3 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (val > 10 && obj[idx] === val); + } + + [11].forEach(callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-13.js index 8d0ae4195..7cd9e8294 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-13.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.18/15.4.4.18-7-c-ii-13.js
- * @description Array.prototype.forEach - callbackfn that uses arguments
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn() {
- result = (arguments[2][arguments[1]] === arguments[0]);
- }
-
- [11].forEach(callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.forEach - callbackfn that uses arguments +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn() { + result = (arguments[2][arguments[1]] === arguments[0]); + } + + [11].forEach(callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-16.js index d89d5a5a2..42ef99b9a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-ii-16.js
- * @description Array.prototype.forEach - 'this' of 'callbackfn' is a Boolean object when T is not an object (T is a boolean)
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (this.valueOf() !== false);
- }
-
- var obj = { 0: 11, length: 2 };
-
- Array.prototype.forEach.call(obj, callbackfn, false);
- return !result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'this' of 'callbackfn' is a Boolean + object when T is not an object (T is a boolean) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (this.valueOf() !== false); + } + + var obj = { 0: 11, length: 2 }; + + Array.prototype.forEach.call(obj, callbackfn, false); + return !result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-17.js index 35218a9fb..44574c03c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-ii-17.js
- * @description Array.prototype.forEach - 'this' of 'callbackfn' is a Number object when T is not an object (T is a number)
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, o) {
- result = (5 === this.valueOf());
- }
-
- var obj = { 0: 11, length: 2 };
-
- Array.prototype.forEach.call(obj, callbackfn, 5);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'this' of 'callbackfn' is a Number + object when T is not an object (T is a number) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, o) { + result = (5 === this.valueOf()); + } + + var obj = { 0: 11, length: 2 }; + + Array.prototype.forEach.call(obj, callbackfn, 5); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-18.js index dc48561c7..f0374fd76 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-ii-18.js
- * @description Array.prototype.forEach - 'this' of 'callbackfn' is an String object when T is not an object (T is a string)
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = ('hello' === this.valueOf());
- }
-
- var obj = { 0: 11, length: 2 };
-
- Array.prototype.forEach.call(obj, callbackfn, "hello");
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - 'this' of 'callbackfn' is an String + object when T is not an object (T is a string) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = ('hello' === this.valueOf()); + } + + var obj = { 0: 11, length: 2 }; + + Array.prototype.forEach.call(obj, callbackfn, "hello"); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-19.js index 59a658afe..fcac08620 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-19.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.18/15.4.4.18-7-c-ii-19.js
- * @description Array.prototype.forEach - non-indexed properties are not called
- */
-
-
-function testcase() {
-
- var accessed = false;
- var result = true;
- function callbackfn(val, idx, obj) {
- accessed = true;
- if (val === 8) {
- result = false;
- }
- }
-
- var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 };
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result && 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.forEach - non-indexed properties are not called +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var result = true; + function callbackfn(val, idx, obj) { + accessed = true; + if (val === 8) { + result = false; + } + } + + var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 }; + + Array.prototype.forEach.call(obj, callbackfn); + return result && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-2.js index 301ad0d00..fbff98eca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-2.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.18/15.4.4.18-7-c-ii-2.js
- * @description Array.prototype.forEach - 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 arr = [0,1,2,3,4,5,6,7,8,9];
- arr.forEach(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.forEach - 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 arr = [0,1,2,3,4,5,6,7,8,9]; + arr.forEach(callbackfn); + if(bCalled === true && parCnt === 3) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-20.js index 176866e5a..81014ae81 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-ii-20.js
- * @description Array.prototype.forEach - callbackfn called with correct parameters (thisArg is correct)
- */
-
-
-function testcase() {
-
- var result = false;
- function callbackfn(val, idx, obj) {
- result = (10 === this.threshold);
- }
-
- var thisArg = { threshold: 10 };
-
- var obj = { 0: 11, length: 1 };
-
- Array.prototype.forEach.call(obj, callbackfn, thisArg);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - callbackfn called with correct + parameters (thisArg is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + function callbackfn(val, idx, obj) { + result = (10 === this.threshold); + } + + var thisArg = { threshold: 10 }; + + var obj = { 0: 11, length: 1 }; + + Array.prototype.forEach.call(obj, callbackfn, thisArg); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-21.js index aa5432b35..c11ad0ed1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-21.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.18/15.4.4.18-7-c-ii-21.js
- * @description Array.prototype.forEach - callbackfn called with correct parameters (kValue is correct)
- */
-
-
-function testcase() {
-
- var resultOne = false;
- var resultTwo = false;
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- resultOne = (val === 11);
- }
-
- if (idx === 1) {
- resultTwo = (val === 12);
- }
-
- }
-
- var obj = { 0: 11, 1: 12, length: 2 };
-
- Array.prototype.forEach.call(obj, callbackfn);
- return resultOne && resultTwo;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - callbackfn called with correct + parameters (kValue is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var resultOne = false; + var resultTwo = false; + + function callbackfn(val, idx, obj) { + if (idx === 0) { + resultOne = (val === 11); + } + + if (idx === 1) { + resultTwo = (val === 12); + } + + } + + var obj = { 0: 11, 1: 12, length: 2 }; + + Array.prototype.forEach.call(obj, callbackfn); + return resultOne && resultTwo; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-22.js index fa09807fd..ed1fb7f30 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-22.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.18/15.4.4.18-7-c-ii-22.js
- * @description Array.prototype.forEach - callbackfn called with correct parameters (the index k is correct)
- */
-
-
-function testcase() {
-
- var resultOne = false;
- var resultTwo = false;
-
- function callbackfn(val, idx, obj) {
- if (val === 11) {
- resultOne = (idx === 0);
- }
-
- if (val === 12) {
- resultTwo = (idx === 1);
- }
-
- }
-
- var obj = { 0: 11, 1: 12, length: 2 };
-
- Array.prototype.forEach.call(obj, callbackfn);
- return resultOne && resultTwo;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - callbackfn called with correct + parameters (the index k is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var resultOne = false; + var resultTwo = false; + + function callbackfn(val, idx, obj) { + if (val === 11) { + resultOne = (idx === 0); + } + + if (val === 12) { + resultTwo = (idx === 1); + } + + } + + var obj = { 0: 11, 1: 12, length: 2 }; + + Array.prototype.forEach.call(obj, callbackfn); + return resultOne && resultTwo; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-23.js index d4efb25f3..dbfe55f17 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-ii-23.js
- * @description Array.prototype.forEach - callbackfn called with correct parameters (this object O is correct)
- */
-
-
-function testcase() {
-
- var result = false;
- var obj = { 0: 11, length: 2 };
-
- function callbackfn(val, idx, o) {
- result = (obj === o);
- }
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - callbackfn called with correct + parameters (this object O is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var obj = { 0: 11, length: 2 }; + + function callbackfn(val, idx, o) { + result = (obj === o); + } + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-4.js index 2937acc1a..c1f876102 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-4.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.18/15.4.4.18-7-c-ii-4.js
- * @description Array.prototype.forEach - k values are passed in ascending 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.forEach(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.forEach - k values are passed in ascending 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.forEach(callbackfn); + return result && arr.length === called; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-5.js index 005df5350..6c2b0569c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-5.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.18/15.4.4.18-7-c-ii-5.js
- * @description Array.prototype.forEach - k values are accessed during each iteration and not prior to starting the loop on an Array
- */
-
-
-function testcase() {
-
- var result = true;
- 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") {
- result = false;
- }
- kIndex[idx] = 1;
- } else {
- result = false;
- }
- }
-
- [11, 12, 13, 14].forEach(callbackfn, undefined);
-
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - k values are accessed during each + iteration and not prior to starting the loop on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = true; + 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") { + result = false; + } + kIndex[idx] = 1; + } else { + result = false; + } + } + + [11, 12, 13, 14].forEach(callbackfn, undefined); + + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-6.js index aaa79032f..9afc50ff6 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-6.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.18/15.4.4.18-7-c-ii-6.js
- * @description Array.prototype.forEach - arguments to callbackfn are self consistent
- */
-
-
-function testcase() {
-
- var result = false;
- var obj = { 0: 11, length: 1 };
- var thisArg = {};
-
- function callbackfn() {
- result = (this === thisArg &&
- arguments[0] === 11 &&
- arguments[1] === 0 &&
- arguments[2] === obj);
- }
-
- Array.prototype.forEach.call(obj, callbackfn, thisArg);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - arguments to callbackfn are self + consistent +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var obj = { 0: 11, length: 1 }; + var thisArg = {}; + + function callbackfn() { + result = (this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj); + } + + Array.prototype.forEach.call(obj, callbackfn, thisArg); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-7.js index e916f666c..0fbbbfc5f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-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.18/15.4.4.18-7-c-ii-7.js
- * @description Array.prototype.forEach - 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.forEach.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.forEach - 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.forEach.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.18/15.4.4.18-7-c-ii-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-8.js index 34bc9ea23..b52c3df40 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-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.18/15.4.4.18-7-c-ii-8.js
- * @description Array.prototype.forEach - element changed by callbackfn on previous iterations is observed
- */
-
-
-function testcase() {
-
- var result = false;
- var obj = { 0: 11, 1: 12, length: 2 };
-
- function callbackfn(val, idx, o) {
- if (idx === 0) {
- obj[idx + 1] = 8;
- }
-
- if (idx === 1) {
- result = (val === 8);
- }
- }
-
- Array.prototype.forEach.call(obj, callbackfn);
- return result;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.forEach - element changed by callbackfn on + previous iterations is observed +includes: [runTestCase.js] +---*/ + +function testcase() { + + var result = false; + var obj = { 0: 11, 1: 12, length: 2 }; + + function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } + + if (idx === 1) { + result = (val === 8); + } + } + + Array.prototype.forEach.call(obj, callbackfn); + return result; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-9.js index 29913da33..4d6dc1b1a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-ii-9.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.18/15.4.4.18-7-c-ii-9.js
- * @description Array.prototype.forEach - callbackfn is called with 0 formal parameter
- */
-
-
-function testcase() {
-
- var called = 0;
- function callbackfn() {
- called++;
- }
-
- [11, 12].forEach(callbackfn);
- return 2 === 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.forEach - callbackfn is called with 0 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + var called = 0; + function callbackfn() { + called++; + } + + [11, 12].forEach(callbackfn); + return 2 === called; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-1.js index 53a6663f1..f5b8d0124 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-1.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-1.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (empty array)
- */
-
-
-function testcase() {
- var callCnt = 0;
- function cb(){callCnt++}
- var i = [].forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (empty array) +includes: [runTestCase.js] +---*/ + +function testcase() { + var callCnt = 0; + function cb(){callCnt++} + var i = [].forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-10.js index be63e955c..b7ba34057 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-10.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.18/15.4.4.18-8-10.js
- * @description Array.prototype.forEach - subclassed array when length is reduced
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = 1;
-
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (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.forEach - 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; + + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-11.js index 5e43d48cd..b47f1dff5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-11.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.18/15.4.4.18-8-11.js
- * @description Array.prototype.forEach doesn't mutate the array on which it is called on
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- return true;
- }
- var arr = [1,2,3,4,5];
- arr.forEach(callbackfn);
- if(arr[0] === 1 &&
- arr[1] === 2 &&
- arr[2] === 3 &&
- arr[3] === 4 &&
- arr[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.forEach doesn't mutate the array on which it is + called on +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + return true; + } + var arr = [1,2,3,4,5]; + arr.forEach(callbackfn); + if(arr[0] === 1 && + arr[1] === 2 && + arr[2] === 3 && + arr[3] === 4 && + arr[4] === 5) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-12.js index bb8620a3e..7c0e15b36 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-12.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.18/15.4.4.18-8-12.js
- * @description Array.prototype.forEach doesn't visit expandos
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- callCnt++;
- }
- var arr = [1,2,3,4,5];
- arr["i"] = 10;
- arr[true] = 11;
-
- arr.forEach(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.forEach doesn't visit expandos +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + } + var arr = [1,2,3,4,5]; + arr["i"] = 10; + arr[true] = 11; + + arr.forEach(callbackfn); + if(callCnt == 5) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-13.js index 649e2acac..4a0508241 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-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.18/15.4.4.18-8-13.js
- * @description Array.prototype.forEach - undefined will be returned when 'len' is 0
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- }
-
- var result = [].forEach(callbackfn);
- return typeof result === "undefined" && !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.forEach - undefined will be returned when 'len' is + 0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + } + + var result = [].forEach(callbackfn); + return typeof result === "undefined" && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-2.js index c0c9e2375..61c5708b7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-2.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.18/15.4.4.18-8-2.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden to null (type conversion))
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = null;
-
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden to null (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = null; + + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-3.js index 7858b392e..b04d3378f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-3.js @@ -1,25 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-3.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden to false (type conversion))
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = false;
-
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden to false (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = false; + + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-4.js index 6b7fcf2dc..599e74647 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-4.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.18/15.4.4.18-8-4.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden to 0 (type conversion))
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = 0;
-
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden to 0 (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = 0; + + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-5.js index 09d29fe89..a9cda884a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-5.js @@ -1,25 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-5.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden to '0' (type conversion))
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = '0';
-
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden to '0' (type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = '0'; + + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-6.js index 2177459b9..99039c2f3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-6.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-6.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden with obj with valueOf)
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
-
- var o = { valueOf: function () { return 0;}};
- f.length = o;
-
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden with obj with valueOf) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + + var o = { valueOf: function () { return 0;}}; + f.length = o; + + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-7.js index 3259b15ab..70c543b8d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-7.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.18/15.4.4.18-8-7.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden with obj w/o valueOf (toString))
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
-
- var o = { toString: function () { return '0';}};
- f.length = o;
-
- // objects inherit the default valueOf method of the Object object;
- // that simply returns the itself. Since the default valueOf() method
- // does not return a primitive value, ES next tries to convert the object
- // to a number by calling its toString() method and converting the
- // resulting string to a number.
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden with obj w/o valueOf + (toString)) +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + + var o = { toString: function () { return '0';}}; + f.length = o; + + // objects inherit the default valueOf method of the Object object; + // that simply returns the itself. Since the default valueOf() method + // does not return a primitive value, ES next tries to convert the object + // to a number by calling its toString() method and converting the + // resulting string to a number. + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-8.js index fe25b5c16..9df017f77 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-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.18/15.4.4.18-8-8.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden with []
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- 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.
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden with [] +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + 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. + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-9.js index 5b6cffec5..0b85e5fbe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-8-9.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.18/15.4.4.18-8-9.js
- * @description Array.prototype.forEach doesn't call callbackfn if 'length' is 0 (subclassed Array, length overridden with [0]
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
-
- f.length = [0];
-
- // objects inherit the default valueOf method of the Object object;
- // that simply returns the itself. Since the default valueOf() method
- // does not return a primitive value, ES next tries to convert the object
- // to a number by calling its toString() method and converting the
- // resulting string to a number.
- //
- // The toString( ) method on Array converts the array elements to strings,
- // then returns the result of concatenating these strings, with commas in
- // between. An array with no elements converts to the empty string, which
- // converts to the number 0. If an array has a single element that is a
- // number n, the array converts to a string representation of n, which is
- // then converted back to n itself. If an array contains more than one element,
- // or if its one element is not a number, the array converts to NaN.
-
- var callCnt = 0;
- function cb(){callCnt++}
- var i = f.forEach(cb);
- if (callCnt === 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.forEach doesn't call callbackfn if 'length' is 0 + (subclassed Array, length overridden with [0] +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + + f.length = [0]; + + // objects inherit the default valueOf method of the Object object; + // that simply returns the itself. Since the default valueOf() method + // does not return a primitive value, ES next tries to convert the object + // to a number by calling its toString() method and converting the + // resulting string to a number. + // + // The toString( ) method on Array converts the array elements to strings, + // then returns the result of concatenating these strings, with commas in + // between. An array with no elements converts to the empty string, which + // converts to the number 0. If an array has a single element that is a + // number n, the array converts to a string representation of n, which is + // then converted back to n itself. If an array contains more than one element, + // or if its one element is not a number, the array converts to NaN. + + var callCnt = 0; + function cb(){callCnt++} + var i = f.forEach(cb); + if (callCnt === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A1.js index f7c6db33a..452ce26fb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A1.js @@ -1,12 +1,9 @@ // Copyright 2011 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -/** - * array.forEach can be frozen while in progress - * - * @path ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A1.js - * @description Freezes array.forEach during a forEach to see if it works - */ +/*--- +info: array.forEach can be frozen while in progress +description: Freezes array.forEach during a forEach to see if it works +---*/ ['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); }); - diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A2.js index bc45d19ab..f1a436003 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A2.js @@ -1,15 +1,12 @@ // Copyright 2011 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -/** - * array.forEach can be frozen while in progress - * - * @path ch15/15.4/15.4.4/15.4.4.18/S15.4.4.18_A2.js - * @description Freezes array.forEach during a forEach to see if it works - */ +/*--- +info: array.forEach can be frozen while in progress +description: Freezes array.forEach during a forEach to see if it works +---*/ function foo() { ['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); }); } foo(); - |