diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js index 5596e002f..96d6089f4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js @@ -10,27 +10,28 @@ description: > accessor property on an Array ---*/ - var testResult = false; - var initialValue = 0; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === undefined); - } - } +var testResult = false; +var initialValue = 0; - Object.defineProperty(Array.prototype, "1", { - get: function () { - return 11; - }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === undefined); + } +} - var arr = [0, , 2]; - Object.defineProperty(arr, "1", { - set: function () { }, - configurable: true - }); +Object.defineProperty(Array.prototype, "1", { + get: function() { + return 11; + }, + configurable: true +}); - arr.reduce(callbackfn, initialValue); +var arr = [0, , 2]; +Object.defineProperty(arr, "1", { + set: function() {}, + configurable: true +}); + +arr.reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); |