diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js index 62d5da4b4..00f0210ab 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js @@ -10,39 +10,36 @@ description: > Array-like object ---*/ -var testResult = false; - -function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "9"); - } -} - -var proto = { - 1: 1, - 2: 2 -}; - -Object.defineProperty(proto, "0", { - get: function() { - return 0; - }, - configurable: true -}); - -var Con = function() {}; -Con.prototype = proto; - -var child = new Con(); -child.length = 3; - -Object.defineProperty(child, "0", { - get: function() { - return "9"; - }, - configurable: true -}); - -Array.prototype.reduce.call(child, callbackfn); + var testResult = false; + + function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "9"); + } + } + + var proto = { 1: 1, 2: 2}; + + Object.defineProperty(proto, "0", { + get: function () { + return 0; + }, + configurable: true + }); + + var Con = function () { }; + Con.prototype = proto; + + var child = new Con(); + child.length = 3; + + Object.defineProperty(child, "0", { + get: function () { + return "9"; + }, + configurable: true + }); + + Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); |