diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js index d057b59b2..47a9a843b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js @@ -9,26 +9,30 @@ description: > accessor property without a get function on an Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === undefined); - } - } +var testResult = false; - var proto = { 1: 1, 2: 2 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - Object.defineProperty(proto, "0", { - set: function () { }, - configurable: true - }); +var proto = { + 1: 1, + 2: 2 +}; - var Con = function () { }; - Con.prototype = proto; +Object.defineProperty(proto, "0", { + set: function() {}, + configurable: true +}); - var child = new Con(); - child.length = 3; +var Con = function() {}; +Con.prototype = proto; - Array.prototype.reduce.call(child, callbackfn); +var child = new Con(); +child.length = 3; + +Array.prototype.reduce.call(child, callbackfn); assert(testResult, 'testResult !== true'); |