diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js index a411f9467..735d1c856 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js @@ -9,20 +9,25 @@ description: > 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 obj = { 1: 1, 2: 2, length: 3 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === undefined); + } +} - Object.defineProperty(obj, "0", { - set: function () { }, - configurable: true - }); +var obj = { + 1: 1, + 2: 2, + length: 3 +}; - Array.prototype.reduce.call(obj, callbackfn); +Object.defineProperty(obj, "0", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn); assert(testResult, 'testResult !== true'); |