diff options
Diffstat (limited to 'test/suite/ch15/15.4/15.4.4/15.4.4.20')
224 files changed, 6694 insertions, 6343 deletions
diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-0-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-0-1.js index df1216a65..14b546dde 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-0-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-0-1.js
- * @description Array.prototype.filter must exist as a function
- */
-
-
-function testcase() {
- var f = Array.prototype.filter;
- 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.filter must exist as a function +includes: [runTestCase.js] +---*/ + +function testcase() { + var f = Array.prototype.filter; + if (typeof(f) === "function") { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-0-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-0-2.js index 6ded42404..7202003b4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-0-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-0-2.js
- * @description Array.prototype.filter.length must be 1
- */
-
-
-function testcase() {
- if (Array.prototype.filter.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.filter.length must be 1 +includes: [runTestCase.js] +---*/ + +function testcase() { + if (Array.prototype.filter.length === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-1.js index e14c7f94d..aee27cb1f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-1-1.js
- * @description Array.prototype.filter applied to undefined throws a TypeError
- */
-
-
-function testcase() {
- try {
- Array.prototype.filter.call(undefined); // TypeError is thrown if value is 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.filter applied to undefined throws a TypeError +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.filter.call(undefined); // TypeError is thrown if value is 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.20/15.4.4.20-1-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-10.js index cd0e7e1c2..ef009ce58 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-10.js @@ -1,27 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-10.js
- * @description Array.prototype.filter applied to the Math object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return '[object Math]' === Object.prototype.toString.call(obj);
- }
-
- try {
- Math.length = 1;
- Math[0] = 1;
- var newArr = Array.prototype.filter.call(Math, callbackfn);
- return newArr[0] === 1;
- } 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.filter applied to the Math object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return '[object Math]' === Object.prototype.toString.call(obj); + } + + try { + Math.length = 1; + Math[0] = 1; + var newArr = Array.prototype.filter.call(Math, callbackfn); + return newArr[0] === 1; + } finally { + delete Math[0]; + delete Math.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-11.js index 58fcce06d..fe1c49763 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-11.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.20/15.4.4.20-1-11.js
- * @description Array.prototype.filter applied to Date object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof Date;
- }
-
- var obj = new Date();
- obj.length = 1;
- obj[0] = 1;
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr[0] === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to Date object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof Date; + } + + var obj = new Date(); + obj.length = 1; + obj[0] = 1; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr[0] === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-12.js index 157db3dac..da91e3ada 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-1-12.js
- * @description Array.prototype.filter applied to RegExp object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof RegExp;
- }
-
- var obj = new RegExp();
- obj.length = 2;
- obj[1] = true;
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr[0] === true;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to RegExp object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof RegExp; + } + + var obj = new RegExp(); + obj.length = 2; + obj[1] = true; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr[0] === true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-13.js index b00a43748..058e5a9a2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-1-13.js
- * @description Array.prototype.filter applied to the JSON object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return '[object JSON]' === Object.prototype.toString.call(JSON);
- }
-
- try {
- JSON.length = 1;
- JSON[0] = 1;
- var newArr = Array.prototype.filter.call(JSON, callbackfn);
- return newArr[0] === 1;
- } 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.filter applied to the JSON object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return '[object JSON]' === Object.prototype.toString.call(JSON); + } + + try { + JSON.length = 1; + JSON[0] = 1; + var newArr = Array.prototype.filter.call(JSON, callbackfn); + return newArr[0] === 1; + } finally { + delete JSON.length; + delete JSON[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-14.js index ce855f37d..8fcdd47ff 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-14.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.20/15.4.4.20-1-14.js
- * @description Array.prototype.filter applied to Error object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof Error;
- }
-
- var obj = new Error();
- obj.length = 1;
- obj[0] = 1;
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr[0] === 1;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to Error object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof Error; + } + + var obj = new Error(); + obj.length = 1; + obj[0] = 1; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr[0] === 1; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-15.js index 95f853652..b014e5ec5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-15.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.20/15.4.4.20-1-15.js
- * @description Array.prototype.filter applied to the Arguments object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return '[object Arguments]' === Object.prototype.toString.call(obj);
- }
-
- var obj = (function () {
- return arguments;
- }("a", "b"));
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr[0] === "a" && newArr[1] === "b";
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to the Arguments object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return '[object Arguments]' === Object.prototype.toString.call(obj); + } + + var obj = (function () { + return arguments; + }("a", "b")); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr[0] === "a" && newArr[1] === "b"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-2.js index f2f9646e7..b3f25e6f4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-1-2.js
- * @description Array.prototype.filter applied to null throws a TypeError
- */
-
-
-function testcase() {
- try {
- Array.prototype.filter.call(null);
- 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.filter applied to null throws a TypeError +includes: [runTestCase.js] +---*/ + +function testcase() { + try { + Array.prototype.filter.call(null); + return false; + } catch (ex) { + return ex instanceof TypeError; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-3.js index ee7b9157e..a4481101c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-3.js @@ -1,29 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-3.js
- * @description Array.prototype.filter applied to boolean primitive
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Boolean;
- }
-
- try {
- Boolean.prototype[0] = true;
- Boolean.prototype.length = 1;
-
- var newArr = Array.prototype.filter.call(false, callbackfn);
- return newArr[0] === true;
-
- } finally {
- delete Boolean.prototype[0];
- delete Boolean.prototype.length;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to boolean primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Boolean; + } + + try { + Boolean.prototype[0] = true; + Boolean.prototype.length = 1; + + var newArr = Array.prototype.filter.call(false, callbackfn); + return newArr[0] === true; + + } finally { + delete Boolean.prototype[0]; + delete Boolean.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-4.js index 1231de578..51be98f92 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-4.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.20/15.4.4.20-1-4.js
- * @description Array.prototype.filter applied to Boolean Object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof Boolean;
- }
-
- var obj = new Boolean(true);
- obj.length = 2;
- obj[0] = 11;
- obj[1] = 12;
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr[0] === 11 && newArr[1] === 12;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to Boolean Object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof Boolean; + } + + var obj = new Boolean(true); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr[0] === 11 && newArr[1] === 12; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-5.js index 12ca2c088..76135c2d2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-5.js @@ -1,28 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-5.js
- * @description Array.prototype.filter applied to number primitive
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof Number;
- }
-
- try {
- Number.prototype[0] = 1;
- Number.prototype.length = 1;
-
- var newArr = Array.prototype.filter.call(2.5, callbackfn);
- return newArr[0] === 1;
- } 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.filter applied to number primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof Number; + } + + try { + Number.prototype[0] = 1; + Number.prototype.length = 1; + + var newArr = Array.prototype.filter.call(2.5, callbackfn); + return newArr[0] === 1; + } 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.20/15.4.4.20-1-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-6.js index 8904040dd..1f58c5577 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-6.js @@ -1,26 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-6.js
- * @description Array.prototype.filter applied to Number object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof Number;
- }
-
- var obj = new Number(-128);
- obj.length = 2;
- obj[0] = 11;
- obj[1] = 12;
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr[0] === 11 && newArr[1] === 12;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to Number object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof Number; + } + + var obj = new Number(-128); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr[0] === 11 && newArr[1] === 12; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-7.js index bfcba1764..cdd74b04f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-7.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.20/15.4.4.20-1-7.js
- * @description Array.prototype.filter applied to string primitive
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof String;
- }
-
- var newArr = Array.prototype.filter.call("abc", callbackfn);
-
- return newArr[0] === "a";
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to string primitive +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof String; + } + + var newArr = Array.prototype.filter.call("abc", callbackfn); + + return newArr[0] === "a"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-8.js index ee9b550d6..658a92981 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-8.js @@ -1,22 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-8.js
- * @description Array.prototype.filter applied to String object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return obj instanceof String;
- }
-
- var obj = new String("abc");
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr[0] === "a";
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to String object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return obj instanceof String; + } + + var obj = new String("abc"); + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr[0] === "a"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-9.js index ee9ef957f..25177e862 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-1-9.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.20/15.4.4.20-1-9.js
- * @description Array.prototype.filter applied to Function object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj instanceof Function;
- }
-
- var obj = function (a, b) {
- return a + b;
- };
- obj[0] = 11;
- obj[1] = 9;
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr[0] === 11 && newArr[1] === 9;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter applied to Function object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj instanceof Function; + } + + var obj = function (a, b) { + return a + b; + }; + obj[0] = 11; + obj[1] = 9; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr[0] === 11 && newArr[1] === 9; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-1.js index 04b67cc34..782221171 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-1.js @@ -1,30 +1,32 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-1.js
- * @description Array.prototype.filter doesn't mutate the Array on which it is called on
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- return true;
- }
- var srcArr = [1,2,3,4,5];
- srcArr.filter(callbackfn);
- if(srcArr[0] === 1 &&
- srcArr[1] === 2 &&
- srcArr[2] === 3 &&
- srcArr[3] === 4 &&
- srcArr[4] === 5)
- {
- return true;
- }
-
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter doesn't mutate the Array on which it is + called on +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + return true; + } + var srcArr = [1,2,3,4,5]; + srcArr.filter(callbackfn); + if(srcArr[0] === 1 && + srcArr[1] === 2 && + srcArr[2] === 3 && + srcArr[3] === 4 && + srcArr[4] === 5) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-2.js index efbd3cf3f..0fdfe22a2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-2.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.20/15.4.4.20-10-2.js
- * @description Array.prototype.filter returns new Array with length equal to number of true returned by callbackfn
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- if(val % 2)
- return true;
- else
- return false;
- }
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.filter(callbackfn);
- if(resArr.length === 3 &&
- resArr[0] === 1 &&
- resArr[1] === 3 &&
- resArr[2] === 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.filter returns new Array with length equal to + number of true returned by callbackfn +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + if(val % 2) + return true; + else + return false; + } + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.filter(callbackfn); + if(resArr.length === 3 && + resArr[0] === 1 && + resArr[1] === 3 && + resArr[2] === 5) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-3.js index 411e55cd2..260579696 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-3.js @@ -1,26 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-3.js
- * @description Array.prototype.filter - subclassed array when length is reduced
- */
-
-
-function testcase() {
- foo.prototype = new Array(1, 2, 3);
- function foo() {}
- var f = new foo();
- f.length = 1;
-
- function cb(){return true;}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 1) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - subclassed array when length is reduced +includes: [runTestCase.js] +---*/ + +function testcase() { + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = 1; + + function cb(){return true;} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 1) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-4.js index fcaf25d7f..b07507087 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-4.js @@ -1,30 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-10-4.js
- * @description Array.prototype.filter doesn't visit expandos
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- callCnt++;
- }
- var srcArr = [1,2,3,4,5];
- srcArr["i"] = 10;
- srcArr[true] = 11;
-
- var resArr = srcArr.filter(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.filter doesn't visit expandos +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + } + var srcArr = [1,2,3,4,5]; + srcArr["i"] = 10; + srcArr[true] = 11; + + var resArr = srcArr.filter(callbackfn); + if(callCnt == 5) + { + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-1.js index 19661c4a0..d115cc621 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-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.20/15.4.4.20-2-1.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is own data property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj.length === 2;
- }
-
- var obj = {
- 0: 12,
- 1: 11,
- 2: 9,
- length: 2
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + own data property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj.length === 2; + } + + var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-10.js index e82a59bf5..a26bd4061 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-10.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is inherited accessor property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 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;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 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; + + var newArr = Array.prototype.filter.call(child, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-11.js index cfcc67614..612ef3d99 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-11.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.20/15.4.4.20-2-11.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is own accessor property without a get function
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = {
- 0: 11,
- 1: 12
- };
- Object.defineProperty(obj, "length", {
- set: function () { },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + own accessor property without a get function +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { + 0: 11, + 1: 12 + }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-12.js index e70c6efea..5686bf020 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-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.20/15.4.4.20-2-12.js
- * @description Array.prototype.filter - 'length' is own accessor property without a get function that overrides an inherited accessor property
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return 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
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 0 && !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.filter - 'length' is own accessor property without + a get function that overrides an inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return 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 + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 0 && !accessed; + } finally { + delete Object.prototype.length; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-13.js index 030f0b05c..104da7d25 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-13.js
- * @description Array.prototype.filter 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;
- return 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;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter 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; + return 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; + + var newArr = Array.prototype.filter.call(child, callbackfn); + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-14.js index 4beb887fb..f992fa562 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-14.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.20/15.4.4.20-2-14.js
- * @description Array.prototype.filter applied to the Array-like object that 'length property doesn't exist
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 11, 1: 12 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter 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; + return true; + } + + var obj = { 0: 11, 1: 12 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-15.js index 4c283d310..2e4de0278 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-15.js
- * @description Array.prototype.filter - 'length' is property of the global object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj.length === 2;
- }
-
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[0] = 12;
- fnGlobalObject()[1] = 11;
- fnGlobalObject()[2] = 9;
- fnGlobalObject().length = 2;
- var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn);
- return newArr.length === 2;
- } finally {
- delete fnGlobalObject()[0];
- delete fnGlobalObject()[1];
- delete fnGlobalObject()[2];
- fnGlobalObject().length = oldLen;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - 'length' is property of the global object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj.length === 2; + } + + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[0] = 12; + fnGlobalObject()[1] = 11; + fnGlobalObject()[2] = 9; + fnGlobalObject().length = 2; + var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); + return newArr.length === 2; + } finally { + delete fnGlobalObject()[0]; + delete fnGlobalObject()[1]; + delete fnGlobalObject()[2]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-17.js index 7eb84334a..dfdbea5aa 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-17.js @@ -1,25 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-17.js
- * @description Array.prototype.filter applied to the Arguments object, which implements its own property get method
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj.length === 2;
- }
-
- var func = function (a, b) {
- var newArr = Array.prototype.filter.call(arguments, callbackfn);
- return newArr.length === 2;
- };
-
- 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.filter applied to the Arguments object, which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj.length === 2; + } + + var func = function (a, b) { + var newArr = Array.prototype.filter.call(arguments, callbackfn); + return newArr.length === 2; + }; + + return func(12, 11); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-18.js index 3ae375579..d4418dd8b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-18.js
- * @description Array.prototype.filter applied to String object, which implements its own property get method
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj.length === 3;
- }
-
- var str = new String("012");
-
- var newArr = Array.prototype.filter.call(str, callbackfn);
- return newArr.length === 3;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to String object, which implements + its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj.length === 3; + } + + var str = new String("012"); + + var newArr = Array.prototype.filter.call(str, callbackfn); + return newArr.length === 3; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-19.js index 985494ba0..082af4630 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-19.js
- * @description Array.prototype.filter applied to Function object, which implements its own property get method
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj.length === 2;
- }
-
- var fun = function (a, b) {
- return a + b;
- };
- fun[0] = 12;
- fun[1] = 11;
- fun[2] = 9;
-
- var newArr = Array.prototype.filter.call(fun, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Function object, which + implements its own property get method +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj.length === 2; + } + + var fun = function (a, b) { + return a + b; + }; + fun[0] = 12; + fun[1] = 11; + fun[2] = 9; + + var newArr = Array.prototype.filter.call(fun, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-2.js index b8168332f..09cf57422 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-2.js
- * @description Array.prototype.filter - 'length' is own data property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj.length === 2;
- }
-
- var newArr = [12, 11].filter(callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - 'length' is own data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj.length === 2; + } + + var newArr = [12, 11].filter(callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-3.js index d6d538c0c..a252fe0dc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-3.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is an own data property that overrides an inherited data property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 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;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + an own data property that overrides an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 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; + + var newArr = Array.prototype.filter.call(child, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-4.js index 9b245fb71..69c6f3813 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-4.js
- * @description Array.prototype.filter - 'length' is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
-
- var arrProtoLen;
-
- function callbackfn(val, idx, obj) {
- return obj.length === 2;
- }
-
- try {
- arrProtoLen = Array.prototype.length;
- Array.prototype.length = 0;
- var newArr = [12, 11].filter(callbackfn);
- return newArr.length === 2;
- } finally {
- Array.prototype.length = arrProtoLen;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - 'length' is own data property that + overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arrProtoLen; + + function callbackfn(val, idx, obj) { + return obj.length === 2; + } + + try { + arrProtoLen = Array.prototype.length; + Array.prototype.length = 0; + var newArr = [12, 11].filter(callbackfn); + return newArr.length === 2; + } finally { + Array.prototype.length = arrProtoLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-5.js index 502f4004d..6171ce772 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-5.js
- * @description Array.prototype.filter to Array-like object, 'length' is an own data property that overrides an inherited accessor property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 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;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter to Array-like object, 'length' is an own + data property that overrides an inherited accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 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; + + var newArr = Array.prototype.filter.call(child, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-6.js index 556d4eadb..03379a585 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-6.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is an inherited data property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 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;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 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; + + var newArr = Array.prototype.filter.call(child, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-7.js index 0f1d1decc..bf7d47cce 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-7.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is an own accessor property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return obj.length === 2;
- }
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- return 2;
- },
- configurable: true
- });
-
- obj[0] = 12;
- obj[1] = 11;
- obj[2] = 9;
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + an own accessor property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return obj.length === 2; + } + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + return 2; + }, + configurable: true + }); + + obj[0] = 12; + obj[1] = 11; + obj[2] = 9; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-8.js index 6ccfee9bd..96fa34156 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-8.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is own accessor property that overrides an inherited data property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 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;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + own accessor property that overrides an inherited data property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 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; + + var newArr = Array.prototype.filter.call(child, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-9.js index da9a06660..e2affc1e8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-2-9.js
- * @description Array.prototype.filter applied to Array-like object, 'length' is an own accessor property that overrides an inherited accessor property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 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;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
- return newArr.length === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter applied to Array-like object, 'length' is + an own accessor property that overrides an inherited accessor + property +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 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; + + var newArr = Array.prototype.filter.call(child, callbackfn); + return newArr.length === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-1.js index 98af5183a..3ccb6b063 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-1.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.20/15.4.4.20-3-1.js
- * @description Array.prototype.filter - value of 'length' is undefined
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 0, 1: 1, length: undefined };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - value of 'length' is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { 0: 0, 1: 1, length: undefined }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-10.js index a512cfebd..bb2528963 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-3-10.js
- * @description Array.prototype.filter - value of 'length' is a number (value is NaN)
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 9, length: NaN };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of 'length' is a number (value is + NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { 0: 9, length: NaN }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-11.js index a20bc6ec8..99c04b73d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-11.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.20/15.4.4.20-3-11.js
- * @description Array.prototype.filter - 'length' is a string containing a positive number
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: "2" };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'length' is a string containing a + positive number +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: "2" }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.js index 001eddca5..750d50100 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-12.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.20/15.4.4.20-3-12.js
- * @description Array.prototype.filter - 'length' is a string containing a negative number
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: "-4294967294" };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'length' is a string containing a + negative number +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: "-4294967294" }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-13.js index 081a34ace..8d72bc68d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-13.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.20/15.4.4.20-3-13.js
- * @description Array.prototype.filter - 'length' is a string containing a decimal number
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: "2.5" };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'length' is a string containing a decimal + number +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: "2.5" }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js index 9c366d125..480708c64 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-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.20/15.4.4.20-3-14.js
- * @description Array.prototype.filter - 'length' is a string containing +/-Infinity
- */
-
-
-function testcase() {
-
- var accessed1 = false;
- var accessed2 = false;
- var accessed3 = false;
-
- function callbackfn1(val, idx, obj) {
- accessed1 = true;
- return true;
- }
-
- function callbackfn2(val, idx, obj) {
- accessed2 = true;
- return true;
- }
-
- function callbackfn3(val, idx, obj) {
- accessed3 = true;
- return true;
- }
-
- var obj1 = { 0: 9, length: "Infinity" };
- var obj2 = { 0: 9, length: "-Infinity" };
- var obj3 = { 0: 9, length: "+Infinity" };
-
- var newArr1 = Array.prototype.filter.call(obj1, callbackfn1);
- var newArr2 = Array.prototype.filter.call(obj2, callbackfn2);
- var newArr3 = Array.prototype.filter.call(obj3, callbackfn3);
-
- return !accessed1 && newArr1.length === 0 &&
- !accessed2 && newArr2.length === 0 &&
- !accessed3 && newArr3.length === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - '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; + return true; + } + + function callbackfn2(val, idx, obj) { + accessed2 = true; + return true; + } + + function callbackfn3(val, idx, obj) { + accessed3 = true; + return true; + } + + var obj1 = { 0: 9, length: "Infinity" }; + var obj2 = { 0: 9, length: "-Infinity" }; + var obj3 = { 0: 9, length: "+Infinity" }; + + var newArr1 = Array.prototype.filter.call(obj1, callbackfn1); + var newArr2 = Array.prototype.filter.call(obj2, callbackfn2); + var newArr3 = Array.prototype.filter.call(obj3, callbackfn3); + + return !accessed1 && newArr1.length === 0 && + !accessed2 && newArr2.length === 0 && + !accessed3 && newArr3.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-15.js index 3bb70bf7a..6f5b95bf3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-15.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.20/15.4.4.20-3-15.js
- * @description Array.prototype.filter - 'length' is a string containing an exponential number
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: "2E0" };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'length' is a string containing an + exponential number +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: "2E0" }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-16.js index 4614e4e28..1cfa3de72 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-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.20/15.4.4.20-3-16.js
- * @description Array.prototype.filter - 'length' is a string containing a hex number
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: "0x0002" };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'length' is a string containing a hex + number +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: "0x0002" }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-17.js index 77aa5f139..f42ac3c55 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-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.20/15.4.4.20-3-17.js
- * @description Array.prototype.filter - 'length' is a string containing a number with leading zeros
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: "0002.00" };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'length' is a string containing a number + with leading zeros +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: "0002.00" }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-18.js index a51bf0070..1a1ff3ecb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-3-18.js
- * @description Array.prototype.filter - 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;
- return true;
- }
-
- var obj = { 0: 9, length: "asdf!_" };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return !accessed && newArr.length === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - 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; + return true; + } + + var obj = { 0: 9, length: "asdf!_" }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return !accessed && newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-19.js index c800684f1..a9ac98f68 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-19.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.20/15.4.4.20-3-19.js
- * @description Array.prototype.filter - value of 'length' is an Object which has an own toString method.
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: {
- toString: function () {
- return '2';
- }
- }
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - value of 'length' is an Object which has + an own toString method. +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { + 1: 11, + 2: 9, + length: { + toString: function () { + return '2'; + } + } + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-2.js index 547a5dfd7..4a4624203 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-2.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-2.js
- * @description Array.prototype.filter applied on an Array-like object if 'length' is 1 (length overridden to true(type conversion))
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, 1: 9, length: true };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter applied on an Array-like object if 'length' + is 1 (length overridden to true(type conversion)) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, 1: 9, length: true }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-20.js index 2f57d4ec0..84ac90b78 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-20.js @@ -1,32 +1,34 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-20.js
- * @description Array.prototype.filter - value of 'length' is an Object which has an own valueOf method.
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: {
- valueOf: function () {
- return 2;
- }
- }
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - value of 'length' is an Object which has + an own valueOf method. +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function () { + return 2; + } + } + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-21.js index 9ccf1b566..30ffd4d3f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-21.js @@ -1,40 +1,43 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-21.js
- * @description Array.prototype.filter - 'length' is an object that has an own valueOf method that returns an object and toString method that returns a string
- */
-
-
-function testcase() {
-
- var firstStepOccured = false;
- var secondStepOccured = false;
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: {
- valueOf: function () {
- firstStepOccured = true;
- return {};
- },
- toString: function () {
- secondStepOccured = true;
- return '2';
- }
- }
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 11 && 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.filter - '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 firstStepOccured = false; + var secondStepOccured = false; + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function () { + firstStepOccured = true; + return {}; + }, + toString: function () { + secondStepOccured = true; + return '2'; + } + } + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11 && firstStepOccured && secondStepOccured; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-22.js index 46456d64d..82d0219f2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-22.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.20/15.4.4.20-3-22.js
- * @description Array.prototype.filter 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;
- return true;
- }
-
- var obj = {
- 1: 11,
- 2: 12,
-
- length: {
- valueOf: function () {
- firstStepOccured = true;
- return {};
- },
- toString: function () {
- secondStepOccured = true;
- return {};
- }
- }
- };
-
- try {
- Array.prototype.filter.call(obj, callbackfn);
- return false;
- } catch (ex) {
- return (ex instanceof TypeError) && !accessed && 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.filter 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; + return true; + } + + var obj = { + 1: 11, + 2: 12, + + length: { + valueOf: function () { + firstStepOccured = true; + return {}; + }, + toString: function () { + secondStepOccured = true; + return {}; + } + } + }; + + try { + Array.prototype.filter.call(obj, callbackfn); + return false; + } catch (ex) { + return (ex instanceof TypeError) && !accessed && firstStepOccured && secondStepOccured; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-23.js index 10f91bfb9..796f2e0fc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-23.js @@ -1,48 +1,50 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-23.js
- * @description Array.prototype.filter uses inherited valueOf method when 'length' is an object with an own toString and inherited valueOf methods
- */
-
-
-function testcase() {
-
- var valueOfAccessed = false;
- var toStringAccessed = false;
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- 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
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 11 && 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.filter uses inherited valueOf method when 'length' + is an object with an own toString and inherited valueOf methods +includes: [runTestCase.js] +---*/ + +function testcase() { + + var valueOfAccessed = false; + var toStringAccessed = false; + + function callbackfn(val, idx, obj) { + return true; + } + + 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 + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11 && valueOfAccessed && !toStringAccessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-24.js index a36919bc2..9ef0d86a9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-24.js @@ -1,28 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-24.js
- * @description Array.prototype.filter - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: 2.685
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - value of 'length' is a positive + non-integer, ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { + 1: 11, + 2: 9, + length: 2.685 + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js index c22a2e306..c5008fe82 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js @@ -1,28 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-25.js
- * @description Array.prototype.filter - value of 'length' is a negative non-integer, ensure truncation occurs in the proper direction
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = {
- 1: 11,
- 2: 9,
- length: -4294967294.5
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - value of 'length' is a negative + non-integer, ensure truncation occurs in the proper direction +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { + 1: 11, + 2: 9, + length: -4294967294.5 + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-28.js index 80ec2fc14..a0fb83952 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-28.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.20/15.4.4.20-3-28.js
- * @description Array.prototype.filter - value of 'length' is boundary value (2^32)
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = {
- 0: 12,
- length: 4294967296
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return !accessed && newArr.length === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - value of 'length' is boundary value (2^32) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { + 0: 12, + length: 4294967296 + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return !accessed && newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-29.js index be0ebf1a9..bfca15263 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-29.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.20/15.4.4.20-3-29.js
- * @description Array.prototype.filter - value of 'length' is boundary value (2^32 + 1)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = {
- 0: 11,
- 1: 9,
- length: 4294967297
- };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - value of 'length' is boundary value (2^32 + + 1) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { + 0: 11, + 1: 9, + length: 4294967297 + }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-3.js index c7fe70417..1a02703bc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-3.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.20/15.4.4.20-3-3.js
- * @description Array.prototype.filter - value of 'length' is a number (value is 0)
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 11, length: 0 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - value of 'length' is a number (value is 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { 0: 11, length: 0 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-4.js index 8c23975a1..b60ff4900 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-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.20/15.4.4.20-3-4.js
- * @description Array.prototype.filter - value of 'length' is a number (value is +0)
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 11, length: +0 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of 'length' is a number (value is + +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { 0: 11, length: +0 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-5.js index 6a6ad1335..35c78a2eb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-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.20/15.4.4.20-3-5.js
- * @description Array.prototype.filter - value of 'length' is a number (value is -0)
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 11, length: -0 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of 'length' is a number (value is + -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { 0: 11, length: -0 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-6.js index cb2fa9e08..835353b9a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-6.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.20/15.4.4.20-3-6.js
- * @description Array.prototype.filter - value of 'length' is a number (value is positive)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: 2 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - value of 'length' is a number (value is + positive) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: 2 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js index 59e1cf19b..bc98b776a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-7.js
- * @description Array.prototype.filter - value of 'length' is a number (value is negative)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 1: 11, 2: 9, length: -4294967294 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - value of 'length' is a number (value is + negative) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 1: 11, 2: 9, length: -4294967294 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-8.js index dd0e1706f..e9a03cb34 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-8.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.20/15.4.4.20-3-8.js
- * @description Array.prototype.filter - value of 'length' is a number (value is Infinity)
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 9, length: Infinity };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of 'length' is a number (value is + Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { 0: 9, length: Infinity }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-9.js index 343c6eb9f..29fe65de3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-3-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-3-9.js
- * @description Array.prototype.filter - value of 'length' is a number (value is -Infinity)
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- accessed = true;
- return true;
- }
-
- var obj = { 0: 9, length: -Infinity };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && !accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of 'length' is a number (value is + -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } + + var obj = { 0: 9, length: -Infinity }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && !accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-1.js index 434f4849b..cc01b28f5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-1.js
- * @description Array.prototype.filter throws TypeError if callbackfn is undefined
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.filter();
- }
- 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.filter throws TypeError if callbackfn is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.filter(); + } + catch(e) { + if(e instanceof TypeError) + return true; + } + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-10.js index 435bbbe67..d08830b1c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-10.js
- * @description Array.prototype.filter - 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.filter.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.filter - 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.filter.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.20/15.4.4.20-4-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-11.js index 62fdbdafd..a8ab83875 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-11.js
- * @description Array.prototype.filter - 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.filter.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.filter - 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.filter.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.20/15.4.4.20-4-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-12.js index c81a2f28c..84698f3a5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-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.20/15.4.4.20-4-12.js
- * @description Array.prototype.filter - 'callbackfn' is a function
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 1) {
- return val === 9;
- }
- return false;
- }
-
- var newArr = [11, 9].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 9;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - 'callbackfn' is a function +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 9; + } + return false; + } + + var newArr = [11, 9].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 9; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-15.js index 3c9fbb82d..dddeb6169 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-15.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.20/15.4.4.20-4-15.js
- * @description Array.prototype.filter - 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.filter.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.filter - 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.filter.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.20/15.4.4.20-4-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-2.js index 14f5c2645..31cc74e56 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-2.js
- * @description Array.prototype.filter throws ReferenceError if callbackfn is unreferenced
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.filter(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.filter throws ReferenceError if callbackfn is + unreferenced +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.filter(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.20/15.4.4.20-4-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-3.js index 38963334b..6a4adf76b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-3.js
- * @description Array.prototype.filter throws TypeError if callbackfn is null
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.filter(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.filter throws TypeError if callbackfn is null +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.filter(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.20/15.4.4.20-4-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-4.js index 01794a530..9d563d51c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-4.js
- * @description Array.prototype.filter throws TypeError if callbackfn is boolean
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.filter(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.filter throws TypeError if callbackfn is boolean +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.filter(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.20/15.4.4.20-4-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-5.js index 3f8a51201..ab0194799 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-5.js
- * @description Array.prototype.filter throws TypeError if callbackfn is number
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.filter(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.filter throws TypeError if callbackfn is number +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.filter(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.20/15.4.4.20-4-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-6.js index fd83a8237..624de0772 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-6.js
- * @description Array.prototype.filter throws TypeError if callbackfn is string
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.filter("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.filter throws TypeError if callbackfn is string +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.filter("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.20/15.4.4.20-4-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-7.js index 3b881d868..08f8b05eb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-7.js
- * @description Array.prototype.filter throws TypeError if callbackfn is Object without [[Call]] internal method
- */
-
-
-function testcase() {
-
- var arr = new Array(10);
- try {
- arr.filter(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.filter throws TypeError if callbackfn is Object + without [[Call]] internal method +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = new Array(10); + try { + arr.filter(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.20/15.4.4.20-4-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-8.js index 9c0da9ad9..df9259ece 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-8.js
- * @description Array.prototype.filter - 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.filter.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.filter - 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.filter.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.20/15.4.4.20-4-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-9.js index 686a4c595..b4a31147f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-4-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-4-9.js
- * @description Array.prototype.filter - 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.filter.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.filter - 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.filter.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.20/15.4.4.20-5-1-s.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js index cff026b7c..9e0e628d4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-5-1-s.js
- * @description Array.prototype.filter - 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].filter(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.filter - 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].filter(callbackfn); + return innerThisCorrect; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js index 0d39bfd6e..3d6e9fb66 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-5-1.js
- * @description Array.prototype.filter - thisArg is passed
- */
-
-
-function testcase() {
- this._15_4_4_20_5_1 = false;
- var _15_4_4_20_5_1 = true;
-
- function callbackfn(val, idx, obj) {
- return this._15_4_4_20_5_1;
- }
- var srcArr = [1];
- var resArr = srcArr.filter(callbackfn);
- return resArr.length === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - thisArg is passed +includes: [runTestCase.js] +---*/ + +function testcase() { + this._15_4_4_20_5_1 = false; + var _15_4_4_20_5_1 = true; + + function callbackfn(val, idx, obj) { + return this._15_4_4_20_5_1; + } + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn); + return resArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-10.js index 88666e9ab..d14fc5d55 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-10.js @@ -1,27 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-10.js
- * @description Array.prototype.filter - Array Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
- var objArray = new Array(10);
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objArray;
- }
-
-
- var newArr = [11].filter(callbackfn, objArray);
-
- return newArr[0] === 11 && 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.filter - Array Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var objArray = new Array(10); + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objArray; + } + + + var newArr = [11].filter(callbackfn, objArray); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-11.js index cd233d0b0..e33996833 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-11.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.20/15.4.4.20-5-11.js
- * @description Array.prototype.filter - String Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
- var objString = new String();
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objString;
- }
-
- var newArr = [11].filter(callbackfn, objString);
-
- return newArr[0] === 11 && 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.filter - String Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var objString = new String(); + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objString; + } + + var newArr = [11].filter(callbackfn, objString); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-12.js index 068c4248c..b461873dc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-12.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.20/15.4.4.20-5-12.js
- * @description Array.prototype.filter - Boolean Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
- var objBoolean = new Boolean();
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objBoolean;
- }
-
- var newArr = [11].filter(callbackfn, objBoolean);
-
- return newArr[0] === 11 && 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.filter - Boolean Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var objBoolean = new Boolean(); + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objBoolean; + } + + var newArr = [11].filter(callbackfn, objBoolean); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-13.js index 103bb21fc..e097c50f2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-13.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.20/15.4.4.20-5-13.js
- * @description Array.prototype.filter - Number Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
- var objNumber = new Number();
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objNumber;
- }
-
- var newArr = [11].filter(callbackfn, objNumber);
-
- return newArr[0] === 11 && 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.filter - Number Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var objNumber = new Number(); + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objNumber; + } + + var newArr = [11].filter(callbackfn, objNumber); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-14.js index 396c63d9c..fbe9faeca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-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.20/15.4.4.20-5-14.js
- * @description Array.prototype.filter - the Math object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === Math;
- }
-
- var newArr = [11].filter(callbackfn, Math);
-
- return newArr[0] === 11 && 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.filter - the Math object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return this === Math; + } + + var newArr = [11].filter(callbackfn, Math); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-15.js index 92ba2038f..fc8fdf5a8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-15.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.20/15.4.4.20-5-15.js
- * @description Array.prototype.filter - Date Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- var objDate = new Date();
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objDate;
- }
-
- var newArr = [11].filter(callbackfn, objDate);
-
- return newArr[0] === 11 && 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.filter - Date Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + var objDate = new Date(); + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objDate; + } + + var newArr = [11].filter(callbackfn, objDate); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-16.js index 529070b4e..41e0eee8a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-16.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.20/15.4.4.20-5-16.js
- * @description Array.prototype.filter - RegExp Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- var objRegExp = new RegExp();
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objRegExp;
- }
-
- var newArr = [11].filter(callbackfn, objRegExp);
-
- return newArr[0] === 11 && 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.filter - RegExp Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + var objRegExp = new RegExp(); + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objRegExp; + } + + var newArr = [11].filter(callbackfn, objRegExp); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-17.js index ab56608aa..503e133d1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-17.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.20/15.4.4.20-5-17.js
- * @description Array.prototype.filter - the JSON object can be used as thisArg
- */
-
-
-function testcase() {
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === JSON;
- }
-
- var newArr = [11].filter(callbackfn, JSON);
-
- return newArr[0] === 11 && 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.filter - the JSON object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return this === JSON; + } + + var newArr = [11].filter(callbackfn, JSON); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-18.js index 699a11a84..e31eeca89 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-18.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.20/15.4.4.20-5-18.js
- * @description Array.prototype.filter - Error Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
- var objError = new RangeError();
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objError;
- }
-
- var newArr = [11].filter(callbackfn, objError);
-
- return newArr[0] === 11 && 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.filter - Error Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var objError = new RangeError(); + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objError; + } + + var newArr = [11].filter(callbackfn, objError); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-19.js index 7fbbcd6db..c6febfb1e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-19.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.20/15.4.4.20-5-19.js
- * @description Array.prototype.filter - the Arguments object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
- var arg;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === arg;
- }
-
- (function fun() {
- arg = arguments;
- }(1, 2, 3));
-
- var newArr = [11].filter(callbackfn, arg);
- return newArr[0] === 11 && 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.filter - the Arguments object can be used as + thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var arg; + + function callbackfn(val, idx, obj) { + accessed = true; + return this === arg; + } + + (function fun() { + arg = arguments; + }(1, 2, 3)); + + var newArr = [11].filter(callbackfn, arg); + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-2.js index 51f8f6d83..a830376fc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-2.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.20/15.4.4.20-5-2.js
- * @description Array.prototype.filter - thisArg is Object
- */
-
-
-function testcase() {
- var res = false;
- var o = new Object();
- o.res = true;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- var srcArr = [1];
- var resArr = srcArr.filter(callbackfn,o);
- if( resArr.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.filter - thisArg is Object +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var o = new Object(); + o.res = true; + function callbackfn(val, idx, obj) + { + return this.res; + } + + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,o); + if( resArr.length === 1) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-21.js index e4f2763de..bc5872101 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-21.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.20/15.4.4.20-5-21.js
- * @description Array.prototype.filter - the global object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === fnGlobalObject();
- }
-
- var newArr = [11].filter(callbackfn, fnGlobalObject());
-
- return newArr[0] === 11 && 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.filter - the global object can be used as thisArg +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return this === fnGlobalObject(); + } + + var newArr = [11].filter(callbackfn, fnGlobalObject()); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-22.js index 08804d5a5..277de410d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-22.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.20/15.4.4.20-5-22.js
- * @description Array.prototype.filter - boolean primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this.valueOf() === false;
- }
-
- var newArr = [11].filter(callbackfn, false);
-
- return newArr[0] === 11 && 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.filter - boolean primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === false; + } + + var newArr = [11].filter(callbackfn, false); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-23.js index aa9167d18..301483582 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-23.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.20/15.4.4.20-5-23.js
- * @description Array.prototype.filter - number primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this.valueOf() === 101;
- }
-
- var newArr = [11].filter(callbackfn, 101);
-
- return newArr[0] === 11 && 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.filter - number primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === 101; + } + + var newArr = [11].filter(callbackfn, 101); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-24.js index fd046462c..bbf5933a7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-24.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.20/15.4.4.20-5-24.js
- * @description Array.prototype.filter - string primitive can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this.valueOf() === "abc";
- }
-
- var newArr = [11].filter(callbackfn, "abc");
-
- return newArr[0] === 11 && 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.filter - string primitive can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === "abc"; + } + + var newArr = [11].filter(callbackfn, "abc"); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-27.js index 2cd66d7d9..a66daf450 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-27.js @@ -1,18 +1,20 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-27.js
- * @description Array.prototype.filter - Array.isArray(arg) returns true when arg is the returned array
- */
-
-
-function testcase() {
-
- var newArr = [11].filter(function () { });
-
- return Array.isArray(newArr);
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - Array.isArray(arg) returns true when arg + is the returned array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var newArr = [11].filter(function () { }); + + return Array.isArray(newArr); + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-28.js index 64cf6a350..9d0956a1b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-28.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.20/15.4.4.20-5-28.js
- * @description Array.prototype.filter - the returned array is instanceof Array
- */
-
-
-function testcase() {
-
- var newArr = [11].filter(function () { });
-
- return newArr instanceof Array;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - the returned array is instanceof Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var newArr = [11].filter(function () { }); + + return newArr instanceof Array; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-29.js index b9af88961..ba3314b8e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-29.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.20/15.4.4.20-5-29.js
- * @description Array.prototype.filter - returns an array whose length is 0
- */
-
-
-function testcase() {
-
- var newArr = [11].filter(function () { });
-
- return newArr.length === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - returns an array whose length is 0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var newArr = [11].filter(function () { }); + + return newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-3.js index 0bd6806da..3b0ee8661 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-3.js @@ -1,27 +1,27 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-3.js
- * @description Array.prototype.filter - thisArg is Array
- */
-
-
-function testcase() {
- var res = false;
- var a = new Array();
- a.res = true;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- var srcArr = [1];
- var resArr = srcArr.filter(callbackfn,a);
- if( resArr.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.filter - thisArg is Array +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + var a = new Array(); + a.res = true; + function callbackfn(val, idx, obj) + { + return this.res; + } + + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,a); + if( resArr.length === 1) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-30.js index e1596a799..7742c3b25 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-30.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.20/15.4.4.20-5-30.js
- * @description Array.prototype.filter - thisArg not passed
- */
-
-
-function testcase() {
- function innerObj() {
- this._15_4_4_20_5_30 = true;
- var _15_4_4_20_5_30 = false;
-
- function callbackfn(val, idx, obj) {
- return this._15_4_4_20_5_30;
- }
- var srcArr = [1];
- var resArr = srcArr.filter(callbackfn);
- this.retVal = resArr.length === 0;
- }
- 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.filter - thisArg not passed +includes: [runTestCase.js] +---*/ + +function testcase() { + function innerObj() { + this._15_4_4_20_5_30 = true; + var _15_4_4_20_5_30 = false; + + function callbackfn(val, idx, obj) { + return this._15_4_4_20_5_30; + } + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn); + this.retVal = resArr.length === 0; + } + return new innerObj().retVal; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-4.js index dfc8583e3..56b28df91 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-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.20/15.4.4.20-5-4.js
- * @description Array.prototype.filter - thisArg is object from object template(prototype)
- */
-
-
-function testcase() {
- var res = false;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- function foo(){}
- foo.prototype.res = true;
- var f = new foo();
-
- var srcArr = [1];
- var resArr = srcArr.filter(callbackfn,f);
- if( resArr.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.filter - thisArg is object from object + template(prototype) +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } + + function foo(){} + foo.prototype.res = true; + var f = new foo(); + + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,f); + if( resArr.length === 1) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-5.js index c86dc5194..23605afcb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-5.js @@ -1,29 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-5.js
- * @description Array.prototype.filter - thisArg is object from object template
- */
-
-
-function testcase() {
- var res = false;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- function foo(){}
- var f = new foo();
- f.res = true;
-
- var srcArr = [1];
- var resArr = srcArr.filter(callbackfn,f);
- if( resArr.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.filter - thisArg is object from object template +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } + + function foo(){} + var f = new foo(); + f.res = true; + + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,f); + if( resArr.length === 1) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-6.js index aa9f9b6ff..cfde52f99 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-6.js @@ -1,28 +1,28 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-6.js
- * @description Array.prototype.filter - thisArg is function
- */
-
-
-function testcase() {
- var res = false;
- function callbackfn(val, idx, obj)
- {
- return this.res;
- }
-
- function foo(){}
- foo.res = true;
-
- var srcArr = [1];
- var resArr = srcArr.filter(callbackfn,foo);
- if( resArr.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.filter - thisArg is function +includes: [runTestCase.js] +---*/ + +function testcase() { + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } + + function foo(){} + foo.res = true; + + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,foo); + if( resArr.length === 1) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-7.js index 430bb4238..a4c8a1470 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-7.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.20/15.4.4.20-5-7.js
- * @description Array.prototype.filter - built-in functions can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === eval;
- }
-
- var newArr = [11].filter(callbackfn, eval);
-
- return newArr[0] === 11 && 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.filter - built-in functions can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return this === eval; + } + + var newArr = [11].filter(callbackfn, eval); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-9.js index dd4e33147..affc77049 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-9.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.20/15.4.4.20-5-9.js
- * @description Array.prototype.filter - Function Object can be used as thisArg
- */
-
-
-function testcase() {
-
- var accessed = false;
- var objFunction = function () { };
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return this === objFunction;
- }
-
- var newArr = [11].filter(callbackfn, objFunction);
-
- return newArr[0] === 11 && 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.filter - Function Object can be used as thisArg +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + var objFunction = function () { }; + + function callbackfn(val, idx, obj) { + accessed = true; + return this === objFunction; + } + + var newArr = [11].filter(callbackfn, objFunction); + + return newArr[0] === 11 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-1.js index fab568d2c..2b437dd70 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-1.js @@ -1,20 +1,22 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-1.js
- * @description Array.prototype.filter returns an empty array if 'length' is 0 (empty array)
- */
-
-
-function testcase() {
- function cb(){}
- var a = [].filter(cb);
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array if 'length' is 0 + (empty array) +includes: [runTestCase.js] +---*/ + +function testcase() { + function cb(){} + var a = [].filter(cb); + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-2.js index 1f65e43c9..414016d4a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-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.20/15.4.4.20-6-2.js
- * @description Array.prototype.filter returns an empty array 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;
-
- function cb(){}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array 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; + + function cb(){} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-3.js index de83325a3..77d4050b2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-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.20/15.4.4.20-6-3.js
- * @description Array.prototype.filter returns an empty array 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;
-
- function cb(){}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array 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; + + function cb(){} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-4.js index 9d65eb3af..c26ee2cfd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-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.20/15.4.4.20-6-4.js
- * @description Array.prototype.filter returns an empty array 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;
-
- function cb(){}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array 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; + + function cb(){} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-5.js index 8ead2217f..c603be128 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-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.20/15.4.4.20-6-5.js
- * @description Array.prototype.filter returns an empty array 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';
-
- function cb(){}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array 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'; + + function cb(){} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-6.js index da854c1d3..a6cf00b5d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-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.20/15.4.4.20-6-6.js
- * @description Array.prototype.filter returns an empty array 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;
-
- function cb(){}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array 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; + + function cb(){} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-7.js index 43652d6e5..464928b9c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-7.js @@ -1,34 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-7.js
- * @description Array.prototype.filter returns an empty array 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.
-
- function cb(){}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array 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. + + function cb(){} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-8.js index 2efeab87b..07275eb49 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-6-8.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.20/15.4.4.20-6-8.js
- * @description Array.prototype.filter returns an empty array 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.
-
- function cb(){}
- var a = f.filter(cb);
-
- if (Array.isArray(a) &&
- a.length === 0) {
- return true;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter returns an empty array 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. + + function cb(){} + var a = f.filter(cb); + + if (Array.isArray(a) && + a.length === 0) { + return true; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-1.js index 69b7498bf..2ab4f2d54 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-1.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.20/15.4.4.20-9-1.js
- * @description Array.prototype.filter doesn't consider new elements added to array after it is called
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- srcArr[2] = 3;
- srcArr[5] = 6;
- return true;
- }
-
- var srcArr = [1, 2, , 4, 5];
- var resArr = srcArr.filter(callbackfn);
- return resArr.length === 5;
-
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter doesn't consider new elements added to + array after it is called +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + srcArr[2] = 3; + srcArr[5] = 6; + return true; + } + + var srcArr = [1, 2, , 4, 5]; + var resArr = srcArr.filter(callbackfn); + return resArr.length === 5; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-2.js index b6b5fc3e8..002eb054d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-2.js @@ -1,30 +1,32 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-2.js
- * @description Array.prototype.filter considers new value of elements in array after it is called
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- srcArr[2] = -1;
- srcArr[4] = -1;
- if(val > 0)
- return true;
- else
- return false;
- }
-
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.filter(callbackfn);
- if(resArr.length === 3 && resArr[0] === 1 && resArr[2] === 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.filter considers new value of elements in array + after it is called +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + srcArr[2] = -1; + srcArr[4] = -1; + if(val > 0) + return true; + else + return false; + } + + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.filter(callbackfn); + if(resArr.length === 3 && resArr[0] === 1 && resArr[2] === 4) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-3.js index f59db35c7..98ac4605e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-3.js @@ -1,30 +1,32 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-3.js
- * @description Array.prototype.filter doesn't visit deleted elements in array after the call
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- delete srcArr[2];
- delete srcArr[4];
- if(val > 0)
- return true;
- else
- return false;
- }
-
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.filter(callbackfn);
- if(resArr.length === 3 && resArr[0] === 1 && resArr[2] === 4 ) // two elements deleted
- 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.filter doesn't visit deleted elements in array + after the call +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + delete srcArr[2]; + delete srcArr[4]; + if(val > 0) + return true; + else + return false; + } + + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.filter(callbackfn); + if(resArr.length === 3 && resArr[0] === 1 && resArr[2] === 4 ) // two elements deleted + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-4.js index 7391b6ac9..adc0dbf3c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-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.20/15.4.4.20-9-4.js
- * @description Array.prototype.filter doesn't visit deleted elements when Array.length is decreased
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- srcArr.length = 2;
- return true;
- }
-
- var srcArr = [1,2,3,4,6];
- var resArr = srcArr.filter(callbackfn);
- if(resArr.length === 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.filter doesn't visit deleted elements when + Array.length is decreased +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + srcArr.length = 2; + return true; + } + + var srcArr = [1,2,3,4,6]; + var resArr = srcArr.filter(callbackfn); + if(resArr.length === 2 ) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-5.js index 3750be13e..be22b1567 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-5.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.20/15.4.4.20-9-5.js
- * @description Array.prototype.filter doesn't consider newly added elements in sparse array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- srcArr[1000] = 3;
- return true;
- }
-
- var srcArr = new Array(10);
- srcArr[1] = 1;
- srcArr[2] = 2;
- var resArr = srcArr.filter(callbackfn);
- if( resArr.length === 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.filter doesn't consider newly added elements in + sparse array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + srcArr[1000] = 3; + return true; + } + + var srcArr = new Array(10); + srcArr[1] = 1; + srcArr[2] = 2; + var resArr = srcArr.filter(callbackfn); + if( resArr.length === 2) + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-6.js index 268b946a3..5cdabcd34 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-6.js @@ -1,32 +1,34 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-6.js
- * @description Array.prototype.filter visits deleted element in array after the call when same index is also present in prototype
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj)
- {
- delete srcArr[2];
- delete srcArr[4];
- if(val > 0)
- return true;
- else
- return false;
- }
-
- Array.prototype[4] = 5;
- var srcArr = [1,2,3,4,5];
- var resArr = srcArr.filter(callbackfn);
- delete Array.prototype[4];
- if(resArr.length === 4 && resArr[0] === 1 && resArr[3] == 5) // only one element deleted
- 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.filter visits deleted element in array after the + call when same index is also present in prototype +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) + { + delete srcArr[2]; + delete srcArr[4]; + if(val > 0) + return true; + else + return false; + } + + Array.prototype[4] = 5; + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.filter(callbackfn); + delete Array.prototype[4]; + if(resArr.length === 4 && resArr[0] === 1 && resArr[3] == 5) // only one element deleted + return true; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-7.js index 940a89505..802fc917a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-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.20/15.4.4.20-9-7.js
- * @description Array.prototype.filter stops calling callbackfn once the array is deleted during the call
- */
-
-
-function testcase() {
- var o = new Object();
- o.srcArr = [1, 2, 3, 4, 5];
-
- function callbackfn(val, idx, obj) {
- delete o.srcArr;
- if (val > 0)
- return true;
- else
- return false;
- }
-
- var resArr = o.srcArr.filter(callbackfn);
- return resArr.length === 5 && typeof o.srcArr === "undefined";
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter stops calling callbackfn once the array is + deleted during the call +includes: [runTestCase.js] +---*/ + +function testcase() { + var o = new Object(); + o.srcArr = [1, 2, 3, 4, 5]; + + function callbackfn(val, idx, obj) { + delete o.srcArr; + if (val > 0) + return true; + else + return false; + } + + var resArr = o.srcArr.filter(callbackfn); + return resArr.length === 5 && typeof o.srcArr === "undefined"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-8.js index cfec8a475..5b2fd1e4d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-8.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.20/15.4.4.20-9-8.js
- * @description Array.prototype.filter - no observable effects occur if len is 0
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return val > 10;
- }
-
- var obj = { 0: 11, 1: 12, length: 0 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return accessed === false && obj.length === 0 && newArr.length === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - no observable effects occur if len is 0 +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; + } + + var obj = { 0: 11, 1: 12, length: 0 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return accessed === false && obj.length === 0 && newArr.length === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-9.js index 34bb276a4..4531fc28f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-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.20/15.4.4.20-9-9.js
- * @description Array.prototype.filter - modifications to length don't change number of iterations
- */
-
-
-function testcase() {
-
- var called = 0;
-
- function callbackfn(val, idx, obj) {
- called++;
- return true;
- }
-
- var obj = { 1: 12, 2: 9, length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- obj.length = 3;
- return 11;
- },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 2 && 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.filter - modifications to length don't change + number of iterations +includes: [runTestCase.js] +---*/ + +function testcase() { + + var called = 0; + + function callbackfn(val, idx, obj) { + called++; + return true; + } + + var obj = { 1: 12, 2: 9, length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + obj.length = 3; + return 11; + }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 2 && 2 === called; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-1.js index eeef37773..475efec5f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-1.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-1.js
- * @description Array.prototype.filter - callbackfn not called for indexes never been assigned values
- */
-
-
-function testcase() {
-
- var callCnt = 0;
- function callbackfn(val, idx, obj)
- {
- callCnt++;
- return false;
- }
-
- var srcArr = new Array(10);
- srcArr[1] = undefined; //explicitly assigning a value
- var resArr = srcArr.filter(callbackfn);
- if( resArr.length === 0 && 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.filter - callbackfn not called for indexes never + been assigned values +includes: [runTestCase.js] +---*/ + +function testcase() { + + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + return false; + } + + var srcArr = new Array(10); + srcArr[1] = undefined; //explicitly assigning a value + var resArr = srcArr.filter(callbackfn); + if( resArr.length === 0 && callCnt === 1) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-10.js index d84c01439..7be8704c0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-10.js @@ -1,36 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-10.js
- * @description Array.prototype.filter - deleting property of prototype causes prototype index property not to be visited on an Array-like Object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
- var obj = { 2: 2, length: 20 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- delete Object.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 2 && newArr[1] !== 1;
- } finally {
- delete Object.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - deleting property of prototype causes + prototype index property not to be visited on an Array-like Object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + var obj = { 2: 2, length: 20 }; + + Object.defineProperty(obj, "0", { + get: function () { + delete Object.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 2 && newArr[1] !== 1; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-11.js index 39a19babc..6852d5b98 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-11.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.20/15.4.4.20-9-b-11.js
- * @description Array.prototype.filter - deleting property of prototype causes prototype index property not to be visited on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete Array.prototype[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- var newArr = arr.filter(callbackfn);
- return newArr.length === 2 && newArr[1] !== 1;
- } finally {
- delete Array.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - deleting property of prototype causes + prototype index property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + delete Array.prototype[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + var newArr = arr.filter(callbackfn); + return newArr.length === 2 && newArr[1] !== 1; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-12.js index a3f6eb33d..c899a3511 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-12.js @@ -1,35 +1,38 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-12.js
- * @description Array.prototype.filter - deleting own property with prototype property causes prototype index property to be visited on an Array-like object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return true;
- }
- var obj = { 0: 0, 1: 111, 2: 2, length: 10 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- delete obj[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Object.prototype[1] = 1;
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 3 && newArr[1] === 1;
- } finally {
- delete Object.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - deleting own property with prototype + property causes prototype index property to be visited on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return true; + } + var obj = { 0: 0, 1: 111, 2: 2, length: 10 }; + + Object.defineProperty(obj, "0", { + get: function () { + delete obj[1]; + return 0; + }, + configurable: true + }); + + try { + Object.prototype[1] = 1; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 3 && newArr[1] === 1; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-13.js index e6d30405b..6b82dc098 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-13.js @@ -1,35 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-13.js
- * @description Array.prototype.filter - deleting own property with prototype property causes prototype index property to be visited on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val < 3 ? true : false;
- }
- var arr = [0, 111, 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- try {
- Array.prototype[1] = 1;
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 3 && newArr[1] === 1;
- } finally {
- delete Array.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - deleting own property with prototype + property causes prototype index property to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val < 3 ? true : false; + } + var arr = [0, 111, 2]; + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + try { + Array.prototype[1] = 1; + var newArr = arr.filter(callbackfn); + + return newArr.length === 3 && newArr[1] === 1; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-14.js index ac233d798..e7a6d2f0f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-14.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.20/15.4.4.20-9-b-14.js
- * @description Array.prototype.filter - decreasing length of array causes index property not to be visited
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
- var arr = [0, 1, 2, "last"];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- arr.length = 3;
- return 0;
- },
- configurable: true
- });
-
- var newArr = arr.filter(callbackfn);
-
-
- return newArr.length === 3 && newArr[2] === 2;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - decreasing length of array causes index + property not to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + var arr = [0, 1, 2, "last"]; + + Object.defineProperty(arr, "0", { + get: function () { + arr.length = 3; + return 0; + }, + configurable: true + }); + + var newArr = arr.filter(callbackfn); + + + return newArr.length === 3 && newArr[2] === 2; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-15.js index f510e0307..6ed40a454 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-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.20/15.4.4.20-9-b-15.js
- * @description Array.prototype.filter - decreasing length of array with prototype property causes prototype index property to be visited
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return true;
- }
- var arr = [0, 1, 2];
-
- try {
- Object.defineProperty(Array.prototype, "2", {
- get: function () {
- return "prototype";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 3 && newArr[2] === "prototype";
- } finally {
- delete Array.prototype[2];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - decreasing length of array with prototype + property causes prototype index property to be visited +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return true; + } + var arr = [0, 1, 2]; + + try { + Object.defineProperty(Array.prototype, "2", { + get: function () { + return "prototype"; + }, + configurable: true + }); + + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + var newArr = arr.filter(callbackfn); + + return newArr.length === 3 && newArr[2] === "prototype"; + } finally { + delete Array.prototype[2]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-16.js index af6c29be3..f8f75bdb1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-16.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.20/15.4.4.20-9-b-16.js
- * @description Array.prototype.filter - decreasing length of array does not delete non-configurable properties
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var arr = [0, 1, 2];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- return "unconfigurable";
- },
- configurable: false
- });
-
- Object.defineProperty(arr, "1", {
- get: function () {
- arr.length = 2;
- return 1;
- },
- configurable: true
- });
-
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 3 && newArr[2] === "unconfigurable";
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - decreasing length of array does not + delete non-configurable properties +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var arr = [0, 1, 2]; + + Object.defineProperty(arr, "2", { + get: function () { + return "unconfigurable"; + }, + configurable: false + }); + + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); + + var newArr = arr.filter(callbackfn); + + return newArr.length === 3 && newArr[2] === "unconfigurable"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-2.js index b56144313..5a96c4cbb 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-2.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.20/15.4.4.20-9-b-2.js
- * @description Array.prototype.filter - added properties in step 2 are visible here
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = {};
-
- Object.defineProperty(obj, "length", {
- get: function () {
- obj[2] = "length";
- return 3;
- },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === "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.filter - added properties in step 2 are visible + here +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = {}; + + Object.defineProperty(obj, "length", { + get: function () { + obj[2] = "length"; + return 3; + }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === "length"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-3.js index 483568517..63eaf11a2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-3.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.20/15.4.4.20-9-b-3.js
- * @description Array.prototype.filter - deleted properties in step 2 are visible here
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
- var obj = { 2: 6.99, 8: 19 };
-
- Object.defineProperty(obj, "length", {
- get: function () {
- delete obj[2];
- return 10;
- },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] !== 6.99;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - deleted properties in step 2 are visible + here +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + var obj = { 2: 6.99, 8: 19 }; + + Object.defineProperty(obj, "length", { + get: function () { + delete obj[2]; + return 10; + }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] !== 6.99; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-4.js index 9e60ba7f8..ccb38cb18 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-4.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.20/15.4.4.20-9-b-4.js
- * @description Array.prototype.filter - properties added into own object after current position are visited on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { length: 2 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- Object.defineProperty(obj, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 2 && newArr[1] === 6.99;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - properties added into own object after + current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { length: 2 }; + + Object.defineProperty(obj, "0", { + get: function () { + Object.defineProperty(obj, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 2 && newArr[1] === 6.99; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-5.js index 7b5f4073a..ceba1745c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-5.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.20/15.4.4.20-9-b-5.js
- * @description Array.prototype.filter - properties added into own object after current position are visited on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var arr = [0, , 2];
-
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(arr, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 3 && newArr[1] === 6.99;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - properties added into own object after + current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return true; + } + + var arr = [0, , 2]; + + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(arr, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + var newArr = arr.filter(callbackfn); + + return newArr.length === 3 && newArr[1] === 6.99; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-6.js index c39fd82ea..27135035a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-6.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.20/15.4.4.20-9-b-6.js
- * @description Array.prototype.filter - properties can be added to prototype after current position are visited on an Array-like object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return true;
- }
- var obj = { length: 2 };
-
- try {
- Object.defineProperty(obj, "0", {
- get: function () {
- Object.defineProperty(Object.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 2 && Array[1] === 6.99;
- } 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.filter - properties can be added to prototype + after current position are visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return true; + } + var obj = { length: 2 }; + + try { + Object.defineProperty(obj, "0", { + get: function () { + Object.defineProperty(Object.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 2 && Array[1] === 6.99; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-7.js index 72c0eb82b..0eb855dc5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-7.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.20/15.4.4.20-9-b-7.js
- * @description Array.prototype.filter - properties can be added to prototype after current position are visited on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return true;
- }
- var arr = [0, , 2];
-
- try {
- Object.defineProperty(arr, "0", {
- get: function () {
- Object.defineProperty(Array.prototype, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
- return 0;
- },
- configurable: true
- });
-
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 3 && newArr[1] === 6.99;
- } 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.filter - properties can be added to prototype + after current position are visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return true; + } + var arr = [0, , 2]; + + try { + Object.defineProperty(arr, "0", { + get: function () { + Object.defineProperty(Array.prototype, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + return 0; + }, + configurable: true + }); + + var newArr = arr.filter(callbackfn); + + return newArr.length === 3 && newArr[1] === 6.99; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-8.js index 2678ea067..61d269a2c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-8.js @@ -1,40 +1,42 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-8.js
- * @description Array.prototype.filter - deleting own property causes index property not to be visited on an Array-like object
- */
-
-
-function testcase() {
- var accessed = false;
- var obj = { length: 2 };
-
- function callbackfn(val, idx, o) {
- accessed = true;
- return true;
- }
-
- Object.defineProperty(obj, "1", {
- get: function () {
- return 6.99;
- },
- configurable: true
- });
-
- Object.defineProperty(obj, "0", {
- get: function () {
- delete obj[1];
- return 0;
- },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - deleting own property causes index + property not to be visited on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + var accessed = false; + var obj = { length: 2 }; + + function callbackfn(val, idx, o) { + accessed = true; + return true; + } + + Object.defineProperty(obj, "1", { + get: function () { + return 6.99; + }, + configurable: true + }); + + Object.defineProperty(obj, "0", { + get: function () { + delete obj[1]; + return 0; + }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-9.js index 5071b8de6..f31ff566e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-9.js @@ -1,38 +1,40 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-b-9.js
- * @description Array.prototype.filter - deleting own property causes index property not to be visited on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
- var arr = [1, 2];
-
- Object.defineProperty(arr, "1", {
- get: function () {
- return "6.99";
- },
- configurable: true
- });
-
- Object.defineProperty(arr, "0", {
- get: function () {
- delete arr[1];
- return 0;
- },
- configurable: true
- });
-
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 0;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - deleting own property causes index + property not to be visited on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + var arr = [1, 2]; + + Object.defineProperty(arr, "1", { + get: function () { + return "6.99"; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); + + var newArr = arr.filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 0; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-1.js index 8b7f210d4..c1e2eb7ca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-1.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.20/15.4.4.20-9-c-i-1.js
- * @description Array.prototype.filter - element to be retrieved is own data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = {};
- function callbackfn(val, idx, obj) {
- return (idx === 5) && (val === kValue);
- }
-
- var obj = { 5: kValue, length: 100 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === kValue;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own data + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = {}; + function callbackfn(val, idx, obj) { + return (idx === 5) && (val === kValue); + } + + var obj = { 5: kValue, length: 100 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === kValue; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-10.js index ebcf49e5f..81b0a3e24 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-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.20/15.4.4.20-9-c-i-10.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return idx === 2 && val === 12;
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "2", {
- get: function () {
- return 12;
- },
- configurable: true
- });
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 12;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own accessor + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return idx === 2 && val === 12; + } + + var arr = []; + + Object.defineProperty(arr, "2", { + get: function () { + return 12; + }, + configurable: true + }); + var newArr = arr.filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 12; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-11.js index 492545e30..c90e0262a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-11.js @@ -1,36 +1,39 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-11.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return idx === 0 && val === 11;
- }
-
- var proto = { 0: 5, 1: 6 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 10;
-
- Object.defineProperty(child, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
- var newArr = Array.prototype.filter.call(child, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - element to be retrieved is own accessor + property that overrides an inherited data property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; + } + + var proto = { 0: 5, 1: 6 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 10; + + Object.defineProperty(child, "0", { + get: function () { + return 11; + }, + configurable: true + }); + var newArr = Array.prototype.filter.call(child, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-12.js index 8bba89634..6ab855205 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-12.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.20/15.4.4.20-9-c-i-12.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val === 111 && idx === 0;
- }
-
- var arr = [];
- try {
- Array.prototype[0] = 10;
-
- Object.defineProperty(arr, "0", {
- get: function () {
- return 111;
- },
- configurable: true
- });
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 111;
- } 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.filter - element to be retrieved is own accessor + property that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val === 111 && idx === 0; + } + + var arr = []; + try { + Array.prototype[0] = 10; + + Object.defineProperty(arr, "0", { + get: function () { + return 111; + }, + configurable: true + }); + var newArr = arr.filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 111; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-13.js index 5523e3898..f20b01a37 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-13.js @@ -1,42 +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.20/15.4.4.20-9-c-i-13.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return idx === 1 && 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
- });
- var newArr = Array.prototype.filter.call(child, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 12;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own accessor + property that overrides an inherited accessor property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return idx === 1 && 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 + }); + var newArr = Array.prototype.filter.call(child, callbackfn); + + return newArr.length === 1 && newArr[0] === 12; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-14.js index 04644b770..cd77c2677 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-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.20/15.4.4.20-9-c-i-14.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return idx === 0 && 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
- });
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 11;
- } 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.filter - element to be retrieved is own accessor + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return idx === 0 && 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 + }); + var newArr = arr.filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-15.js index 48a65e072..6c3e5e1b1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-15.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.20/15.4.4.20-9-c-i-15.js
- * @description Array.prototype.filter - element to be retrieved is inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val === 11 && idx === 1;
- }
-
- 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;
- var newArr = Array.prototype.filter.call(child, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - element to be retrieved is inherited + accessor property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val === 11 && idx === 1; + } + + 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; + var newArr = Array.prototype.filter.call(child, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-16.js index 418090083..93d84ad6f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-16.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.20/15.4.4.20-9-c-i-16.js
- * @description Array.prototype.filter - element to be retrieved is inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return idx === 0 && val === 11;
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
- var newArr = [, , , ].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 11;
- } 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.filter - element to be retrieved is inherited + accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; + } + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 11; + }, + configurable: true + }); + var newArr = [, , , ].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-17.js index 4b465c1d6..dc2b587f4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-17.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.20/15.4.4.20-9-c-i-17.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return undefined === val && idx === 1;
- }
-
- var obj = { length: 2 };
- Object.defineProperty(obj, "1", {
- set: function () { },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === undefined;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own accessor + property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return undefined === val && idx === 1; + } + + var obj = { length: 2 }; + Object.defineProperty(obj, "1", { + set: function () { }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === undefined; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-18.js index ebcd74226..13a0f20a9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-18.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.20/15.4.4.20-9-c-i-18.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property without a get function on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return undefined === val && idx === 0;
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === undefined;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own accessor + property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; + } + + var arr = []; + + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + var newArr = arr.filter(callbackfn); + + return newArr.length === 1 && newArr[0] === undefined; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-19.js index 4f3e65879..eef3c331e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-19.js @@ -1,32 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-19.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return undefined === val && idx === 1;
- }
-
- var obj = { length: 2 };
- Object.defineProperty(obj, "1", {
- set: function () { },
- configurable: true
- });
- try {
- Object.prototype[1] = 10;
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === undefined;
- } finally {
- delete Object.prototype[1];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own accessor + property without a get function that overrides an inherited + accessor property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return undefined === val && idx === 1; + } + + var obj = { length: 2 }; + Object.defineProperty(obj, "1", { + set: function () { }, + configurable: true + }); + try { + Object.prototype[1] = 10; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === undefined; + } finally { + delete Object.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-2.js index 58e9960a9..733039d7e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-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.20/15.4.4.20-9-c-i-2.js
- * @description Array.prototype.filter - element to be retrieved is own data property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 11;
- }
- }
-
- var newArr = [11].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - element to be retrieved is own data + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } + } + + var newArr = [11].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-20.js index cf831394b..51ef28128 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-20.js @@ -1,34 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-20.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return undefined === val && idx === 0;
- }
-
- var arr = [];
-
- Object.defineProperty(arr, "0", {
- set: function () { },
- configurable: true
- });
-
- try {
- Array.prototype[0] = 100;
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === undefined;
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own accessor + property without a get function that overrides an inherited + accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; + } + + var arr = []; + + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); + + try { + Array.prototype[0] = 100; + var newArr = arr.filter(callbackfn); + + return newArr.length === 1 && newArr[0] === undefined; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-21.js index aa6908629..b07a3f2e0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-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.20/15.4.4.20-9-c-i-21.js
- * @description Array.prototype.filter - element to be retrieved is inherited accessor property without a get function on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val === undefined && idx === 1;
- }
-
- var proto = {};
- Object.defineProperty(proto, "1", {
- set: function () { },
- configurable: true
- });
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 2;
- var newArr = Array.prototype.filter.call(child, callbackfn);
-
- return newArr.length === 1 && newArr[0] === undefined;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is inherited + accessor property without a get function on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val === undefined && idx === 1; + } + + var proto = {}; + Object.defineProperty(proto, "1", { + set: function () { }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 2; + var newArr = Array.prototype.filter.call(child, callbackfn); + + return newArr.length === 1 && newArr[0] === undefined; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-22.js index bcbb1e242..5a9dd7043 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-22.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.20/15.4.4.20-9-c-i-22.js
- * @description Array.prototype.filter - element to be retrieved is inherited accessor property without a get function on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return undefined === val && idx === 0;
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- set: function () { },
- configurable: true
- });
- var newArr = [, ].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === undefined;
- } finally {
- delete Array.prototype[0];
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is inherited + accessor property without a get function on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; + } + + try { + Object.defineProperty(Array.prototype, "0", { + set: function () { }, + configurable: true + }); + var newArr = [, ].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === undefined; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-23.js index b702c481a..b4c93c447 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-23.js @@ -1,29 +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.20/15.4.4.20-9-c-i-23.js
- * @description Array.prototype.filter - This object is the global object which contains index property
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return idx === 0 && val === 11;
- }
-
- try {
- var oldLen = fnGlobalObject().length;
- fnGlobalObject()[0] = 11;
- fnGlobalObject().length = 1;
- var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn);
- return newArr.length === 1 && newArr[0] === 11;
- } 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.filter - This object is the global object which + contains index property +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; + } + + try { + var oldLen = fnGlobalObject().length; + fnGlobalObject()[0] = 11; + fnGlobalObject().length = 1; + var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } finally { + delete fnGlobalObject()[0]; + fnGlobalObject().length = oldLen; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-25.js index f49124ed6..7cc2b8be1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-25.js @@ -1,25 +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.20/15.4.4.20-9-c-i-25.js
- * @description Array.prototype.filter - This object is the Arguments object which implements its own property get method (number of arguments is less than number of parameters)
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val === 11 && idx === 0;
- }
-
- var func = function (a, b) {
- return Array.prototype.filter.call(arguments, callbackfn);
- };
-
- var newArr = func(11);
-
- return newArr.length === 1 && newArr[0] === 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.filter - This object is the Arguments object which + implements its own property get method (number of arguments is + less than number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val === 11 && idx === 0; + } + + var func = function (a, b) { + return Array.prototype.filter.call(arguments, callbackfn); + }; + + var newArr = func(11); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-26.js index 656cc0f67..a164bae39 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-26.js @@ -1,32 +1,35 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-26.js
- * @description Array.prototype.filter - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 11;
- } else if (idx === 1) {
- return val === 9;
- } else {
- return false;
- }
- }
-
- var func = function (a, b) {
- return Array.prototype.filter.call(arguments, callbackfn);
- };
- var newArr = func(11, 9);
-
- return newArr.length === 2 && newArr[0] === 11 &&
- newArr[1] === 9;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - This object is the Arguments object which + implements its own property get method (number of arguments equals + number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 9; + } else { + return false; + } + } + + var func = function (a, b) { + return Array.prototype.filter.call(arguments, callbackfn); + }; + var newArr = func(11, 9); + + return newArr.length === 2 && newArr[0] === 11 && + newArr[1] === 9; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-27.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-27.js index 7527894b9..be029d51c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-27.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-27.js @@ -1,34 +1,37 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-27.js
- * @description Array.prototype.filter - This object is the Arguments object which implements its own property get method (number of arguments is greater than number of parameters)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 11;
- } else if (idx === 1) {
- return val === 12;
- } else if (idx === 2) {
- return val === 9;
- } else {
- return false;
- }
- }
-
- var func = function (a, b) {
- return Array.prototype.filter.call(arguments, callbackfn);
- };
- var newArr = func(11, 12, 9);
-
- return newArr.length === 3 && newArr[0] === 11 &&
- newArr[1] === 12 && newArr[2] === 9;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - This object is the Arguments object which + implements its own property get method (number of arguments is + greater than number of parameters) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } else if (idx === 1) { + return val === 12; + } else if (idx === 2) { + return val === 9; + } else { + return false; + } + } + + var func = function (a, b) { + return Array.prototype.filter.call(arguments, callbackfn); + }; + var newArr = func(11, 12, 9); + + return newArr.length === 3 && newArr[0] === 11 && + newArr[1] === 12 && newArr[2] === 9; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-28.js index b8386acb4..ce46e6942 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-28.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.20/15.4.4.20-9-c-i-28.js
- * @description Array.prototype.filter - element changed by getter on previous iterations is observed on an Array
- */
-
-
-function testcase() {
-
- var preIterVisible = false;
- var arr = [];
-
- function callbackfn(val, idx, obj) {
- return idx === 1 && 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 11;
- }
- },
- configurable: true
- });
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 9;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element changed by getter on previous + iterations is observed on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var preIterVisible = false; + var arr = []; + + function callbackfn(val, idx, obj) { + return idx === 1 && 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 11; + } + }, + configurable: true + }); + var newArr = arr.filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 9; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-29.js index 9059990a8..fea95828e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-29.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.20/15.4.4.20-9-c-i-29.js
- * @description Array.prototype.filter - element changed by getter on previous iterations is observed on an Array-like object
- */
-
-
-function testcase() {
- function callbackfn(val, idx, obj) {
- return val === 9 && idx === 1;
- }
-
- var preIterVisible = false;
- var obj = { length: 2 };
-
- 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
- });
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 9;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element changed by getter on previous + iterations is observed on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + function callbackfn(val, idx, obj) { + return val === 9 && idx === 1; + } + + var preIterVisible = false; + var obj = { length: 2 }; + + 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 + }); + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 9; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-3.js index d363c6930..f74153893 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-3.js @@ -1,31 +1,34 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-3.js
- * @description Array.prototype.filter - element to be retrieved is own data property that overrides an inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return (idx === 5) && (val === "abc");
- }
-
- var proto = { 0: 11, 5: 100 };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child[5] = "abc";
- child.length = 10;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
-
- return newArr.length === 1 && newArr[0] === "abc";
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is own data + property that overrides an inherited data property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return (idx === 5) && (val === "abc"); + } + + var proto = { 0: 11, 5: 100 }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child[5] = "abc"; + child.length = 10; + + var newArr = Array.prototype.filter.call(child, callbackfn); + + return newArr.length === 1 && newArr[0] === "abc"; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-30.js index 4a71236d5..6407e19c8 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-30.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.20/15.4.4.20-9-c-i-30.js
- * @description Array.prototype.filter - 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;
- }
- return true;
- }
-
- var obj = { 0: 11, 5: 10, 10: 8, length: 20 };
- Object.defineProperty(obj, "1", {
- get: function () {
- throw new RangeError("unhandle exception happened in getter");
- },
- configurable: true
- });
-
- try {
- Array.prototype.filter.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.filter - 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; + } + return true; + } + + var obj = { 0: 11, 5: 10, 10: 8, length: 20 }; + Object.defineProperty(obj, "1", { + get: function () { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true + }); + + try { + Array.prototype.filter.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.20/15.4.4.20-9-c-i-31.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-31.js index 157f035f7..c30a80339 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-31.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-31.js @@ -1,40 +1,42 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-31.js
- * @description Array.prototype.filter - unnhandled exceptions happened in getter terminate iteration on an Array
- */
-
-
-function testcase() {
-
- var accessed = false;
- function callbackfn(val, idx, obj) {
- if (idx > 1) {
- accessed = true;
- }
- return 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
- });
-
- try {
- arr.filter(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.filter - unnhandled exceptions happened in getter + terminate iteration on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return 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 + }); + + try { + arr.filter(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.20/15.4.4.20-9-c-i-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-4.js index d6afea001..8e0104916 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-4.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.20/15.4.4.20-9-c-i-4.js
- * @description Array.prototype.filter - element to be retrieved is own data property that overrides an inherited data property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return (idx === 0) && (val === 12);
- }
-
- try {
- Array.prototype[0] = 11;
- var newArr = [12].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 12;
- } 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.filter - element to be retrieved is own data + property that overrides an inherited data property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return (idx === 0) && (val === 12); + } + + try { + Array.prototype[0] = 11; + var newArr = [12].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 12; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-5.js index 4226b2c70..e9ead5350 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-5.js @@ -1,42 +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.20/15.4.4.20-9-c-i-5.js
- * @description Array.prototype.filter - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return idx === 0 && 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
- });
- child[1] = 12;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - element to be retrieved is own data + property that overrides an inherited accessor property on an + Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return idx === 0 && 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 + }); + child[1] = 12; + + var newArr = Array.prototype.filter.call(child, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-6.js index 72ebc10f8..efedfc1cd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-6.js @@ -1,32 +1,34 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-6.js
- * @description Array.prototype.filter - element to be retrieved is own data property that overrides an inherited accessor property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val === 11;
- }
-
- try {
- Object.defineProperty(Array.prototype, "0", {
- get: function () {
- return 9;
- },
- configurable: true
- });
- var newArr = [11].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 11;
- } 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.filter - element to be retrieved is own data + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val === 11; + } + + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 9; + }, + configurable: true + }); + var newArr = [11].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-7.js index 0bca7870c..0d9305b4e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-7.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.20/15.4.4.20-9-c-i-7.js
- * @description Array.prototype.filter - element to be retrieved is inherited data property on an Array-like object
- */
-
-
-function testcase() {
-
- var kValue = 'abc';
-
- function callbackfn(val, idx, obj) {
- return (idx === 5) && (val === kValue);
- }
-
- var proto = { 5: kValue };
-
- var Con = function () { };
- Con.prototype = proto;
-
- var child = new Con();
- child.length = 10;
-
- var newArr = Array.prototype.filter.call(child, callbackfn);
-
- return newArr.length === 1 && newArr[0] === kValue;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - element to be retrieved is inherited data + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kValue = 'abc'; + + function callbackfn(val, idx, obj) { + return (idx === 5) && (val === kValue); + } + + var proto = { 5: kValue }; + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 10; + + var newArr = Array.prototype.filter.call(child, callbackfn); + + return newArr.length === 1 && newArr[0] === kValue; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-8.js index ec075a3ee..054e2aa20 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-8.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-8.js
- * @description Array.prototype.filter - element to be retrieved is inherited data property on an Array
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return (idx === 1) && (val === 13);
- }
-
- try {
- Array.prototype[1] = 13;
- var newArr = [, , , ].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 13;
- } 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.filter - element to be retrieved is inherited data + property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return (idx === 1) && (val === 13); + } + + try { + Array.prototype[1] = 13; + var newArr = [, , , ].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 13; + } finally { + delete Array.prototype[1]; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-9.js index 50d83fb60..8304127c4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-9.js @@ -1,30 +1,32 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-i-9.js
- * @description Array.prototype.filter - element to be retrieved is own accessor property on an Array-like object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return (idx === 0) && (val === 11);
- }
-
- var obj = { 10: 10, length: 20 };
-
- Object.defineProperty(obj, "0", {
- get: function () {
- return 11;
- },
- configurable: true
- });
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - element to be retrieved is own accessor + property on an Array-like object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return (idx === 0) && (val === 11); + } + + var obj = { 10: 10, length: 20 }; + + Object.defineProperty(obj, "0", { + get: function () { + return 11; + }, + configurable: true + }); + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-1.js index 48d596041..b922f3f86 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-1.js @@ -1,30 +1,30 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-1.js
- * @description Array.prototype.filter - callbackfn called with correct parameters
- */
-
-
-function testcase() {
-
- var bPar = true;
- var bCalled = false;
- function callbackfn(val, idx, obj)
- {
- bCalled = true;
- if(obj[idx] !== val)
- bPar = false;
- }
-
- var srcArr = [0,1,true,null,new Object(),"five"];
- srcArr[999999] = -6.6;
- var resArr = srcArr.filter(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.filter - callbackfn called with correct parameters +includes: [runTestCase.js] +---*/ + +function testcase() { + + var bPar = true; + var bCalled = false; + function callbackfn(val, idx, obj) + { + bCalled = true; + if(obj[idx] !== val) + bPar = false; + } + + var srcArr = [0,1,true,null,new Object(),"five"]; + srcArr[999999] = -6.6; + var resArr = srcArr.filter(callbackfn); + + if(bCalled === true && bPar === true) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-10.js index 6107644fc..8924e4da4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-10.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-10.js
- * @description Array.prototype.filter - callbackfn is called with 1 formal parameter
- */
-
-
-function testcase() {
-
- function callbackfn(val) {
- return val > 10;
- }
- var newArr = [12].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 12;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - callbackfn is called with 1 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val) { + return val > 10; + } + var newArr = [12].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 12; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-11.js index cad0f9883..5cf1c2b5e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-11.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-11.js
- * @description Array.prototype.filter - callbackfn is called with 2 formal parameter
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx) {
- return val > 10 && arguments[2][idx] === val;
- }
- var newArr = [11].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - callbackfn is called with 2 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx) { + return val > 10 && arguments[2][idx] === val; + } + var newArr = [11].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-12.js index 6f2ff59a7..09817bcca 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-12.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-12.js
- * @description Array.prototype.filter - callbackfn is called with 3 formal parameter
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return val > 10 && obj[idx] === val;
- }
- var newArr = [11].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - callbackfn is called with 3 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return val > 10 && obj[idx] === val; + } + var newArr = [11].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-13.js index 3061b78c4..d12e6a818 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-13.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-13.js
- * @description Array.prototype.filter - callbackfn that uses arguments object to get parameter value
- */
-
-
-function testcase() {
-
- function callbackfn() {
- return arguments[2][arguments[1]] === arguments[0];
- }
- var newArr = [11].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - callbackfn that uses arguments object to + get parameter value +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn() { + return arguments[2][arguments[1]] === arguments[0]; + } + var newArr = [11].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-16.js index 327c76b14..568956673 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-16.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.20/15.4.4.20-9-c-ii-16.js
- * @description Array.prototype.filter - 'this' of 'callbackfn' is a Boolean object when T is not an object (T is a boolean)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return this.valueOf() === false;
- }
-
- var obj = { 0: 11, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn, false);
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'this' of 'callbackfn' is a Boolean + object when T is not an object (T is a boolean) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return this.valueOf() === false; + } + + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, false); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-17.js index 19b9daa34..99e878b94 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-17.js @@ -1,23 +1,25 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-17.js
- * @description Array.prototype.filter -'this' of 'callbackfn' is a Number object when T is not an object (T is a number)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, o) {
- return 5 === this.valueOf();
- }
-
- var obj = { 0: 11, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn, 5);
-
- return newArr.length === 1 && newArr[0] === 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.filter -'this' of 'callbackfn' is a Number object + when T is not an object (T is a number) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, o) { + return 5 === this.valueOf(); + } + + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, 5); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-18.js index fda004d5c..f9c877544 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-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.20/15.4.4.20-9-c-ii-18.js
- * @description Array.prototype.filter - 'this' of 'callbackfn' is an String object when T is not an object (T is a string)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 'hello' === this.valueOf();
- }
-
- var obj = { 0: 11, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn, "hello");
-
- return newArr.length === 1 && newArr[0] === 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.filter - 'this' of 'callbackfn' is an String + object when T is not an object (T is a string) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 'hello' === this.valueOf(); + } + + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, "hello"); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-19.js index a019570e3..a0c0f2237 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-19.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.20/15.4.4.20-9-c-ii-19.js
- * @description Array.prototype.filter - non-indexed properties are not called
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return val === 8;
- }
-
- var obj = { 0: 11, non_index_property: 8, 2: 5, length: 20 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - non-indexed properties are not called +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return val === 8; + } + + var obj = { 0: 11, non_index_property: 8, 2: 5, length: 20 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-2.js index bd1eb409f..62d50dd57 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-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.20/15.4.4.20-9-c-ii-2.js
- * @description Array.prototype.filter - callbackfn takes 3 arguments
- */
-
-
-function testcase() {
-
- var parCnt = 3;
- var bCalled = false
- function callbackfn(val, idx, obj)
- {
- bCalled = true;
- if(arguments.length !== 3)
- parCnt = arguments.length; //verify if callbackfn was called with 3 parameters
- }
-
- var srcArr = [0,1,2,3,4,5,6,7,8,9];
- var resArr = srcArr.filter(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.filter - callbackfn takes 3 arguments +includes: [runTestCase.js] +---*/ + +function testcase() { + + var parCnt = 3; + var bCalled = false + function callbackfn(val, idx, obj) + { + bCalled = true; + if(arguments.length !== 3) + parCnt = arguments.length; //verify if callbackfn was called with 3 parameters + } + + var srcArr = [0,1,2,3,4,5,6,7,8,9]; + var resArr = srcArr.filter(callbackfn); + if(bCalled === true && parCnt === 3) + return true; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-20.js index be1376e45..c2c68bc84 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-20.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.20/15.4.4.20-9-c-ii-20.js
- * @description Array.prototype.filter - callbackfn called with correct parameters (thisArg is correct)
- */
-
-
-function testcase() {
-
- var thisArg = { threshold: 10 };
-
- function callbackfn(val, idx, obj) {
- return this === thisArg;
- }
-
- var obj = { 0: 11, length: 1 };
- var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg);
-
- return newArr.length === 1 && newArr[0] === 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.filter - callbackfn called with correct parameters + (thisArg is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var thisArg = { threshold: 10 }; + + function callbackfn(val, idx, obj) { + return this === thisArg; + } + + var obj = { 0: 11, length: 1 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-21.js index d52e2ef0e..58e1e3ee2 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-21.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.20/15.4.4.20-9-c-ii-21.js
- * @description Array.prototype.filter - callbackfn called with correct parameters (kValue is correct)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (idx === 0) {
- return val === 11;
- }
-
- if (idx === 1) {
- return val === 12;
- }
-
- return false;
- }
-
- var obj = { 0: 11, 1: 12, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 2 && newArr[0] === 11 && newArr[1] === 12;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - callbackfn called with correct parameters + (kValue is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } + + if (idx === 1) { + return val === 12; + } + + return false; + } + + var obj = { 0: 11, 1: 12, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 2 && newArr[0] === 11 && newArr[1] === 12; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-22.js index bf7a1f972..c3e055016 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-22.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.20/15.4.4.20-9-c-ii-22.js
- * @description Array.prototype.filter - callbackfn called with correct parameters (the index k is correct)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- if (val === 11) {
- return idx === 0;
- }
-
- if (val === 12) {
- return idx === 1;
- }
-
- return false;
- }
-
- var obj = { 0: 11, 1: 12, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 2 && newArr[0] === 11 && newArr[1] === 12;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - callbackfn called with correct parameters + (the index k is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + if (val === 11) { + return idx === 0; + } + + if (val === 12) { + return idx === 1; + } + + return false; + } + + var obj = { 0: 11, 1: 12, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 2 && newArr[0] === 11 && newArr[1] === 12; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-23.js index 5f670b467..509076d7e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-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.20/15.4.4.20-9-c-ii-23.js
- * @description Array.prototype.filter - callbackfn called with correct parameters (this object O is correct)
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, length: 2 };
-
- function callbackfn(val, idx, o) {
- return obj === o;
- }
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - callbackfn called with correct parameters + (this object O is correct) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, length: 2 }; + + function callbackfn(val, idx, o) { + return obj === o; + } + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-4.js index 4d94c159a..2c1cc781a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-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.20/15.4.4.20-9-c-ii-4.js
- * @description Array.prototype.filter - k values are passed in ascending numeric order
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2, 3, 4, 5];
- var lastIdx = 0;
- var called = 0;
- function callbackfn(val, idx, o) {
- called++;
- if (lastIdx !== idx) {
- return false;
- } else {
- lastIdx++;
- return true;
- }
- }
- var newArr = arr.filter(callbackfn);
-
- return newArr.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.filter - 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; + function callbackfn(val, idx, o) { + called++; + if (lastIdx !== idx) { + return false; + } else { + lastIdx++; + return true; + } + } + var newArr = arr.filter(callbackfn); + + return newArr.length === called; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-5.js index 1027c6405..774e5018f 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-5.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.20/15.4.4.20-9-c-ii-5.js
- * @description Array.prototype.filter - k values are accessed during each iteration and not prior to starting the loop on an Array
- */
-
-
-function testcase() {
-
- var kIndex = [];
- var called = 0;
-
- //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) {
- called++;
- //Each position should be visited one time, which means k is accessed one time during iterations.
- if (kIndex[idx] === undefined) {
- //when current position is visited, its previous index should has been visited.
- if (idx !== 0 && kIndex[idx - 1] === undefined) {
- return true;
- }
- kIndex[idx] = 1;
- return false;
- } else {
- return true;
- }
- }
- var newArr = [11, 12, 13, 14].filter(callbackfn, undefined);
-
- return newArr.length === 0 && called === 4;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - k values are accessed during each + iteration and not prior to starting the loop on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var kIndex = []; + var called = 0; + + //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) { + called++; + //Each position should be visited one time, which means k is accessed one time during iterations. + if (kIndex[idx] === undefined) { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && kIndex[idx - 1] === undefined) { + return true; + } + kIndex[idx] = 1; + return false; + } else { + return true; + } + } + var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); + + return newArr.length === 0 && called === 4; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-6.js index 7e8e21017..ac79eecdf 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-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.20/15.4.4.20-9-c-ii-6.js
- * @description Array.prototype.filter - arguments to callbackfn are self consistent
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, length: 1 };
- var thisArg = {};
-
- function callbackfn() {
- return this === thisArg &&
- arguments[0] === 11 &&
- arguments[1] === 0 &&
- arguments[2] === obj;
- }
-
- var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg);
-
- return newArr.length === 1 && newArr[0] === 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.filter - arguments to callbackfn are self + consistent +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, length: 1 }; + var thisArg = {}; + + function callbackfn() { + return this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj; + } + + var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-7.js index 1b4fa8423..e79c28167 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-7.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.20/15.4.4.20-9-c-ii-7.js
- * @description Array.prototype.filter - unhandled exceptions happened in callbackfn terminate iteration
- */
-
-
-function testcase() {
-
- var called = 0;
-
- function callbackfn(val, idx, obj) {
- called++;
- if (called === 1) {
- throw new Error("Exception occurred in callbackfn");
- }
- return true;
- }
-
- var obj = { 0: 11, 4: 10, 10: 8, length: 20 };
-
- try {
- Array.prototype.filter.call(obj, callbackfn);
- return false;
- } catch (ex) {
- return 1 === called && ex instanceof Error;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - unhandled exceptions happened in + callbackfn terminate iteration +includes: [runTestCase.js] +---*/ + +function testcase() { + + var called = 0; + + function callbackfn(val, idx, obj) { + called++; + if (called === 1) { + throw new Error("Exception occurred in callbackfn"); + } + return true; + } + + var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; + + try { + Array.prototype.filter.call(obj, callbackfn); + return false; + } catch (ex) { + return 1 === called && ex instanceof Error; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-8.js index 4c25ec1ee..662e00e74 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-8.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-8.js
- * @description Array.prototype.filter - element changed by callbackfn on previous iterations is observed
- */
-
-
-function testcase() {
-
- var obj = { 0: 11, 1: 12, length: 2 };
-
- function callbackfn(val, idx, o) {
- if (idx === 0) {
- obj[idx + 1] = 8;
- }
- return val > 10;
- }
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - element changed by callbackfn on previous + iterations is observed +includes: [runTestCase.js] +---*/ + +function testcase() { + + var obj = { 0: 11, 1: 12, length: 2 }; + + function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } + return val > 10; + } + + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-9.js index 34030ff0d..941f1194e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-9.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-ii-9.js
- * @description Array.prototype.filter - callbackfn is called with 0 formal parameter
- */
-
-
-function testcase() {
-
- function callbackfn() {
- return true;
- }
- var newArr = [11].filter(callbackfn);
-
- return newArr.length === 1 && newArr[0] === 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.filter - callbackfn is called with 0 formal + parameter +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn() { + return true; + } + var newArr = [11].filter(callbackfn); + + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-1.js index 2eed950e9..dc8b0fc03 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-1.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.20/15.4.4.20-9-c-iii-1-1.js
- * @description Array.prototype.filter - value of returned array element equals to 'kValue'
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, 1: 9, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- return newArr[0] === obj[0] && newArr[1] === obj[1];
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of returned array element equals to + 'kValue' +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + return newArr[0] === obj[0] && newArr[1] === obj[1]; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-2.js index 9e89079fb..877b289d3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-2.js @@ -1,29 +1,31 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-2.js
- * @description Array.prototype.filter - value of returned array element can be overwritten
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, 1: 9, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- try {
- var tempVal = newArr[1];
- newArr[1] += 1;
- return newArr[1] !== tempVal;
- } catch (ex) {
- return false;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of returned array element can be + overwritten +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + try { + var tempVal = newArr[1]; + newArr[1] += 1; + return newArr[1] !== tempVal; + } catch (ex) { + return false; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-3.js index 1ad2c00bf..49d703d9e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-3.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.20/15.4.4.20-9-c-iii-1-3.js
- * @description Array.prototype.filter - value of returned array element can be enumerated
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- var prop;
- var enumerable = false;
- for (prop in newArr) {
- if (newArr.hasOwnProperty(prop)) {
- if (prop === "0") {
- enumerable = true;
- }
- }
- }
-
- return enumerable;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of returned array element can be + enumerated +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + var prop; + var enumerable = false; + for (prop in newArr) { + if (newArr.hasOwnProperty(prop)) { + if (prop === "0") { + enumerable = true; + } + } + } + + return enumerable; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-4.js index b63a39c44..96fcd046e 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-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.20/15.4.4.20-9-c-iii-1-4.js
- * @description Array.prototype.filter - value of returned array element can be changed or deleted
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, 1: 9, length: 2 };
- var newArr = Array.prototype.filter.call(obj, callbackfn);
-
- try {
- var tempVal = newArr[1];
- delete newArr[1];
- return tempVal !== undefined && newArr[1] === undefined;
- } catch (ex) {
- return false;
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - value of returned array element can be + changed or deleted +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); + + try { + var tempVal = newArr[1]; + delete newArr[1]; + return tempVal !== undefined && newArr[1] === undefined; + } catch (ex) { + return false; + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-5.js index 5db52838f..f67596d98 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-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.20/15.4.4.20-9-c-iii-1-5.js
- * @description Array.prototype.filter - values of 'to' are passed in acending numeric order
- */
-
-
-function testcase() {
-
- var arr = [0, 1, 2, 3, 4];
- var lastToIdx = 0;
- var called = 0;
- function callbackfn(val, idx, obj) {
- called++;
- if (lastToIdx !== idx) {
- return false;
- } else {
- lastToIdx++;
- return true;
- }
- }
- var newArr = arr.filter(callbackfn);
-
- return newArr.length === 5 && called === 5;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - values of 'to' are passed in acending + numeric order +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = [0, 1, 2, 3, 4]; + var lastToIdx = 0; + var called = 0; + function callbackfn(val, idx, obj) { + called++; + if (lastToIdx !== idx) { + return false; + } else { + lastToIdx++; + return true; + } + } + var newArr = arr.filter(callbackfn); + + return newArr.length === 5 && called === 5; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-6.js index 32b781a64..822cf0dd4 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-6.js @@ -1,36 +1,39 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1-6.js
- * @description Array.prototype.filter - values of 'to' are accessed during each iteration when 'selected' is converted to true and not prior to starting the loop
- */
-
-
-function testcase() {
-
- var toIndex = [];
- var called = 0;
-
- //By below way, we could verify that 'to' would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time.
- function callbackfn(val, idx, obj) {
- called++;
- //Each position should be visited one time, which means 'to' is accessed one time during iterations.
- if (toIndex[idx] === undefined) {
- //when current position is visited, its previous index should has been visited.
- if (idx !== 0 && toIndex[idx - 1] === undefined) {
- return false;
- }
- toIndex[idx] = 1;
- return true;
- } else {
- return false;
- }
- }
- var newArr = [11, 12, 13, 14].filter(callbackfn, undefined);
-
- return newArr.length === 4 && called === 4;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - values of 'to' are accessed during each + iteration when 'selected' is converted to true and not prior to + starting the loop +includes: [runTestCase.js] +---*/ + +function testcase() { + + var toIndex = []; + var called = 0; + + //By below way, we could verify that 'to' would be setted as 0, 1, ..., length - 1 in order, and each value will be setted one time. + function callbackfn(val, idx, obj) { + called++; + //Each position should be visited one time, which means 'to' is accessed one time during iterations. + if (toIndex[idx] === undefined) { + //when current position is visited, its previous index should has been visited. + if (idx !== 0 && toIndex[idx - 1] === undefined) { + return false; + } + toIndex[idx] = 1; + return true; + } else { + return false; + } + } + var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); + + return newArr.length === 4 && called === 4; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1.js index 7c48aca13..d1ba7339b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1.js @@ -1,32 +1,34 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-1.js
- * @description Array.prototype.filter - getOwnPropertyDescriptor(all true) of returned array element
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj){
- if(val % 2)
- return true;
- else
- return false;
- }
- var srcArr = [0,1,2,3,4];
- var resArr = srcArr.filter(callbackfn);
- if (resArr.length > 0){
- var desc = Object.getOwnPropertyDescriptor(resArr, 1)
- if(desc.value === 3 && //srcArr[1] = true
- desc.writable === true &&
- desc.enumerable === true &&
- desc.configurable === true){
- return true;
- }
- }
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - getOwnPropertyDescriptor(all true) of + returned array element +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj){ + if(val % 2) + return true; + else + return false; + } + var srcArr = [0,1,2,3,4]; + var resArr = srcArr.filter(callbackfn); + if (resArr.length > 0){ + var desc = Object.getOwnPropertyDescriptor(resArr, 1) + if(desc.value === 3 && //srcArr[1] = true + desc.writable === true && + desc.enumerable === true && + desc.configurable === true){ + return true; + } + } + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-10.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-10.js index 9cf805a87..464f99d47 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-10.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-10.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-10.js
- * @description Array.prototype.filter return value of callbackfn is a number (value is negative number)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return -5;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is a number + (value is negative number) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return -5; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-11.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-11.js index 3680e0a0b..fe762d0e7 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-11.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-11.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-11.js
- * @description Array.prototype.filter return value of callbackfn is a number (value is Infinity)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return Infinity;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is a number + (value is Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return Infinity; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-12.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-12.js index 9d757dd37..216631f1b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-12.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-12.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-12.js
- * @description Array.prototype.filter return value of callbackfn is a number (value is -Infinity)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return -Infinity;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is a number + (value is -Infinity) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return -Infinity; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-13.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-13.js index 31454c215..0fd5df218 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-13.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-13.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.20/15.4.4.20-9-c-iii-13.js
- * @description Array.prototype.filter return value of callbackfn is a number (value is NaN)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return NaN;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter return value of callbackfn is a number + (value is NaN) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return NaN; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-14.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-14.js index e43b91d12..b1403c13a 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-14.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-14.js @@ -1,24 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-14.js
- * @description Array.prototype.filter return value of callbackfn is an empty string
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return "";
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter return value of callbackfn is an empty + string +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return ""; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-15.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-15.js index e65a5b263..3c7971029 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-15.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-15.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-15.js
- * @description Array.prototype.filter return value of callbackfn is a non-empty string
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return "non-empty string";
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is a non-empty + string +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return "non-empty string"; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-16.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-16.js index 3cf354559..5de4998c3 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-16.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-16.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-16.js
- * @description Array.prototype.filter return value of callbackfn is a Function object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return function () { };
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is a Function + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return function () { }; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-17.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-17.js index 3043d48e4..680e4bea9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-17.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-17.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-17.js
- * @description Array.prototype.filter return value of callbackfn is an Array object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new Array(10);
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is an Array + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new Array(10); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-18.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-18.js index 021275593..8f96f71b1 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-18.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-18.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-18.js
- * @description Array.prototype.filter return value of callbackfn is a String object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new String();
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is a String + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new String(); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-19.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-19.js index 6db0b0e3d..072e70047 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-19.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-19.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-19.js
- * @description Array.prototype.filter return value of callbackfn is a Boolean object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new Boolean();
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter return value of callbackfn is a Boolean + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new Boolean(); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-2.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-2.js index 5a2602afc..c111ab6c0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-2.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-2.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.20/15.4.4.20-9-c-iii-2.js
- * @description Array.prototype.filter - return value of callbackfn is undefined
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, o) {
- accessed = true;
- return undefined;
- }
-
- var obj = { 0: 11, length: 1 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - return value of callbackfn is undefined +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, o) { + accessed = true; + return undefined; + } + + var obj = { 0: 11, length: 1 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-20.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-20.js index 94c866489..b6f984124 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-20.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-20.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-20.js
- * @description Array.prototype.filter - return value of callbackfn is a Number object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new Number();
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is a Number + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new Number(); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-21.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-21.js index 3fdf2663e..8dd158544 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-21.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-21.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-21.js
- * @description Array.prototype.filter - return value of callbackfn is the Math object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return Math;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is the Math + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return Math; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-22.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-22.js index 237bfdae6..bbf839781 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-22.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-22.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-22.js
- * @description Array.prototype.filter - return value of callbackfn is a Date object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new Date();
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is a Date + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new Date(); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-23.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-23.js index 22e527896..29e5e8b9c 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-23.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-23.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-23.js
- * @description Array.prototype.filter - return value of callbackfn is a RegExp object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new RegExp();
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is a RegExp + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new RegExp(); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-24.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-24.js index 24f2b160f..9cd0abca9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-24.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-24.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.20/15.4.4.20-9-c-iii-24.js
- * @description Array.prototype.filter - return value of callbackfn is the JSON object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return JSON;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is the JSON + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return JSON; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-25.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-25.js index 5ba073f4a..482f972bc 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-25.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-25.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-25.js
- * @description Array.prototype.filter - return value of callbackfn is an Error object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new EvalError();
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is an Error + object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new EvalError(); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-26.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-26.js index 32437ac18..7d108631d 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-26.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-26.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-26.js
- * @description Array.prototype.filter - return value of callbackfn is the Arguments object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return arguments;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is the + Arguments object +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return arguments; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-28.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-28.js index 2d4d295a1..9a24bbc25 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-28.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-28.js @@ -1,21 +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.20/15.4.4.20-9-c-iii-28.js
- * @description Array.prototype.filter - return value of callbackfn is the global object
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return fnGlobalObject();
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is the global + object +includes: + - runTestCase.js + - fnGlobalObject.js +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return fnGlobalObject(); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-29.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-29.js index c3dbbfd98..742c688b0 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-29.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-29.js @@ -1,27 +1,29 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-29.js
- * @description Array.prototype.filter - false prevents element added to output Array
- */
-
-
-function testcase() {
-
- var called = 0;
-
- function callbackfn(val, idx, obj) {
- called++;
- return val > 10;
- }
-
- var obj = { 0: 11, 1: 8, length: 20 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 1 && newArr[0] !== 8 && called === 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.filter - false prevents element added to output + Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var called = 0; + + function callbackfn(val, idx, obj) { + called++; + return val > 10; + } + + var obj = { 0: 11, 1: 8, length: 20 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 1 && newArr[0] !== 8 && called === 2; + + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-3.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-3.js index b4a887f47..8225abfd5 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-3.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-3.js @@ -1,26 +1,26 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-3.js
- * @description Array.prototype.filter - return value of callbackfn is null
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return null;
- }
-
- var obj = { 0: 11, length: 1 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: Array.prototype.filter - return value of callbackfn is null +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return null; + } + + var obj = { 0: 11, length: 1 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-30.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-30.js index c1e2c4dd6..71fe038bd 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-30.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-30.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-30.js
- * @description Array.prototype.filter - return value (new Boolean(false)) of callbackfn is treated as true value
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return new Boolean(false);
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value (new Boolean(false)) of + callbackfn is treated as true value +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return new Boolean(false); + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-4.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-4.js index 881e96424..524df498b 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-4.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-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.20/15.4.4.20-9-c-iii-4.js
- * @description Array.prototype.filter - return value of callbackfn is a boolean (value is false)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return false;
- }
-
- var obj = { 0: 11, length: 1 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - return value of callbackfn is a boolean + (value is false) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return false; + } + + var obj = { 0: 11, length: 1 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-5.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-5.js index 819e1290f..09def66a9 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-5.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-5.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.20/15.4.4.20-9-c-iii-5.js
- * @description Array.prototype.filter - return value of callbackfn is a boolean (value is true)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return true;
- }
-
- var obj = { 0: 11, length: 1 };
-
- var newArr = Array.prototype.filter.call(obj, callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is a boolean + (value is true) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return true; + } + + var obj = { 0: 11, length: 1 }; + + var newArr = Array.prototype.filter.call(obj, callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-6.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-6.js index 65c3bd29b..b11737745 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-6.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-6.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.20/15.4.4.20-9-c-iii-6.js
- * @description Array.prototype.filter - return value of callbackfn is a number (value is 0)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return 0;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - return value of callbackfn is a number + (value is 0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return 0; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-7.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-7.js index 35c88de29..f793ddcfe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-7.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-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.20/15.4.4.20-9-c-iii-7.js
- * @description Array.prototype.filter - return value of callbackfn is a number (value is +0)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return +0;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - return value of callbackfn is a number + (value is +0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return +0; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-8.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-8.js index 36e615b0a..8a5aa2bac 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-8.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-8.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.20/15.4.4.20-9-c-iii-8.js
- * @description Array.prototype.filter - return value of callbackfn is a nunmber (value is -0)
- */
-
-
-function testcase() {
-
- var accessed = false;
-
- function callbackfn(val, idx, obj) {
- accessed = true;
- return -0;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 0 && accessed;
- }
-runTestCase(testcase);
+// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +description: > + Array.prototype.filter - return value of callbackfn is a nunmber + (value is -0) +includes: [runTestCase.js] +---*/ + +function testcase() { + + var accessed = false; + + function callbackfn(val, idx, obj) { + accessed = true; + return -0; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 0 && accessed; + } +runTestCase(testcase); diff --git a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-9.js b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-9.js index 42ce920fc..4a7321bbe 100644 --- a/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-9.js +++ b/test/suite/ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-9.js @@ -1,21 +1,23 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved.
-/// Ecma International makes this code available under the terms and conditions set
-/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
-/// "Use Terms"). Any redistribution of this code must retain the above
-/// copyright and this notice and otherwise comply with the Use Terms.
-/**
- * @path ch15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-9.js
- * @description Array.prototype.filter - return value of callbackfn is a number (value is positive number)
- */
-
-
-function testcase() {
-
- function callbackfn(val, idx, obj) {
- return 5;
- }
-
- var newArr = [11].filter(callbackfn);
- return newArr.length === 1 && newArr[0] === 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.filter - return value of callbackfn is a number + (value is positive number) +includes: [runTestCase.js] +---*/ + +function testcase() { + + function callbackfn(val, idx, obj) { + return 5; + } + + var newArr = [11].filter(callbackfn); + return newArr.length === 1 && newArr[0] === 11; + } +runTestCase(testcase); |