diff options
author | André Bargull <andre.bargull@gmail.com> | 2018-02-09 09:09:47 -0800 |
---|---|---|
committer | Leo Balter <leonardo.balter@gmail.com> | 2018-02-09 12:09:47 -0500 |
commit | f95b56ab28c5f18150f30fbfa889a4f6ba0e50a1 (patch) | |
tree | d403f704c1b6a1842f12df380651919beaaf5fef /test/built-ins/Array/prototype/filter | |
parent | a01de4a722d088055a7d84d8c691ddd7109edb34 (diff) | |
download | qtdeclarative-testsuites-f95b56ab28c5f18150f30fbfa889a4f6ba0e50a1.tar.gz |
Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722d088055a7d84d8c691ddd7109edb34.
Diffstat (limited to 'test/built-ins/Array/prototype/filter')
224 files changed, 1945 insertions, 2213 deletions
diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js index c9b561676..c9d811439 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-1.js @@ -9,5 +9,5 @@ description: Array.prototype.filter applied to undefined throws a TypeError assert.throws(TypeError, function() { - Array.prototype.filter.call(undefined); // TypeError is thrown if value is undefined + Array.prototype.filter.call(undefined); // TypeError is thrown if value is undefined }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js index 9fa42cba0..f56c19437 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js @@ -7,12 +7,12 @@ es5id: 15.4.4.20-1-10 description: Array.prototype.filter applied to the Math object ---*/ -function callbackfn(val, idx, obj) { - return '[object Math]' === Object.prototype.toString.call(obj); -} + function callbackfn(val, idx, obj) { + return '[object Math]' === Object.prototype.toString.call(obj); + } -Math.length = 1; -Math[0] = 1; -var newArr = Array.prototype.filter.call(Math, callbackfn); + Math.length = 1; + Math[0] = 1; + var newArr = Array.prototype.filter.call(Math, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js index 19703f190..d9e730234 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-1-11 description: Array.prototype.filter applied to Date object ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof Date; -} + function callbackfn(val, idx, obj) { + return obj instanceof Date; + } -var obj = new Date(); -obj.length = 1; -obj[0] = 1; + var obj = new Date(); + obj.length = 1; + obj[0] = 1; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js index 09a5dbb37..9a7404b58 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-1-12 description: Array.prototype.filter applied to RegExp object ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof RegExp; -} + function callbackfn(val, idx, obj) { + return obj instanceof RegExp; + } -var obj = new RegExp(); -obj.length = 2; -obj[1] = true; + var obj = new RegExp(); + obj.length = 2; + obj[1] = true; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js index fbeaacc89..b5e440512 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js @@ -7,12 +7,12 @@ es5id: 15.4.4.20-1-13 description: Array.prototype.filter applied to the JSON object ---*/ -function callbackfn(val, idx, obj) { - return '[object JSON]' === Object.prototype.toString.call(JSON); -} + function callbackfn(val, idx, obj) { + return '[object JSON]' === Object.prototype.toString.call(JSON); + } -JSON.length = 1; -JSON[0] = 1; -var newArr = Array.prototype.filter.call(JSON, callbackfn); + JSON.length = 1; + JSON[0] = 1; + var newArr = Array.prototype.filter.call(JSON, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js index 0b9f3060a..7e77b5403 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-1-14 description: Array.prototype.filter applied to Error object ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof Error; -} + function callbackfn(val, idx, obj) { + return obj instanceof Error; + } -var obj = new Error(); -obj.length = 1; -obj[0] = 1; + var obj = new Error(); + obj.length = 1; + obj[0] = 1; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js index 0be84b256..314f8cf65 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-1-15 description: Array.prototype.filter applied to the Arguments object ---*/ -function callbackfn(val, idx, obj) { - return '[object Arguments]' === Object.prototype.toString.call(obj); -} + function callbackfn(val, idx, obj) { + return '[object Arguments]' === Object.prototype.toString.call(obj); + } -var obj = (function() { - return arguments; -}("a", "b")); + var obj = (function () { + return arguments; + }("a", "b")); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], "a", 'newArr[0]'); assert.sameValue(newArr[1], "b", 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js index 70e775afe..3c4abb006 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-2.js @@ -9,5 +9,5 @@ description: Array.prototype.filter applied to null throws a TypeError assert.throws(TypeError, function() { - Array.prototype.filter.call(null); + Array.prototype.filter.call(null); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js index 95aaebd9e..c8ed73db1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js @@ -7,13 +7,13 @@ es5id: 15.4.4.20-1-3 description: Array.prototype.filter applied to boolean primitive ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof Boolean; -} + function callbackfn(val, idx, obj) { + return obj instanceof Boolean; + } -Boolean.prototype[0] = true; -Boolean.prototype.length = 1; + Boolean.prototype[0] = true; + Boolean.prototype.length = 1; -var newArr = Array.prototype.filter.call(false, callbackfn); + var newArr = Array.prototype.filter.call(false, callbackfn); assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js index e7b7d2fdc..17517c532 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-1-4 description: Array.prototype.filter applied to Boolean Object ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof Boolean; -} + function callbackfn(val, idx, obj) { + return obj instanceof Boolean; + } -var obj = new Boolean(true); -obj.length = 2; -obj[0] = 11; -obj[1] = 12; + var obj = new Boolean(true); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js index 4e8c4ffd5..114e360ab 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js @@ -7,13 +7,13 @@ es5id: 15.4.4.20-1-5 description: Array.prototype.filter applied to number primitive ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof Number; -} + function callbackfn(val, idx, obj) { + return obj instanceof Number; + } -Number.prototype[0] = 1; -Number.prototype.length = 1; + Number.prototype[0] = 1; + Number.prototype.length = 1; -var newArr = Array.prototype.filter.call(2.5, callbackfn); + var newArr = Array.prototype.filter.call(2.5, callbackfn); assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js index 6f4bb4eb2..d73da1d91 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-1-6 description: Array.prototype.filter applied to Number object ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof Number; -} + function callbackfn(val, idx, obj) { + return obj instanceof Number; + } -var obj = new Number(-128); -obj.length = 2; -obj[0] = 11; -obj[1] = 12; + var obj = new Number(-128); + obj.length = 2; + obj[0] = 11; + obj[1] = 12; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js index c7a70ad25..8e85e3a8d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js @@ -7,10 +7,10 @@ es5id: 15.4.4.20-1-7 description: Array.prototype.filter applied to string primitive ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof String; -} + function callbackfn(val, idx, obj) { + return obj instanceof String; + } -var newArr = Array.prototype.filter.call("abc", callbackfn); + var newArr = Array.prototype.filter.call("abc", callbackfn); assert.sameValue(newArr[0], "a", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js index 35438987c..84df1f7aa 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js @@ -7,11 +7,11 @@ es5id: 15.4.4.20-1-8 description: Array.prototype.filter applied to String object ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof String; -} + function callbackfn(val, idx, obj) { + return obj instanceof String; + } -var obj = new String("abc"); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = new String("abc"); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], "a", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js index 01e194a56..b64de3811 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js @@ -7,17 +7,17 @@ es5id: 15.4.4.20-1-9 description: Array.prototype.filter applied to Function object ---*/ -function callbackfn(val, idx, obj) { - return obj instanceof Function; -} + function callbackfn(val, idx, obj) { + return obj instanceof Function; + } -var obj = function(a, b) { - return a + b; -}; -obj[0] = 11; -obj[1] = 9; + var obj = function (a, b) { + return a + b; + }; + obj[0] = 11; + obj[1] = 9; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[1], 9, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js index 803469954..d554b6850 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js @@ -9,12 +9,12 @@ description: > called on ---*/ -function callbackfn(val, idx, obj) -{ - return true; -} -var srcArr = [1, 2, 3, 4, 5]; -srcArr.filter(callbackfn); + function callbackfn(val, idx, obj) + { + return true; + } + var srcArr = [1,2,3,4,5]; + srcArr.filter(callbackfn); assert.sameValue(srcArr[0], 1, 'srcArr[0]'); assert.sameValue(srcArr[1], 2, 'srcArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js index 5bd456a8e..4ef4c19ab 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js @@ -9,15 +9,15 @@ description: > number of true returned by callbackfn ---*/ -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); + 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); assert.sameValue(resArr.length, 3, 'resArr.length'); assert.sameValue(resArr[0], 1, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js index a20ae4f18..6d278d962 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js @@ -7,16 +7,13 @@ es5id: 15.4.4.20-10-3 description: Array.prototype.filter - subclassed array when length is reduced ---*/ -foo.prototype = new Array(1, 2, 3); + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = 1; -function foo() {} -var f = new foo(); -f.length = 1; - -function cb() { - return true; -} -var a = f.filter(cb); + function cb(){return true;} + var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js index 10e8fa029..fa6b6603f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js @@ -7,16 +7,15 @@ es5id: 15.4.4.20-10-4 description: Array.prototype.filter doesn't visit expandos ---*/ -var callCnt = 0; + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + } + var srcArr = [1,2,3,4,5]; + srcArr["i"] = 10; + srcArr[true] = 11; -function callbackfn(val, idx, obj) -{ - callCnt++; -} -var srcArr = [1, 2, 3, 4, 5]; -srcArr["i"] = 10; -srcArr[true] = 11; - -var resArr = srcArr.filter(callbackfn); + var resArr = srcArr.filter(callbackfn); assert.sameValue(callCnt, 5, 'callCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js index 68c19c6a6..ef11a8172 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js @@ -9,17 +9,17 @@ description: > own data property ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var obj = { - 0: 12, - 1: 11, - 2: 9, - length: 2 -}; + var obj = { + 0: 12, + 1: 11, + 2: 9, + length: 2 + }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js index 683217637..7ef499298 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js @@ -9,27 +9,27 @@ description: > inherited accessor property ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var proto = {}; + var proto = {}; -Object.defineProperty(proto, "length", { - get: function() { - return 2; - }, - configurable: true -}); + Object.defineProperty(proto, "length", { + get: function () { + return 2; + }, + configurable: true + }); -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child[0] = 12; -child[1] = 11; -child[2] = 9; + var child = new Con(); + child[0] = 12; + child[1] = 11; + child[2] = 9; -var newArr = Array.prototype.filter.call(child, callbackfn); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js index 8a55f62fb..b707e5159 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js @@ -9,23 +9,22 @@ description: > own accessor property without a get function ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} + var obj = { + 0: 11, + 1: 12 + }; + Object.defineProperty(obj, "length", { + set: function () { }, + configurable: true + }); -var obj = { - 0: 11, - 1: 12 -}; -Object.defineProperty(obj, "length", { - set: function() {}, - configurable: true -}); - -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js index b5983c280..40c49cf05 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js @@ -9,30 +9,26 @@ description: > a get function that overrides an inherited accessor property ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} + Object.defineProperty(Object.prototype, "length", { + get: function () { + return 2; + }, + configurable: true + }); -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 obj = { - 0: 12, - 1: 11 -}; -Object.defineProperty(obj, "length", { - set: function() {}, - configurable: true -}); - -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js index 25652960d..b35a71c92 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js @@ -9,27 +9,26 @@ description: > 'length' is inherited accessor property without a get function ---*/ -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); + 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); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js index 545d914e6..64b7059d8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js @@ -9,19 +9,15 @@ description: > 'length property doesn't exist ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} + var obj = { 0: 11, 1: 12 }; -var obj = { - 0: 11, - 1: 12 -}; - -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js index 34c579c77..e2ff3af64 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js @@ -9,13 +9,13 @@ description: > implements its own property get method ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + 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; -}; + var func = function (a, b) { + var newArr = Array.prototype.filter.call(arguments, callbackfn); + return newArr.length === 2; + }; assert(func(12, 11), 'func(12, 11) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js index c13206d98..6850f6d21 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js @@ -9,12 +9,12 @@ description: > its own property get method ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 3; -} + function callbackfn(val, idx, obj) { + return obj.length === 3; + } -var str = new String("012"); + var str = new String("012"); -var newArr = Array.prototype.filter.call(str, callbackfn); + var newArr = Array.prototype.filter.call(str, callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js index 9bd2ef1c6..5f12746ae 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js @@ -9,17 +9,17 @@ description: > implements its own property get method ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + 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 fun = function (a, b) { + return a + b; + }; + fun[0] = 12; + fun[1] = 11; + fun[2] = 9; -var newArr = Array.prototype.filter.call(fun, callbackfn); + var newArr = Array.prototype.filter.call(fun, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js index 8e071501c..f8f1b84d4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js @@ -7,10 +7,10 @@ es5id: 15.4.4.20-2-2 description: Array.prototype.filter - 'length' is own data property on an Array ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var newArr = [12, 11].filter(callbackfn); + var newArr = [12, 11].filter(callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js index 4d9c4e414..5e74fafc6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js @@ -9,23 +9,21 @@ description: > an own data property that overrides an inherited data property ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var proto = { - length: 3 -}; + var proto = { length: 3 }; -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child.length = 2; -child[0] = 12; -child[1] = 11; -child[2] = 9; + var child = new Con(); + child.length = 2; + child[0] = 12; + child[1] = 11; + child[2] = 9; -var newArr = Array.prototype.filter.call(child, callbackfn); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js index 73ecc9ed1..563ef3bfc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js @@ -9,14 +9,14 @@ description: > overrides an inherited data property on an Array ---*/ -var arrProtoLen; + var arrProtoLen; -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -arrProtoLen = Array.prototype.length; -Array.prototype.length = 0; -var newArr = [12, 11].filter(callbackfn); + arrProtoLen = Array.prototype.length; + Array.prototype.length = 0; + var newArr = [12, 11].filter(callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js index e165dbc06..ca4c2d21e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js @@ -9,31 +9,31 @@ description: > data property that overrides an inherited accessor property ---*/ -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); + 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); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js index 9a8144cfc..6c754b15b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js @@ -9,22 +9,20 @@ description: > an inherited data property ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var proto = { - length: 2 -}; + var proto = { length: 2 }; -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child[0] = 12; -child[1] = 11; -child[2] = 9; + var child = new Con(); + child[0] = 12; + child[1] = 11; + child[2] = 9; -var newArr = Array.prototype.filter.call(child, callbackfn); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js index ba40ddd23..103cdc888 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js @@ -9,23 +9,23 @@ description: > an own accessor property ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var obj = {}; + var obj = {}; -Object.defineProperty(obj, "length", { - get: function() { - return 2; - }, - configurable: true -}); + Object.defineProperty(obj, "length", { + get: function () { + return 2; + }, + configurable: true + }); -obj[0] = 12; -obj[1] = 11; -obj[2] = 9; + obj[0] = 12; + obj[1] = 11; + obj[2] = 9; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js index e57b21228..25b022b3a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js @@ -9,30 +9,28 @@ description: > own accessor property that overrides an inherited data property ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var proto = { - length: 3 -}; + var proto = { length: 3 }; -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); + var child = new Con(); -Object.defineProperty(child, "length", { - get: function() { - return 2; - }, - configurable: true -}); + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); -child[0] = 12; -child[1] = 11; -child[2] = 9; + child[0] = 12; + child[1] = 11; + child[2] = 9; -var newArr = Array.prototype.filter.call(child, callbackfn); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js index 684b01b09..4c37454ba 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js @@ -10,35 +10,35 @@ description: > property ---*/ -function callbackfn(val, idx, obj) { - return obj.length === 2; -} + function callbackfn(val, idx, obj) { + return obj.length === 2; + } -var proto = {}; + var proto = {}; -Object.defineProperty(proto, "length", { - get: function() { - return 3; - }, - configurable: true -}); + Object.defineProperty(proto, "length", { + get: function () { + return 3; + }, + configurable: true + }); -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); + var child = new Con(); -Object.defineProperty(child, "length", { - get: function() { - return 2; - }, - configurable: true -}); + Object.defineProperty(child, "length", { + get: function () { + return 2; + }, + configurable: true + }); -child[0] = 12; -child[1] = 11; -child[2] = 9; + child[0] = 12; + child[1] = 11; + child[2] = 9; -var newArr = Array.prototype.filter.call(child, callbackfn); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js index be48ea578..17cdc5f73 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js @@ -7,19 +7,14 @@ es5id: 15.4.4.20-3-1 description: Array.prototype.filter - value of 'length' is undefined ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -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); + var obj = { 0: 0, 1: 1, length: undefined }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js index 8ef7f0477..63b2c4a18 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js @@ -9,19 +9,15 @@ description: > NaN) ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} + var obj = { 0: 9, length: NaN }; -var obj = { - 0: 9, - length: NaN -}; - -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js index 3bedc20ed..e495a64db 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js @@ -9,17 +9,13 @@ description: > positive number ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: "2" -}; + var obj = { 1: 11, 2: 9, length: "2" }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js index bab103450..c66292a88 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js @@ -9,17 +9,13 @@ description: > negative number ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: "-4294967294" -}; + var obj = { 1: 11, 2: 9, length: "-4294967294" }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js index 01d01c256..859ef4667 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js @@ -9,17 +9,13 @@ description: > number ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: "2.5" -}; + var obj = { 1: 11, 2: 9, length: "2.5" }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js index 03bcf8a29..03193102f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js @@ -7,19 +7,16 @@ es5id: 15.4.4.20-3-14 description: Array.prototype.filter - 'length' is a string containing -Infinity ---*/ -var accessed2 = false; + var accessed2 = false; -function callbackfn2(val, idx, obj) { - accessed2 = true; - return true; -} + function callbackfn2(val, idx, obj) { + accessed2 = true; + return true; + } -var obj2 = { - 0: 9, - length: "-Infinity" -}; + var obj2 = { 0: 9, length: "-Infinity" }; -var newArr2 = Array.prototype.filter.call(obj2, callbackfn2); + var newArr2 = Array.prototype.filter.call(obj2, callbackfn2); assert.sameValue(accessed2, false, 'accessed2'); assert.sameValue(newArr2.length, 0, 'newArr2.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js index 7cc2cb5f8..e5be122e8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js @@ -9,17 +9,13 @@ description: > exponential number ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: "2E0" -}; + var obj = { 1: 11, 2: 9, length: "2E0" }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js index 1e447f105..286093b8b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js @@ -9,17 +9,13 @@ description: > number ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: "0x0002" -}; + var obj = { 1: 11, 2: 9, length: "0x0002" }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js index a3c2bf7fa..84b64d402 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js @@ -9,17 +9,13 @@ description: > with leading zeros ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: "0002.00" -}; + var obj = { 1: 11, 2: 9, length: "0002.00" }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js index b42c4c5af..de3c43f57 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js @@ -9,19 +9,15 @@ description: > convert to a number ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} + var obj = { 0: 9, length: "asdf!_" }; -var obj = { - 0: 9, - length: "asdf!_" -}; - -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js index 11ba06792..f1ac554ec 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js @@ -9,21 +9,21 @@ description: > an own toString method. ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: { - toString: function() { - return '2'; - } - } -}; + var obj = { + 1: 11, + 2: 9, + length: { + toString: function () { + return '2'; + } + } + }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js index 4c87b6e3d..3e348991d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js @@ -9,16 +9,12 @@ description: > is 1 (length overridden to true(type conversion)) ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 0: 11, - 1: 9, - length: true -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, 1: 9, length: true }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js index 7b7b93e5b..c8e77de72 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js @@ -9,21 +9,21 @@ description: > an own valueOf method. ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: { - valueOf: function() { - return 2; - } - } -}; + var obj = { + 1: 11, + 2: 9, + length: { + valueOf: function () { + return 2; + } + } + }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js index c65ba9ca5..01fc372d5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js @@ -10,29 +10,29 @@ description: > returns a string ---*/ -var firstStepOccured = false; -var secondStepOccured = false; + var firstStepOccured = false; + var secondStepOccured = false; -function callbackfn(val, idx, obj) { - return true; -} + 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 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); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js index 0e4bf3671..a6463ad6a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-22.js @@ -10,32 +10,32 @@ description: > primitive values ---*/ -var accessed = false; -var firstStepOccured = false; -var secondStepOccured = false; + var accessed = false; + var firstStepOccured = false; + var secondStepOccured = false; -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -var obj = { - 1: 11, - 2: 12, + var obj = { + 1: 11, + 2: 12, - length: { - valueOf: function() { - firstStepOccured = true; - return {}; - }, - toString: function() { - secondStepOccured = true; - return {}; - } - } -}; + length: { + valueOf: function () { + firstStepOccured = true; + return {}; + }, + toString: function () { + secondStepOccured = true; + return {}; + } + } + }; assert.throws(TypeError, function() { - Array.prototype.filter.call(obj, callbackfn); + Array.prototype.filter.call(obj, callbackfn); }); assert.sameValue(accessed, false, 'accessed'); assert(firstStepOccured, 'firstStepOccured !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js index c02b3f301..f2e7b2e45 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js @@ -9,37 +9,37 @@ description: > is an object with an own toString and inherited valueOf methods ---*/ -var valueOfAccessed = false; -var toStringAccessed = false; + var valueOfAccessed = false; + var toStringAccessed = false; -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var proto = { - valueOf: function() { - valueOfAccessed = true; - return 2; - } -}; + var proto = { + valueOf: function () { + valueOfAccessed = true; + return 2; + } + }; -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); + var child = new Con(); -child.toString = function() { - toStringAccessed = true; - return '1'; -}; + child.toString = function () { + toStringAccessed = true; + return '1'; + }; -var obj = { - 1: 11, - 2: 9, - length: child -}; + var obj = { + 1: 11, + 2: 9, + length: child + }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js index a2cc49a04..31b87b47d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js @@ -9,17 +9,17 @@ description: > non-integer, ensure truncation occurs in the proper direction ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: 2.685 -}; + var obj = { + 1: 11, + 2: 9, + length: 2.685 + }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js index f32cac694..3f8b1ffd8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js @@ -9,17 +9,17 @@ description: > non-integer ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: -4294967294.5 -}; + var obj = { + 1: 11, + 2: 9, + length: -4294967294.5 + }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js index 53fd3ab2c..9b1250407 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js @@ -7,18 +7,14 @@ es5id: 15.4.4.20-3-3 description: Array.prototype.filter - value of 'length' is a number (value is 0) ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} - -var obj = { - 0: 11, - length: 0 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, length: 0 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js index d0afc2288..a2a73f274 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js @@ -9,18 +9,14 @@ description: > +0) ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} - -var obj = { - 0: 11, - length: +0 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, length: +0 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js index 675a41cb2..2fa9d19cf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js @@ -9,18 +9,14 @@ description: > -0) ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} - -var obj = { - 0: 11, - length: -0 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, length: -0 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js index 44e5a2aa1..dd9b8839b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js @@ -9,17 +9,13 @@ description: > positive) ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: 2 -}; + var obj = { 1: 11, 2: 9, length: 2 }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js index b9003218f..28d540592 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js @@ -9,16 +9,12 @@ description: > negative) ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 1: 11, - 2: 9, - length: -4294967294 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 1: 11, 2: 9, length: -4294967294 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js index 149c2011a..a31259a2e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js @@ -9,19 +9,15 @@ description: > -Infinity) ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + accessed = true; + return true; + } -function callbackfn(val, idx, obj) { - accessed = true; - return true; -} + var obj = { 0: 9, length: -Infinity }; -var obj = { - 0: 9, - length: -Infinity -}; - -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js index ac03e0fc9..5db65663d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-1.js @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-1 description: Array.prototype.filter throws TypeError if callbackfn is undefined ---*/ -var arr = new Array(10); + var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(); + arr.filter(); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js index bf2dabe14..39f1abd7b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js @@ -9,18 +9,15 @@ description: > was thrown by step 2 ---*/ -var obj = { - 0: 11, - 1: 12 -}; + var obj = { 0: 11, 1: 12 }; -Object.defineProperty(obj, "length", { - get: function() { - throw new Test262Error(); - }, - configurable: true -}); + Object.defineProperty(obj, "length", { + get: function () { + throw new Test262Error(); + }, + configurable: true + }); assert.throws(Test262Error, function() { - Array.prototype.filter.call(obj, undefined); + Array.prototype.filter.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js index 6cefc8ce1..0eabd02ec 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js @@ -9,22 +9,19 @@ description: > was thrown by step 3 ---*/ -var obj = { - 0: 11, - 1: 12 -}; + var obj = { 0: 11, 1: 12 }; -Object.defineProperty(obj, "length", { - get: function() { - return { - toString: function() { - throw new Test262Error(); - } - }; - }, - configurable: true -}); + Object.defineProperty(obj, "length", { + get: function () { + return { + toString: function () { + throw new Test262Error(); + } + }; + }, + configurable: true + }); assert.throws(Test262Error, function() { - Array.prototype.filter.call(obj, undefined); + Array.prototype.filter.call(obj, undefined); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js index dce334c24..de1ad7023 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-4-12 description: Array.prototype.filter - 'callbackfn' is a function ---*/ -function callbackfn(val, idx, obj) { - if (idx === 1) { - return val === 9; - } - return false; -} + function callbackfn(val, idx, obj) { + if (idx === 1) { + return val === 9; + } + return false; + } -var newArr = [11, 9].filter(callbackfn); + var newArr = [11, 9].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js index 70d48daa7..af35f5776 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-15.js @@ -9,27 +9,25 @@ description: > passing undefined for callbackfn ---*/ -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 -}); + 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 + }); assert.throws(TypeError, function() { - Array.prototype.filter.call(obj); + Array.prototype.filter.call(obj); }); assert(lengthAccessed, 'lengthAccessed !== true'); assert.sameValue(loopAccessed, false, 'loopAccessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js index 511003bbf..07add5f00 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-2.js @@ -9,7 +9,7 @@ description: > unreferenced ---*/ -var arr = new Array(10); + var arr = new Array(10); assert.throws(ReferenceError, function() { - arr.filter(foo); + arr.filter(foo); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js index 0e557696d..a56dd4e8d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-3.js @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-3 description: Array.prototype.filter throws TypeError if callbackfn is null ---*/ -var arr = new Array(10); + var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(null); + arr.filter(null); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js index d49c8355c..6e9370835 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-4.js @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-4 description: Array.prototype.filter throws TypeError if callbackfn is boolean ---*/ -var arr = new Array(10); + var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(true); + arr.filter(true); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js index d5a3b5289..6fedc6587 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-5.js @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-5 description: Array.prototype.filter throws TypeError if callbackfn is number ---*/ -var arr = new Array(10); + var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(5); + arr.filter(5); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js index 5f9d1386b..cef7251b1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-6.js @@ -7,7 +7,7 @@ es5id: 15.4.4.20-4-6 description: Array.prototype.filter throws TypeError if callbackfn is string ---*/ -var arr = new Array(10); + var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter("abc"); + arr.filter("abc"); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js index f9e425427..aa1240371 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-7.js @@ -9,7 +9,7 @@ description: > without [[Call]] internal method ---*/ -var arr = new Array(10); + var arr = new Array(10); assert.throws(TypeError, function() { - arr.filter(new Object()); + arr.filter(new Object()); }); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js index cde11fbf2..fbd5396d8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-8.js @@ -9,21 +9,18 @@ description: > visible when an exception occurs ---*/ -var obj = { - 0: 11, - 1: 12 -}; + var obj = { 0: 11, 1: 12 }; -var accessed = false; + var accessed = false; -Object.defineProperty(obj, "length", { - get: function() { - accessed = true; - return 2; - }, - configurable: true -}); + Object.defineProperty(obj, "length", { + get: function () { + accessed = true; + return 2; + }, + configurable: true + }); assert.throws(TypeError, function() { - Array.prototype.filter.call(obj, null); + Array.prototype.filter.call(obj, null); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js index 45ba29f89..c2e729577 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-9.js @@ -9,25 +9,22 @@ description: > visible when an exception occurs ---*/ -var obj = { - 0: 11, - 1: 12 -}; + var obj = { 0: 11, 1: 12 }; -var accessed = false; + var accessed = false; -Object.defineProperty(obj, "length", { - get: function() { - return { - toString: function() { - accessed = true; - return "2"; - } - }; - }, - configurable: true -}); + Object.defineProperty(obj, "length", { + get: function () { + return { + toString: function () { + accessed = true; + return "2"; + } + }; + }, + configurable: true + }); assert.throws(TypeError, function() { - Array.prototype.filter.call(obj, null); + Array.prototype.filter.call(obj, null); }); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js index ebbd6c1a4..ce1ad3c7e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js @@ -8,14 +8,14 @@ description: Array.prototype.filter - thisArg not passed to strict callbackfn flags: [noStrict] ---*/ -var innerThisCorrect = false; + var innerThisCorrect = false; -function callbackfn(val, idx, obj) { - "use strict"; - innerThisCorrect = this === undefined; - return true; -} + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } -[1].filter(callbackfn); + [1].filter(callbackfn); assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js index fe1b29057..96063ef48 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js @@ -9,14 +9,14 @@ flags: [noStrict] ---*/ (function() { - this._15_4_4_20_5_1 = false; - var _15_4_4_20_5_1 = true; + 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); + function callbackfn(val, idx, obj) { + return this._15_4_4_20_5_1; + } + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn); - assert.sameValue(resArr.length, 0, 'resArr.length'); +assert.sameValue(resArr.length, 0, 'resArr.length'); })(); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js index a5afd4682..dff16966b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-5-10 description: Array.prototype.filter - Array Object can be used as thisArg ---*/ -var accessed = false; -var objArray = new Array(10); + var accessed = false; + var objArray = new Array(10); -function callbackfn(val, idx, obj) { - accessed = true; - return this === objArray; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objArray; + } -var newArr = [11].filter(callbackfn, objArray); + var newArr = [11].filter(callbackfn, objArray); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js index 0ca6f9f66..93cc528d0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-11 description: Array.prototype.filter - String Object can be used as thisArg ---*/ -var accessed = false; -var objString = new String(); + var accessed = false; + var objString = new String(); -function callbackfn(val, idx, obj) { - accessed = true; - return this === objString; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objString; + } -var newArr = [11].filter(callbackfn, objString); + var newArr = [11].filter(callbackfn, objString); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js index 2d7cef46d..d4dc45bda 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-12 description: Array.prototype.filter - Boolean Object can be used as thisArg ---*/ -var accessed = false; -var objBoolean = new Boolean(); + var accessed = false; + var objBoolean = new Boolean(); -function callbackfn(val, idx, obj) { - accessed = true; - return this === objBoolean; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objBoolean; + } -var newArr = [11].filter(callbackfn, objBoolean); + var newArr = [11].filter(callbackfn, objBoolean); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js index d5cb60c89..621f2def0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-13 description: Array.prototype.filter - Number Object can be used as thisArg ---*/ -var accessed = false; -var objNumber = new Number(); + var accessed = false; + var objNumber = new Number(); -function callbackfn(val, idx, obj) { - accessed = true; - return this === objNumber; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objNumber; + } -var newArr = [11].filter(callbackfn, objNumber); + var newArr = [11].filter(callbackfn, objNumber); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js index e455d8d4c..195f95d29 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-14 description: Array.prototype.filter - the Math object can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return this === Math; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === Math; + } -var newArr = [11].filter(callbackfn, Math); + var newArr = [11].filter(callbackfn, Math); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js index 596addb58..61cb77e50 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-5-15 description: Array.prototype.filter - Date Object can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -var objDate = new Date(); + var objDate = new Date(); -function callbackfn(val, idx, obj) { - accessed = true; - return this === objDate; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objDate; + } -var newArr = [11].filter(callbackfn, objDate); + var newArr = [11].filter(callbackfn, objDate); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js index beafca6fd..d7b6b9e23 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js @@ -7,16 +7,16 @@ es5id: 15.4.4.20-5-16 description: Array.prototype.filter - RegExp Object can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -var objRegExp = new RegExp(); + var objRegExp = new RegExp(); -function callbackfn(val, idx, obj) { - accessed = true; - return this === objRegExp; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objRegExp; + } -var newArr = [11].filter(callbackfn, objRegExp); + var newArr = [11].filter(callbackfn, objRegExp); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js index 569a7d691..b326d202c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-17 description: Array.prototype.filter - the JSON object can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return this === JSON; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === JSON; + } -var newArr = [11].filter(callbackfn, JSON); + var newArr = [11].filter(callbackfn, JSON); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js index 03516a935..98b455631 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-18 description: Array.prototype.filter - Error Object can be used as thisArg ---*/ -var accessed = false; -var objError = new RangeError(); + var accessed = false; + var objError = new RangeError(); -function callbackfn(val, idx, obj) { - accessed = true; - return this === objError; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objError; + } -var newArr = [11].filter(callbackfn, objError); + var newArr = [11].filter(callbackfn, objError); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js index 16869222c..0c69ec037 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js @@ -9,19 +9,19 @@ description: > thisArg ---*/ -var accessed = false; -var arg; + var accessed = false; + var arg; -function callbackfn(val, idx, obj) { - accessed = true; - return this === arg; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === arg; + } -(function fun() { - arg = arguments; -}(1, 2, 3)); + (function fun() { + arg = arguments; + }(1, 2, 3)); -var newArr = [11].filter(callbackfn, arg); + var newArr = [11].filter(callbackfn, arg); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js index 01a3a94d6..0ef3ca82e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js @@ -7,16 +7,15 @@ es5id: 15.4.4.20-5-2 description: Array.prototype.filter - thisArg is Object ---*/ -var res = false; -var o = new Object(); -o.res = true; + var res = false; + var o = new Object(); + o.res = true; + function callbackfn(val, idx, obj) + { + return this.res; + } -function callbackfn(val, idx, obj) -{ - return this.res; -} - -var srcArr = [1]; -var resArr = srcArr.filter(callbackfn, o); + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,o); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js index 1e1230bc4..bbb9911ac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js @@ -9,14 +9,14 @@ description: Array.prototype.filter - the global object can be used as thisArg var global = this; -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return this === global; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === global; + } -var newArr = [11].filter(callbackfn, global); + var newArr = [11].filter(callbackfn, global); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js index b228ea16c..61e3644cf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-22 description: Array.prototype.filter - boolean primitive can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === false; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === false; + } -var newArr = [11].filter(callbackfn, false); + var newArr = [11].filter(callbackfn, false); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js index b7435cbf2..d07c4c603 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-23 description: Array.prototype.filter - number primitive can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === 101; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === 101; + } -var newArr = [11].filter(callbackfn, 101); + var newArr = [11].filter(callbackfn, 101); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js index ec99f9b2b..ac195d2b1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-24 description: Array.prototype.filter - string primitive can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return this.valueOf() === "abc"; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this.valueOf() === "abc"; + } -var newArr = [11].filter(callbackfn, "abc"); + var newArr = [11].filter(callbackfn, "abc"); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js index 691c695e7..06ea3908d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js @@ -9,6 +9,6 @@ description: > is the returned array ---*/ -var newArr = [11].filter(function() {}); + var newArr = [11].filter(function () { }); assert(Array.isArray(newArr), 'Array.isArray(newArr) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js index 676b5f39b..0f41a07e4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js @@ -7,6 +7,6 @@ es5id: 15.4.4.20-5-28 description: Array.prototype.filter - the returned array is instanceof Array ---*/ -var newArr = [11].filter(function() {}); + var newArr = [11].filter(function () { }); assert(newArr instanceof Array, 'newArr instanceof Array !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js index 88656b813..49b049b6f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js @@ -7,6 +7,6 @@ es5id: 15.4.4.20-5-29 description: Array.prototype.filter - returns an array whose length is 0 ---*/ -var newArr = [11].filter(function() {}); + var newArr = [11].filter(function () { }); assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js index 4ab8cdc1c..a9eb5bdd9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js @@ -7,16 +7,15 @@ es5id: 15.4.4.20-5-3 description: Array.prototype.filter - thisArg is Array ---*/ -var res = false; -var a = new Array(); -a.res = true; + var res = false; + var a = new Array(); + a.res = true; + function callbackfn(val, idx, obj) + { + return this.res; + } -function callbackfn(val, idx, obj) -{ - return this.res; -} - -var srcArr = [1]; -var resArr = srcArr.filter(callbackfn, a); + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,a); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js index 8a3fb876f..19311b2ae 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js @@ -8,16 +8,16 @@ description: Array.prototype.filter - thisArg not passed flags: [noStrict] ---*/ -function innerObj() { - this._15_4_4_20_5_30 = true; - var _15_4_4_20_5_30 = false; + 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; -} + 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; + } assert(new innerObj().retVal, 'new innerObj().retVal !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js index 08789d8e3..e4c6b1b24 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js @@ -9,18 +9,17 @@ description: > template(prototype) ---*/ -var res = false; + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } -function callbackfn(val, idx, obj) -{ - return this.res; -} + function foo(){} + foo.prototype.res = true; + var f = new foo(); -function foo() {} -foo.prototype.res = true; -var f = new foo(); - -var srcArr = [1]; -var resArr = srcArr.filter(callbackfn, f); + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,f); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js index a024bdc32..a46d82882 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js @@ -7,18 +7,17 @@ es5id: 15.4.4.20-5-5 description: Array.prototype.filter - thisArg is object from object template ---*/ -var res = false; + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } -function callbackfn(val, idx, obj) -{ - return this.res; -} + function foo(){} + var f = new foo(); + f.res = true; -function foo() {} -var f = new foo(); -f.res = true; - -var srcArr = [1]; -var resArr = srcArr.filter(callbackfn, f); + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,f); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js index 25fa96c97..a76f146d6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js @@ -7,17 +7,16 @@ es5id: 15.4.4.20-5-6 description: Array.prototype.filter - thisArg is function ---*/ -var res = false; + var res = false; + function callbackfn(val, idx, obj) + { + return this.res; + } -function callbackfn(val, idx, obj) -{ - return this.res; -} + function foo(){} + foo.res = true; -function foo() {} -foo.res = true; - -var srcArr = [1]; -var resArr = srcArr.filter(callbackfn, foo); + var srcArr = [1]; + var resArr = srcArr.filter(callbackfn,foo); assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js index 7429c85bc..7563712c2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js @@ -7,14 +7,14 @@ es5id: 15.4.4.20-5-7 description: Array.prototype.filter - built-in functions can be used as thisArg ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return this === eval; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === eval; + } -var newArr = [11].filter(callbackfn, eval); + var newArr = [11].filter(callbackfn, eval); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js index 9ab52aa3e..154d0bbdb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js @@ -7,15 +7,15 @@ es5id: 15.4.4.20-5-9 description: Array.prototype.filter - Function Object can be used as thisArg ---*/ -var accessed = false; -var objFunction = function() {}; + var accessed = false; + var objFunction = function () { }; -function callbackfn(val, idx, obj) { - accessed = true; - return this === objFunction; -} + function callbackfn(val, idx, obj) { + accessed = true; + return this === objFunction; + } -var newArr = [11].filter(callbackfn, objFunction); + var newArr = [11].filter(callbackfn, objFunction); assert.sameValue(newArr[0], 11, 'newArr[0]'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js index 719c1490e..aa434d235 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js @@ -9,8 +9,8 @@ description: > (empty array) ---*/ -function cb() {} -var a = [].filter(cb); + function cb(){} + var a = [].filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js index 65a07c7a8..a2deb91e5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js @@ -9,14 +9,13 @@ description: > (subclassed Array, length overridden to null (type conversion)) ---*/ -foo.prototype = new Array(1, 2, 3); + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = null; -function foo() {} -var f = new foo(); -f.length = null; - -function cb() {} -var a = f.filter(cb); + function cb(){} + var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js index 4e1742878..5da697fe2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js @@ -9,14 +9,13 @@ description: > (subclassed Array, length overridden to false (type conversion)) ---*/ -foo.prototype = new Array(1, 2, 3); + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = false; -function foo() {} -var f = new foo(); -f.length = false; - -function cb() {} -var a = f.filter(cb); + function cb(){} + var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js index 72579c85e..88d755df8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js @@ -9,14 +9,13 @@ description: > (subclassed Array, length overridden to 0 (type conversion)) ---*/ -foo.prototype = new Array(1, 2, 3); + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = 0; -function foo() {} -var f = new foo(); -f.length = 0; - -function cb() {} -var a = f.filter(cb); + function cb(){} + var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js index 6209e7107..71f4dc489 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js @@ -9,14 +9,13 @@ description: > (subclassed Array, length overridden to '0' (type conversion)) ---*/ -foo.prototype = new Array(1, 2, 3); + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); + f.length = '0'; -function foo() {} -var f = new foo(); -f.length = '0'; - -function cb() {} -var a = f.filter(cb); + function cb(){} + var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js index 0d40729d1..dad709203 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js @@ -9,20 +9,15 @@ description: > (subclassed Array, length overridden with obj with valueOf) ---*/ -foo.prototype = new Array(1, 2, 3); + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); -function foo() {} -var f = new foo(); + var o = { valueOf: function () { return 0;}}; + f.length = o; -var o = { - valueOf: function() { - return 0; - } -}; -f.length = o; - -function cb() {} -var a = f.filter(cb); + function cb(){} + var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js index b212e2511..a778ad888 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js @@ -10,26 +10,21 @@ description: > (toString)) ---*/ -foo.prototype = new Array(1, 2, 3); + foo.prototype = new Array(1, 2, 3); + function foo() {} + var f = new foo(); -function foo() {} -var f = new foo(); + var o = { toString: function () { return '0';}}; + f.length = o; -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. -// 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); + function cb(){} + var a = f.filter(cb); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js index 851aa7a75..1fd2bb792 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js @@ -9,29 +9,28 @@ description: > (subclassed Array, length overridden with [] ---*/ -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); + 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); assert(Array.isArray(a), 'Array.isArray(a) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js index 265b9632b..97a92c2de 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js @@ -9,13 +9,13 @@ description: > array after it is called ---*/ -function callbackfn(val, idx, obj) { - srcArr[2] = 3; - srcArr[5] = 6; - return true; -} + function callbackfn(val, idx, obj) { + srcArr[2] = 3; + srcArr[5] = 6; + return true; + } -var srcArr = [1, 2, , 4, 5]; -var resArr = srcArr.filter(callbackfn); + var srcArr = [1, 2, , 4, 5]; + var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js index 34e27ba56..866e363fc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js @@ -9,18 +9,18 @@ description: > after it is called ---*/ -function callbackfn(val, idx, obj) -{ - srcArr[2] = -1; - srcArr[4] = -1; - if (val > 0) - return true; - else - return false; -} + 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); + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 3, 'resArr.length'); assert.sameValue(resArr[0], 1, 'resArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js index 5f14532d2..23cf770ca 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js @@ -9,18 +9,18 @@ description: > after the call ---*/ -function callbackfn(val, idx, obj) -{ - delete srcArr[2]; - delete srcArr[4]; - if (val > 0) - return true; - else - return false; -} + 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); + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.filter(callbackfn); // two elements deleted assert.sameValue(resArr.length, 3, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js index d3018ec04..9e817d779 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js @@ -9,13 +9,13 @@ description: > Array.length is decreased ---*/ -function callbackfn(val, idx, obj) -{ - srcArr.length = 2; - return true; -} + function callbackfn(val, idx, obj) + { + srcArr.length = 2; + return true; + } -var srcArr = [1, 2, 3, 4, 6]; -var resArr = srcArr.filter(callbackfn); + var srcArr = [1,2,3,4,6]; + var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 2, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js index 396126ea1..3165b934c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js @@ -9,15 +9,15 @@ description: > sparse array ---*/ -function callbackfn(val, idx, obj) -{ - srcArr[1000] = 3; - return true; -} + 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); + var srcArr = new Array(10); + srcArr[1] = 1; + srcArr[2] = 2; + var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 2, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js index 0ef2af055..6bbe73b49 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js @@ -9,20 +9,20 @@ description: > call when same index is also present in prototype ---*/ -function callbackfn(val, idx, obj) -{ - delete srcArr[2]; - delete srcArr[4]; - if (val > 0) - return true; - else - return false; -} + 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]; + Array.prototype[4] = 5; + var srcArr = [1,2,3,4,5]; + var resArr = srcArr.filter(callbackfn); + delete Array.prototype[4]; // only one element deleted assert.sameValue(resArr.length, 4, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js index accd42a60..6733d095d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js @@ -9,18 +9,18 @@ description: > deleted during the call ---*/ -var o = new Object(); -o.srcArr = [1, 2, 3, 4, 5]; + 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; -} + function callbackfn(val, idx, obj) { + delete o.srcArr; + if (val > 0) + return true; + else + return false; + } -var resArr = o.srcArr.filter(callbackfn); + var resArr = o.srcArr.filter(callbackfn); assert.sameValue(resArr.length, 5, 'resArr.length'); assert.sameValue(typeof o.srcArr, "undefined", 'typeof o.srcArr'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js index c7fa048ef..6b119020e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js @@ -7,20 +7,16 @@ es5id: 15.4.4.20-9-8 description: Array.prototype.filter - no observable effects occur if len is 0 ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return val > 10; -} + function callbackfn(val, idx, obj) { + accessed = true; + return val > 10; + } -var obj = { - 0: 11, - 1: 12, - length: 0 -}; + var obj = { 0: 11, 1: 12, length: 0 }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(accessed, false, 'accessed'); assert.sameValue(obj.length, 0, 'obj.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js index e0bd841bf..bab2effd5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js @@ -9,28 +9,24 @@ description: > number of iterations ---*/ -var called = 0; + var called = 0; -function callbackfn(val, idx, obj) { - called++; - return true; -} + function callbackfn(val, idx, obj) { + called++; + return true; + } -var obj = { - 1: 12, - 2: 9, - length: 2 -}; + var obj = { 1: 12, 2: 9, length: 2 }; -Object.defineProperty(obj, "0", { - get: function() { - obj.length = 3; - return 11; - }, - configurable: true -}); + Object.defineProperty(obj, "0", { + get: function () { + obj.length = 3; + return 11; + }, + configurable: true + }); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js index 899156930..db984c4cc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js @@ -9,17 +9,16 @@ description: > been assigned values ---*/ -var callCnt = 0; + var callCnt = 0; + function callbackfn(val, idx, obj) + { + callCnt++; + return false; + } -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); + var srcArr = new Array(10); + srcArr[1] = undefined; //explicitly assigning a value + var resArr = srcArr.filter(callbackfn); assert.sameValue(resArr.length, 0, 'resArr.length'); assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js index d4724b924..c2c66ae19 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js @@ -9,24 +9,21 @@ description: > prototype index property not to be visited on an Array-like Object ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var obj = { - 2: 2, - length: 20 -}; + 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 -}); + Object.defineProperty(obj, "0", { + get: function () { + delete Object.prototype[1]; + return 0; + }, + configurable: true + }); -Object.prototype[1] = 1; -var newArr = Array.prototype.filter.call(obj, callbackfn); + Object.prototype[1] = 1; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js index 39ea8f0a1..643554ab8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js @@ -9,21 +9,21 @@ description: > prototype index property not to be visited on an Array ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var arr = [0, , 2]; + 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 -}); + Object.defineProperty(arr, "0", { + get: function () { + delete Array.prototype[1]; + return 0; + }, + configurable: true + }); -Array.prototype[1] = 1; -var newArr = arr.filter(callbackfn); + Array.prototype[1] = 1; + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js index 7b914a1ee..18e21b40e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js @@ -10,26 +10,21 @@ description: > Array-like object ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var obj = { - 0: 0, - 1: 111, - 2: 2, - length: 10 -}; + 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 -}); + Object.defineProperty(obj, "0", { + get: function () { + delete obj[1]; + return 0; + }, + configurable: true + }); -Object.prototype[1] = 1; -var newArr = Array.prototype.filter.call(obj, callbackfn); + Object.prototype[1] = 1; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js index 204e94c66..c023e3735 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js @@ -9,21 +9,21 @@ description: > property causes prototype index property to be visited on an Array ---*/ -function callbackfn(val, idx, obj) { - return val < 3 ? true : false; -} -var arr = [0, 111, 2]; + 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 -}); + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); -Array.prototype[1] = 1; -var newArr = arr.filter(callbackfn); + Array.prototype[1] = 1; + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js index 00b6a41af..6147fab67 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js @@ -9,20 +9,20 @@ description: > property not to be visited ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var arr = [0, 1, 2, "last"]; + 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 -}); + Object.defineProperty(arr, "0", { + get: function () { + arr.length = 3; + return 0; + }, + configurable: true + }); -var newArr = arr.filter(callbackfn); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js index 1f87dab30..4e253c64e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js @@ -9,27 +9,27 @@ description: > property causes prototype index property to be visited ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var arr = [0, 1, 2]; + function callbackfn(val, idx, obj) { + return true; + } + var arr = [0, 1, 2]; -Object.defineProperty(Array.prototype, "2", { - get: function() { - return "prototype"; - }, - configurable: true -}); + Object.defineProperty(Array.prototype, "2", { + get: function () { + return "prototype"; + }, + configurable: true + }); -Object.defineProperty(arr, "1", { - get: function() { - arr.length = 2; - return 1; - }, - configurable: true -}); + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); -var newArr = arr.filter(callbackfn); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[2], "prototype", 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js index b92fde3af..c81608958 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js @@ -10,28 +10,28 @@ description: > flags: [noStrict] ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var arr = [0, 1, 2]; + var arr = [0, 1, 2]; -Object.defineProperty(arr, "2", { - get: function() { - return "unconfigurable"; - }, - configurable: false -}); + Object.defineProperty(arr, "2", { + get: function () { + return "unconfigurable"; + }, + configurable: false + }); -Object.defineProperty(arr, "1", { - get: function() { - arr.length = 2; - return 1; - }, - configurable: true -}); + Object.defineProperty(arr, "1", { + get: function () { + arr.length = 2; + return 1; + }, + configurable: true + }); -var newArr = arr.filter(callbackfn); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[2], "unconfigurable", 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js index a9b8cdae4..63ffe45b5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js @@ -9,21 +9,21 @@ description: > here ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = {}; + var obj = {}; -Object.defineProperty(obj, "length", { - get: function() { - obj[2] = "length"; - return 3; - }, - configurable: true -}); + Object.defineProperty(obj, "length", { + get: function () { + obj[2] = "length"; + return 3; + }, + configurable: true + }); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], "length", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js index fd2a2612e..9201770ac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js @@ -9,23 +9,20 @@ description: > here ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var obj = { - 2: 6.99, - 8: 19 -}; + 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 -}); + Object.defineProperty(obj, "length", { + get: function () { + delete obj[2]; + return 10; + }, + configurable: true + }); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.notSameValue(newArr[0], 6.99, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js index 61ad18595..81a5e3d11 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js @@ -9,28 +9,26 @@ description: > current position are visited on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - length: 2 -}; + 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 -}); + 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); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js index d2d1fd70c..150eda57c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js @@ -9,26 +9,26 @@ description: > current position are visited on an Array ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var arr = [0, , 2]; + 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 -}); + 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); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js index d0bc0fb1e..0932eb334 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js @@ -9,27 +9,25 @@ description: > after current position are visited on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var obj = { - length: 2 -}; + function callbackfn(val, idx, obj) { + return true; + } + var obj = { length: 2 }; -Object.defineProperty(obj, "0", { - get: function() { - Object.defineProperty(Object.prototype, "1", { - get: function() { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true -}); + 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); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(Array[1], 6.99, 'Array[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js index 1fea78746..677e3106f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js @@ -9,25 +9,25 @@ description: > after current position are visited on an Array ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var arr = [0, , 2]; + function callbackfn(val, idx, obj) { + return true; + } + var arr = [0, , 2]; -Object.defineProperty(arr, "0", { - get: function() { - Object.defineProperty(Array.prototype, "1", { - get: function() { - return 6.99; - }, - configurable: true - }); - return 0; - }, - configurable: true -}); + 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); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js index 0593df24f..00d064e23 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js @@ -9,32 +9,30 @@ description: > property not to be visited on an Array-like object ---*/ -var accessed = false; -var obj = { - length: 2 -}; + var accessed = false; + var obj = { length: 2 }; -function callbackfn(val, idx, o) { - accessed = true; - return true; -} + function callbackfn(val, idx, o) { + accessed = true; + return true; + } -Object.defineProperty(obj, "1", { - get: function() { - return 6.99; - }, - configurable: 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 -}); + Object.defineProperty(obj, "0", { + get: function () { + delete obj[1]; + return 0; + }, + configurable: true + }); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 0, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js index 1221c8864..8f1588765 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js @@ -9,27 +9,27 @@ description: > property not to be visited on an Array ---*/ -function callbackfn(val, idx, obj) { - return true; -} -var arr = [1, 2]; + 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, "1", { + get: function () { + return "6.99"; + }, + configurable: true + }); -Object.defineProperty(arr, "0", { - get: function() { - delete arr[1]; - return 0; - }, - configurable: true -}); + Object.defineProperty(arr, "0", { + get: function () { + delete arr[1]; + return 0; + }, + configurable: true + }); -var newArr = arr.filter(callbackfn); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 0, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js index de7e415f3..cdfc98323 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js @@ -9,18 +9,14 @@ description: > property on an Array-like object ---*/ -var kValue = {}; + var kValue = {}; + function callbackfn(val, idx, obj) { + return (idx === 5) && (val === kValue); + } -function callbackfn(val, idx, obj) { - return (idx === 5) && (val === kValue); -} + var obj = { 5: kValue, length: 100 }; -var obj = { - 5: kValue, - length: 100 -}; - -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], kValue, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js index 394268152..b44cba1e3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js @@ -9,19 +9,19 @@ description: > property on an Array ---*/ -function callbackfn(val, idx, obj) { - return idx === 2 && val === 12; -} + function callbackfn(val, idx, obj) { + return idx === 2 && val === 12; + } -var arr = []; + var arr = []; -Object.defineProperty(arr, "2", { - get: function() { - return 12; - }, - configurable: true -}); -var newArr = arr.filter(callbackfn); + Object.defineProperty(arr, "2", { + get: function () { + return 12; + }, + configurable: true + }); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js index a713e1953..dc089ead8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js @@ -10,28 +10,25 @@ description: > Array-like object ---*/ -function callbackfn(val, idx, obj) { - return idx === 0 && val === 11; -} + function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; + } -var proto = { - 0: 5, - 1: 6 -}; + var proto = { 0: 5, 1: 6 }; -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child.length = 10; + 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); + Object.defineProperty(child, "0", { + get: function () { + return 11; + }, + configurable: true + }); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js index 7dc94d210..bcd3b4287 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js @@ -9,21 +9,21 @@ description: > property that overrides an inherited data property on an Array ---*/ -function callbackfn(val, idx, obj) { - return val === 111 && idx === 0; -} + function callbackfn(val, idx, obj) { + return val === 111 && idx === 0; + } -var arr = []; + var arr = []; -Array.prototype[0] = 10; + Array.prototype[0] = 10; -Object.defineProperty(arr, "0", { - get: function() { - return 111; - }, - configurable: true -}); -var newArr = arr.filter(callbackfn); + Object.defineProperty(arr, "0", { + get: function () { + return 111; + }, + configurable: true + }); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 111, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js index 4a692475a..32d9fa6f4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js @@ -10,32 +10,32 @@ description: > Array-like object ---*/ -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); + 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); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js index e6f2a95c6..1ccf426ac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js @@ -9,26 +9,26 @@ description: > property that overrides an inherited accessor property on an Array ---*/ -function callbackfn(val, idx, obj) { - return idx === 0 && val === 11; -} + function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; + } -var arr = []; + var arr = []; -Object.defineProperty(Array.prototype, "0", { - get: function() { - return 5; - }, - configurable: true -}); + 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); + Object.defineProperty(arr, "0", { + get: function () { + return 11; + }, + configurable: true + }); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js index 4a7122ea1..d97746c2d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js @@ -9,25 +9,25 @@ description: > accessor property on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return val === 11 && idx === 1; -} + function callbackfn(val, idx, obj) { + return val === 11 && idx === 1; + } -var proto = {}; + var proto = {}; -Object.defineProperty(proto, "1", { - get: function() { - return 11; - }, - configurable: true -}); + Object.defineProperty(proto, "1", { + get: function () { + return 11; + }, + configurable: true + }); -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child.length = 20; -var newArr = Array.prototype.filter.call(child, callbackfn); + var child = new Con(); + child.length = 20; + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js index 9a04bb487..82834ff12 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js @@ -9,17 +9,17 @@ description: > accessor property on an Array ---*/ -function callbackfn(val, idx, obj) { - return idx === 0 && val === 11; -} + function callbackfn(val, idx, obj) { + return idx === 0 && val === 11; + } -Object.defineProperty(Array.prototype, "0", { - get: function() { - return 11; - }, - configurable: true -}); -var newArr = [, , , ].filter(callbackfn); + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 11; + }, + configurable: true + }); + var newArr = [, , , ].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js index 17bd3f8a7..3b01f8f4c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js @@ -9,19 +9,17 @@ description: > property without a get function on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return undefined === val && idx === 1; -} + function callbackfn(val, idx, obj) { + return undefined === val && idx === 1; + } -var obj = { - length: 2 -}; -Object.defineProperty(obj, "1", { - set: function() {}, - configurable: true -}); + var obj = { length: 2 }; + Object.defineProperty(obj, "1", { + set: function () { }, + configurable: true + }); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js index b139b96a6..3cfc401b9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js @@ -9,18 +9,18 @@ description: > property without a get function on an Array ---*/ -function callbackfn(val, idx, obj) { - return undefined === val && idx === 0; -} + function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; + } -var arr = []; + var arr = []; -Object.defineProperty(arr, "0", { - set: function() {}, - configurable: true -}); + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); -var newArr = arr.filter(callbackfn); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js index af8b5d615..4ff5f9589 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js @@ -10,20 +10,18 @@ description: > accessor property on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return undefined === val && idx === 1; -} + function callbackfn(val, idx, obj) { + return undefined === val && idx === 1; + } -var obj = { - length: 2 -}; -Object.defineProperty(obj, "1", { - set: function() {}, - configurable: true -}); + var obj = { length: 2 }; + Object.defineProperty(obj, "1", { + set: function () { }, + configurable: true + }); -Object.prototype[1] = 10; -var newArr = Array.prototype.filter.call(obj, callbackfn); + Object.prototype[1] = 10; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js index a129174e7..b2ea87479 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js @@ -9,13 +9,13 @@ description: > property on an Array ---*/ -function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } -} + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js index fa5905c96..83958a877 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js @@ -10,19 +10,19 @@ description: > accessor property on an Array ---*/ -function callbackfn(val, idx, obj) { - return undefined === val && idx === 0; -} + function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; + } -var arr = []; + var arr = []; -Object.defineProperty(arr, "0", { - set: function() {}, - configurable: true -}); + Object.defineProperty(arr, "0", { + set: function () { }, + configurable: true + }); -Array.prototype[0] = 100; -var newArr = arr.filter(callbackfn); + Array.prototype[0] = 100; + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js index 87bc30149..e4c19177b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js @@ -9,22 +9,22 @@ description: > accessor property without a get function on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return val === undefined && idx === 1; -} + function callbackfn(val, idx, obj) { + return val === undefined && idx === 1; + } -var proto = {}; -Object.defineProperty(proto, "1", { - set: function() {}, - configurable: true -}); + var proto = {}; + Object.defineProperty(proto, "1", { + set: function () { }, + configurable: true + }); -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child.length = 2; -var newArr = Array.prototype.filter.call(child, callbackfn); + var child = new Con(); + child.length = 2; + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js index ce088257b..5093adca4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js @@ -9,15 +9,15 @@ description: > accessor property without a get function on an Array ---*/ -function callbackfn(val, idx, obj) { - return undefined === val && idx === 0; -} + function callbackfn(val, idx, obj) { + return undefined === val && idx === 0; + } -Object.defineProperty(Array.prototype, "0", { - set: function() {}, - configurable: true -}); -var newArr = [, ].filter(callbackfn); + Object.defineProperty(Array.prototype, "0", { + set: function () { }, + configurable: true + }); + var newArr = [, ].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js index f2288892e..f050065ed 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js @@ -10,15 +10,15 @@ description: > less than number of parameters) ---*/ -function callbackfn(val, idx, obj) { - return val === 11 && idx === 0; -} + function callbackfn(val, idx, obj) { + return val === 11 && idx === 0; + } -var func = function(a, b) { - return Array.prototype.filter.call(arguments, callbackfn); -}; + var func = function (a, b) { + return Array.prototype.filter.call(arguments, callbackfn); + }; -var newArr = func(11); + var newArr = func(11); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js index 13eabc564..4c5719f15 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js @@ -10,20 +10,20 @@ description: > number of parameters) ---*/ -function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } else if (idx === 1) { - return val === 9; - } else { - return false; - } -} + 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); + var func = function (a, b) { + return Array.prototype.filter.call(arguments, callbackfn); + }; + var newArr = func(11, 9); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js index 117cbb39b..96927339a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js @@ -10,22 +10,22 @@ description: > greater than number of parameters) ---*/ -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; - } -} + 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); + var func = function (a, b) { + return Array.prototype.filter.call(arguments, callbackfn); + }; + var newArr = func(11, 12, 9); assert.sameValue(newArr.length, 3, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js index 28a3290dc..266d3eb37 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js @@ -9,32 +9,32 @@ description: > iterations is observed on an Array ---*/ -var preIterVisible = false; -var arr = []; + var preIterVisible = false; + var arr = []; -function callbackfn(val, idx, obj) { - return idx === 1 && val === 9; -} + 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, "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); + Object.defineProperty(arr, "1", { + get: function () { + if (preIterVisible) { + return 9; + } else { + return 11; + } + }, + configurable: true + }); + var newArr = arr.filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js index f3cce11d7..502971701 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js @@ -9,34 +9,32 @@ description: > iterations is observed on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return val === 9 && idx === 1; -} + function callbackfn(val, idx, obj) { + return val === 9 && idx === 1; + } -var preIterVisible = false; -var obj = { - length: 2 -}; + var preIterVisible = false; + var obj = { length: 2 }; -Object.defineProperty(obj, "0", { - get: function() { - preIterVisible = true; - return 11; - }, - configurable: true -}); + 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); + Object.defineProperty(obj, "1", { + get: function () { + if (preIterVisible) { + return 9; + } else { + return 13; + } + }, + configurable: true + }); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js index 1f6b1b8c1..ce761b38f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js @@ -10,23 +10,20 @@ description: > Array-like object ---*/ -function callbackfn(val, idx, obj) { - return (idx === 5) && (val === "abc"); -} + function callbackfn(val, idx, obj) { + return (idx === 5) && (val === "abc"); + } -var proto = { - 0: 11, - 5: 100 -}; + var proto = { 0: 11, 5: 100 }; -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child[5] = "abc"; -child.length = 10; + var child = new Con(); + child[5] = "abc"; + child.length = 10; -var newArr = Array.prototype.filter.call(child, callbackfn); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], "abc", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js index 01ffb99e0..150a4e013 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-30.js @@ -9,28 +9,22 @@ description: > terminate iteration on an Array-like object ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return true; + } -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 -}); + 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 + }); assert.throws(RangeError, function() { - Array.prototype.filter.call(obj, callbackfn); + Array.prototype.filter.call(obj, callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js index dc86f0848..0eb4d2ecd 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-31.js @@ -9,26 +9,25 @@ description: > terminate iteration on an Array ---*/ -var accessed = false; + var accessed = false; + function callbackfn(val, idx, obj) { + if (idx > 1) { + accessed = true; + } + return true; + } -function callbackfn(val, idx, obj) { - if (idx > 1) { - accessed = true; - } - return true; -} + var arr = []; + arr[5] = 10; + arr[10] = 100; -var arr = []; -arr[5] = 10; -arr[10] = 100; - -Object.defineProperty(arr, "1", { - get: function() { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true -}); + Object.defineProperty(arr, "1", { + get: function () { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true + }); assert.throws(RangeError, function() { - arr.filter(callbackfn); + arr.filter(callbackfn); }); assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js index 62273cdb9..39f5a2af2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js @@ -9,12 +9,12 @@ description: > property that overrides an inherited data property on an Array ---*/ -function callbackfn(val, idx, obj) { - return (idx === 0) && (val === 12); -} + function callbackfn(val, idx, obj) { + return (idx === 0) && (val === 12); + } -Array.prototype[0] = 11; -var newArr = [12].filter(callbackfn); + Array.prototype[0] = 11; + var newArr = [12].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js index 7f694e993..43000dca2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js @@ -10,31 +10,31 @@ description: > Array-like object ---*/ -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); + 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); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js index 17ead0e57..18af4d7ac 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js @@ -9,17 +9,17 @@ description: > property that overrides an inherited accessor property on an Array ---*/ -function callbackfn(val, idx, obj) { - return val === 11; -} + function callbackfn(val, idx, obj) { + return val === 11; + } -Object.defineProperty(Array.prototype, "0", { - get: function() { - return 9; - }, - configurable: true -}); -var newArr = [11].filter(callbackfn); + Object.defineProperty(Array.prototype, "0", { + get: function () { + return 9; + }, + configurable: true + }); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js index 2f92dcd61..ec3284966 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js @@ -9,23 +9,21 @@ description: > property on an Array-like object ---*/ -var kValue = 'abc'; + var kValue = 'abc'; -function callbackfn(val, idx, obj) { - return (idx === 5) && (val === kValue); -} + function callbackfn(val, idx, obj) { + return (idx === 5) && (val === kValue); + } -var proto = { - 5: kValue -}; + var proto = { 5: kValue }; -var Con = function() {}; -Con.prototype = proto; + var Con = function () { }; + Con.prototype = proto; -var child = new Con(); -child.length = 10; + var child = new Con(); + child.length = 10; -var newArr = Array.prototype.filter.call(child, callbackfn); + var newArr = Array.prototype.filter.call(child, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], kValue, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js index a263ceb34..3de54b2b2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js @@ -9,12 +9,12 @@ description: > property on an Array ---*/ -function callbackfn(val, idx, obj) { - return (idx === 1) && (val === 13); -} + function callbackfn(val, idx, obj) { + return (idx === 1) && (val === 13); + } -Array.prototype[1] = 13; -var newArr = [, , , ].filter(callbackfn); + Array.prototype[1] = 13; + var newArr = [, , , ].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 13, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js index 57aae1177..3e7299486 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js @@ -9,23 +9,20 @@ description: > property on an Array-like object ---*/ -function callbackfn(val, idx, obj) { - return (idx === 0) && (val === 11); -} + function callbackfn(val, idx, obj) { + return (idx === 0) && (val === 11); + } -var obj = { - 10: 10, - length: 20 -}; + var obj = { 10: 10, length: 20 }; -Object.defineProperty(obj, "0", { - get: function() { - return 11; - }, - configurable: true -}); + Object.defineProperty(obj, "0", { + get: function () { + return 11; + }, + configurable: true + }); -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js index e29bab335..f635e683c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js @@ -7,19 +7,18 @@ es5id: 15.4.4.20-9-c-ii-1 description: Array.prototype.filter - callbackfn called with correct parameters ---*/ -var bPar = true; -var bCalled = false; + var bPar = true; + var bCalled = false; + function callbackfn(val, idx, obj) + { + bCalled = true; + if(obj[idx] !== val) + bPar = 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); + var srcArr = [0,1,true,null,new Object(),"five"]; + srcArr[999999] = -6.6; + var resArr = srcArr.filter(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js index 67884f9e5..b7a6a8e0e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js @@ -9,10 +9,10 @@ description: > parameter ---*/ -function callbackfn(val) { - return val > 10; -} -var newArr = [12].filter(callbackfn); + function callbackfn(val) { + return val > 10; + } + var newArr = [12].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js index ca8ee6554..4f5cd0714 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js @@ -9,10 +9,10 @@ description: > parameter ---*/ -function callbackfn(val, idx) { - return val > 10 && arguments[2][idx] === val; -} -var newArr = [11].filter(callbackfn); + function callbackfn(val, idx) { + return val > 10 && arguments[2][idx] === val; + } + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js index 8ef2009e4..400d6ae8a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js @@ -9,10 +9,10 @@ description: > parameter ---*/ -function callbackfn(val, idx, obj) { - return val > 10 && obj[idx] === val; -} -var newArr = [11].filter(callbackfn); + function callbackfn(val, idx, obj) { + return val > 10 && obj[idx] === val; + } + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js index 59087549b..a51466ee6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js @@ -9,10 +9,10 @@ description: > get parameter value ---*/ -function callbackfn() { - return arguments[2][arguments[1]] === arguments[0]; -} -var newArr = [11].filter(callbackfn); + function callbackfn() { + return arguments[2][arguments[1]] === arguments[0]; + } + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js index 44dab4449..6b1ed0278 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js @@ -9,15 +9,12 @@ description: > object when T is not an object (T is a boolean) ---*/ -function callbackfn(val, idx, obj) { - return this.valueOf() === false; -} + function callbackfn(val, idx, obj) { + return this.valueOf() === false; + } -var obj = { - 0: 11, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn, false); + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, false); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js index 99a2bb143..17022d9b2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js @@ -9,15 +9,12 @@ description: > when T is not an object (T is a number) ---*/ -function callbackfn(val, idx, o) { - return 5 === this.valueOf(); -} + function callbackfn(val, idx, o) { + return 5 === this.valueOf(); + } -var obj = { - 0: 11, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn, 5); + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, 5); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js index 73ccf1d5f..bc7ae0099 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js @@ -9,15 +9,12 @@ description: > object when T is not an object (T is a string) ---*/ -function callbackfn(val, idx, obj) { - return 'hello' === this.valueOf(); -} + function callbackfn(val, idx, obj) { + return 'hello' === this.valueOf(); + } -var obj = { - 0: 11, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn, "hello"); + var obj = { 0: 11, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, "hello"); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js index b2ba6df2b..235694b23 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js @@ -7,20 +7,15 @@ es5id: 15.4.4.20-9-c-ii-19 description: Array.prototype.filter - non-indexed properties are not called ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return val === 8; -} + 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); + var obj = { 0: 11, non_index_property: 8, 2: 5, length: 20 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js index 208ff7aac..52910ae39 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js @@ -7,18 +7,17 @@ es5id: 15.4.4.20-9-c-ii-2 description: Array.prototype.filter - callbackfn takes 3 arguments ---*/ -var parCnt = 3; -var bCalled = false + 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 + } -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); + var srcArr = [0,1,2,3,4,5,6,7,8,9]; + var resArr = srcArr.filter(callbackfn); assert.sameValue(bCalled, true, 'bCalled'); assert.sameValue(parCnt, 3, 'parCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js index 645621f7e..fc145e234 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js @@ -9,19 +9,14 @@ description: > (thisArg is correct) ---*/ -var thisArg = { - threshold: 10 -}; + var thisArg = { threshold: 10 }; -function callbackfn(val, idx, obj) { - return this === thisArg; -} + function callbackfn(val, idx, obj) { + return this === thisArg; + } -var obj = { - 0: 11, - length: 1 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); + var obj = { 0: 11, length: 1 }; + var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js index 8c2b37645..1dd9e0853 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js @@ -9,24 +9,20 @@ description: > (kValue is correct) ---*/ -function callbackfn(val, idx, obj) { - if (idx === 0) { - return val === 11; - } + function callbackfn(val, idx, obj) { + if (idx === 0) { + return val === 11; + } - if (idx === 1) { - return val === 12; - } + if (idx === 1) { + return val === 12; + } - return false; -} + return false; + } -var obj = { - 0: 11, - 1: 12, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, 1: 12, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js index d8f90cbda..1976d0ab9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js @@ -9,24 +9,20 @@ description: > (the index k is correct) ---*/ -function callbackfn(val, idx, obj) { - if (val === 11) { - return idx === 0; - } + function callbackfn(val, idx, obj) { + if (val === 11) { + return idx === 0; + } - if (val === 12) { - return idx === 1; - } + if (val === 12) { + return idx === 1; + } - return false; -} + return false; + } -var obj = { - 0: 11, - 1: 12, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, 1: 12, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js index 54813293c..cdb465ca3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js @@ -9,16 +9,13 @@ description: > (this object O is correct) ---*/ -var obj = { - 0: 11, - length: 2 -}; + var obj = { 0: 11, length: 2 }; -function callbackfn(val, idx, o) { - return obj === o; -} + function callbackfn(val, idx, o) { + return obj === o; + } -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js index 5b8e78643..c9a7de747 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js @@ -9,19 +9,18 @@ description: > order ---*/ -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); + 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); assert.sameValue(newArr.length, called, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js index f0f5e5df9..dbf9d0d54 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js @@ -9,25 +9,25 @@ description: > iteration and not prior to starting the loop on an Array ---*/ -var kIndex = []; -var called = 0; + 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); + //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); assert.sameValue(newArr.length, 0, 'newArr.length'); assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js index ea27bcafe..6390d908c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js @@ -9,20 +9,17 @@ description: > consistent ---*/ -var obj = { - 0: 11, - length: 1 -}; -var thisArg = {}; + var obj = { 0: 11, length: 1 }; + var thisArg = {}; -function callbackfn() { - return this === thisArg && - arguments[0] === 11 && - arguments[1] === 0 && - arguments[2] === obj; -} + function callbackfn() { + return this === thisArg && + arguments[0] === 11 && + arguments[1] === 0 && + arguments[2] === obj; + } -var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); + var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js index 68d53c92c..97dfb262b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-7.js @@ -9,23 +9,18 @@ description: > callbackfn terminate iteration ---*/ -var called = 0; + var called = 0; -function callbackfn(val, idx, obj) { - called++; - if (called === 1) { - throw new Error("Exception occurred in callbackfn"); - } - return true; -} + 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 -}; + var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; assert.throws(Error, function() { - Array.prototype.filter.call(obj, callbackfn); + Array.prototype.filter.call(obj, callbackfn); }); assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js index 6f93d5fee..6551c71df 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js @@ -9,20 +9,16 @@ description: > iterations is observed ---*/ -var obj = { - 0: 11, - 1: 12, - length: 2 -}; + var obj = { 0: 11, 1: 12, length: 2 }; -function callbackfn(val, idx, o) { - if (idx === 0) { - obj[idx + 1] = 8; - } - return val > 10; -} + function callbackfn(val, idx, o) { + if (idx === 0) { + obj[idx + 1] = 8; + } + return val > 10; + } -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js index 382633547..0d6beb147 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js @@ -9,10 +9,10 @@ description: > parameter ---*/ -function callbackfn() { - return true; -} -var newArr = [11].filter(callbackfn); + function callbackfn() { + return true; + } + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js index 32568ef97..cf811e4dd 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js @@ -9,16 +9,12 @@ description: > 'kValue' ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 0: 11, - 1: 9, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr[0], obj[0], 'newArr[0]'); assert.sameValue(newArr[1], obj[1], 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js index 3a9a1dfc0..8acc541e3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js @@ -9,18 +9,14 @@ description: > overwritten ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 0: 11, - 1: 9, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); -var tempVal = newArr[1]; -newArr[1] += 1; + var tempVal = newArr[1]; + newArr[1] += 1; assert.notSameValue(newArr[1], tempVal, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js index 1b641737e..c3d2d718d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js @@ -9,24 +9,21 @@ description: > enumerated ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 0: 11, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + 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; - } - } -} + var prop; + var enumerable = false; + for (prop in newArr) { + if (newArr.hasOwnProperty(prop)) { + if (prop === "0") { + enumerable = true; + } + } + } assert(enumerable, 'enumerable !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js index 18f72dd4c..43d859cc4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js @@ -9,19 +9,15 @@ description: > changed or deleted ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 0: 11, - 1: 9, - length: 2 -}; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var obj = { 0: 11, 1: 9, length: 2 }; + var newArr = Array.prototype.filter.call(obj, callbackfn); -var tempVal = newArr[1]; -delete newArr[1]; + var tempVal = newArr[1]; + delete newArr[1]; assert.notSameValue(tempVal, undefined, 'tempVal'); assert.sameValue(newArr[1], undefined, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js index b5a88eb4b..010699ccf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js @@ -9,20 +9,19 @@ description: > numeric order ---*/ -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); + 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); assert.sameValue(newArr.length, 5, 'newArr.length'); assert.sameValue(called, 5, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js index 8e9d64fc6..aaad13206 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js @@ -10,25 +10,25 @@ description: > starting the loop ---*/ -var toIndex = []; -var called = 0; + 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); + //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); assert.sameValue(newArr.length, 4, 'newArr.length'); assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js index b4090e61d..b6c6e6a61 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js @@ -9,14 +9,14 @@ description: > returned array element ---*/ -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); + 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); assert(resArr.length > 0, 'resArr.length > 0'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js index e0095481f..38b9c166b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js @@ -9,11 +9,11 @@ description: > (value is negative number) ---*/ -function callbackfn(val, idx, obj) { - return -5; -} + function callbackfn(val, idx, obj) { + return -5; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js index f1458a7ec..afdb35685 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js @@ -9,11 +9,11 @@ description: > (value is Infinity) ---*/ -function callbackfn(val, idx, obj) { - return Infinity; -} + function callbackfn(val, idx, obj) { + return Infinity; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js index 3187b31ed..719ee9bc9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js @@ -9,11 +9,11 @@ description: > (value is -Infinity) ---*/ -function callbackfn(val, idx, obj) { - return -Infinity; -} + function callbackfn(val, idx, obj) { + return -Infinity; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js index 3af7abd32..e78a98f13 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js @@ -9,14 +9,14 @@ description: > (value is NaN) ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return NaN; -} + function callbackfn(val, idx, obj) { + accessed = true; + return NaN; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js index 976eb524d..a9df829af 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js @@ -9,14 +9,14 @@ description: > string ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return ""; -} + function callbackfn(val, idx, obj) { + accessed = true; + return ""; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js index 46d3a541d..c6cac3c3c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js @@ -9,11 +9,11 @@ description: > string ---*/ -function callbackfn(val, idx, obj) { - return "non-empty string"; -} + function callbackfn(val, idx, obj) { + return "non-empty string"; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js index 9d61f23cf..15d6f4194 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return function() {}; -} + function callbackfn(val, idx, obj) { + return function () { }; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js index e897b21bc..4fa7e5e1e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return new Array(10); -} + function callbackfn(val, idx, obj) { + return new Array(10); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js index 71f79ca9e..46dad6dd0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return new String(); -} + function callbackfn(val, idx, obj) { + return new String(); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js index 0570144e9..bd35cfb69 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return new Boolean(); -} + function callbackfn(val, idx, obj) { + return new Boolean(); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js index 892a96c6b..b0681bb10 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js @@ -7,19 +7,16 @@ es5id: 15.4.4.20-9-c-iii-2 description: Array.prototype.filter - return value of callbackfn is undefined ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, o) { - accessed = true; - return undefined; -} + function callbackfn(val, idx, o) { + accessed = true; + return undefined; + } -var obj = { - 0: 11, - length: 1 -}; + var obj = { 0: 11, length: 1 }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js index c5409a87e..8f3f5e55f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return new Number(); -} + function callbackfn(val, idx, obj) { + return new Number(); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js index 80c3876c6..5d91b294f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return Math; -} + function callbackfn(val, idx, obj) { + return Math; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js index b9e29f24b..7825fe47f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return new Date(); -} + function callbackfn(val, idx, obj) { + return new Date(); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js index 69b2c2c72..7fca3c93d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return new RegExp(); -} + function callbackfn(val, idx, obj) { + return new RegExp(); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js index afd5e2234..8f0a030c3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return JSON; -} + function callbackfn(val, idx, obj) { + return JSON; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js index 279fb2a4b..57be04e13 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js @@ -9,11 +9,11 @@ description: > object ---*/ -function callbackfn(val, idx, obj) { - return new EvalError(); -} + function callbackfn(val, idx, obj) { + return new EvalError(); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js index 25ec2c9fe..332a4c3a3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js @@ -9,11 +9,11 @@ description: > Arguments object ---*/ -function callbackfn(val, idx, obj) { - return arguments; -} + function callbackfn(val, idx, obj) { + return arguments; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js index 7d02e8a47..a8d86ae22 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js @@ -10,12 +10,11 @@ description: > ---*/ var global = this; + function callbackfn(val, idx, obj) { + return global; + } -function callbackfn(val, idx, obj) { - return global; -} - -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js index 4184c13cf..a16c1a2dd 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js @@ -9,20 +9,16 @@ description: > Array ---*/ -var called = 0; + var called = 0; -function callbackfn(val, idx, obj) { - called++; - return val > 10; -} + function callbackfn(val, idx, obj) { + called++; + return val > 10; + } -var obj = { - 0: 11, - 1: 8, - length: 20 -}; + var obj = { 0: 11, 1: 8, length: 20 }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.notSameValue(newArr[0], 8, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js index f5d032d1c..8c3fa9315 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js @@ -7,19 +7,16 @@ es5id: 15.4.4.20-9-c-iii-3 description: Array.prototype.filter - return value of callbackfn is null ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return null; -} + function callbackfn(val, idx, obj) { + accessed = true; + return null; + } -var obj = { - 0: 11, - length: 1 -}; + var obj = { 0: 11, length: 1 }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js index e21b710d6..603c07567 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js @@ -9,11 +9,11 @@ description: > callbackfn is treated as true value ---*/ -function callbackfn(val, idx, obj) { - return new Boolean(false); -} + function callbackfn(val, idx, obj) { + return new Boolean(false); + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js index 400819dc7..957e1b506 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js @@ -9,19 +9,16 @@ description: > (value is false) ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return false; -} + function callbackfn(val, idx, obj) { + accessed = true; + return false; + } -var obj = { - 0: 11, - length: 1 -}; + var obj = { 0: 11, length: 1 }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js index d33c906f2..3b3959c4f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js @@ -9,16 +9,13 @@ description: > (value is true) ---*/ -function callbackfn(val, idx, obj) { - return true; -} + function callbackfn(val, idx, obj) { + return true; + } -var obj = { - 0: 11, - length: 1 -}; + var obj = { 0: 11, length: 1 }; -var newArr = Array.prototype.filter.call(obj, callbackfn); + var newArr = Array.prototype.filter.call(obj, callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js index 8cfdbcbfd..59e225bab 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js @@ -9,14 +9,14 @@ description: > (value is 0) ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return 0; -} + function callbackfn(val, idx, obj) { + accessed = true; + return 0; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js index 766eb4034..8b1efafcd 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js @@ -9,14 +9,14 @@ description: > (value is +0) ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return +0; -} + function callbackfn(val, idx, obj) { + accessed = true; + return +0; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js index ae10c8998..3711ff9ef 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js @@ -9,14 +9,14 @@ description: > (value is -0) ---*/ -var accessed = false; + var accessed = false; -function callbackfn(val, idx, obj) { - accessed = true; - return -0; -} + function callbackfn(val, idx, obj) { + accessed = true; + return -0; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 0, 'newArr.length'); assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js index c9f2d5772..33bd28e86 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js @@ -9,11 +9,11 @@ description: > (value is positive number) ---*/ -function callbackfn(val, idx, obj) { - return 5; -} + function callbackfn(val, idx, obj) { + return 5; + } -var newArr = [11].filter(callbackfn); + var newArr = [11].filter(callbackfn); assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/create-ctor-non-object.js b/test/built-ins/Array/prototype/filter/create-ctor-non-object.js index e4f50c1cf..988fed039 100644 --- a/test/built-ins/Array/prototype/filter/create-ctor-non-object.js +++ b/test/built-ins/Array/prototype/filter/create-ctor-non-object.js @@ -20,9 +20,7 @@ info: | var a = []; var callCount = 0; -var cb = function() { - callCount += 0; -}; +var cb = function() { callCount += 0; }; a.constructor = null; assert.throws(TypeError, function() { diff --git a/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js b/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js index 8dec316a7..a766e6896 100644 --- a/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js +++ b/test/built-ins/Array/prototype/filter/create-ctor-poisoned.js @@ -17,9 +17,7 @@ info: | var a = []; var callCount = 0; -var cb = function() { - callCount += 1; -}; +var cb = function() { callCount += 1; }; Object.defineProperty(a, 'constructor', { get: function() { diff --git a/test/built-ins/Array/prototype/filter/create-non-array.js b/test/built-ins/Array/prototype/filter/create-non-array.js index 34c2a56a0..32ef7736f 100644 --- a/test/built-ins/Array/prototype/filter/create-non-array.js +++ b/test/built-ins/Array/prototype/filter/create-non-array.js @@ -16,9 +16,7 @@ info: | 4. If isArray is false, return ? ArrayCreate(length). ---*/ -var obj = { - length: 0 -}; +var obj = { length: 0 }; var callCount = 0; var result; Object.defineProperty(obj, 'constructor', { diff --git a/test/built-ins/Array/prototype/filter/create-revoked-proxy.js b/test/built-ins/Array/prototype/filter/create-revoked-proxy.js index 3bdee5cd6..aecf766f9 100644 --- a/test/built-ins/Array/prototype/filter/create-revoked-proxy.js +++ b/test/built-ins/Array/prototype/filter/create-revoked-proxy.js @@ -26,9 +26,7 @@ features: [Proxy] var o = Proxy.revocable([], {}); var ctorCount = 0; var cbCount = 0; -var cb = function() { - cbCount += 1; -}; +var cb = function() { cbCount += 1; }; Object.defineProperty(o.proxy, 'constructor', { get: function() { diff --git a/test/built-ins/Array/prototype/filter/create-species-abrupt.js b/test/built-ins/Array/prototype/filter/create-species-abrupt.js index 4c461dd30..42a4f2eda 100644 --- a/test/built-ins/Array/prototype/filter/create-species-abrupt.js +++ b/test/built-ins/Array/prototype/filter/create-species-abrupt.js @@ -26,9 +26,7 @@ var Ctor = function() { throw new Test262Error(); }; var callCount = 0; -var cb = function() { - callCount += 1; -}; +var cb = function() { callCount += 1; }; var a = []; a.constructor = {}; a.constructor[Symbol.species] = Ctor; diff --git a/test/built-ins/Array/prototype/filter/create-species-non-ctor.js b/test/built-ins/Array/prototype/filter/create-species-non-ctor.js index 890bf4d52..cf5fba2ce 100644 --- a/test/built-ins/Array/prototype/filter/create-species-non-ctor.js +++ b/test/built-ins/Array/prototype/filter/create-species-non-ctor.js @@ -25,9 +25,7 @@ features: [Symbol.species] var a = []; var callCount = 0; -var cb = function() { - callCount += 1; -}; +var cb = function() { callCount += 1; }; a.constructor = {}; a.constructor[Symbol.species] = parseInt; diff --git a/test/built-ins/Array/prototype/filter/create-species-poisoned.js b/test/built-ins/Array/prototype/filter/create-species-poisoned.js index 947e8f870..9edd338af 100644 --- a/test/built-ins/Array/prototype/filter/create-species-poisoned.js +++ b/test/built-ins/Array/prototype/filter/create-species-poisoned.js @@ -21,9 +21,7 @@ features: [Symbol.species] var a = []; var callCount = 0; -var cb = function() { - callCount += 1; -}; +var cb = function() { callCount += 1; }; a.constructor = {}; Object.defineProperty(a.constructor, Symbol.species, { |