diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js index 72e9c9c3e..261293885 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js @@ -9,21 +9,26 @@ description: > property without a get function on an Array-like object ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } +var testResult = false; +var initialValue = 0; - var obj = { 0: 0, 2: 2, length: 3 }; +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} - Object.defineProperty(obj, "1", { - set: function () { }, - configurable: true - }); +var obj = { + 0: 0, + 2: 2, + length: 3 +}; - Array.prototype.reduce.call(obj, callbackfn, initialValue); +Object.defineProperty(obj, "1", { + set: function() {}, + configurable: true +}); + +Array.prototype.reduce.call(obj, callbackfn, initialValue); assert(testResult, 'testResult !== true'); |