diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js index d3aca565c..ee27f6242 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js @@ -9,21 +9,20 @@ description: > property that overrides an inherited accessor property on an Array ---*/ -var testResult = false; -var initialValue = 0; + var testResult = false; + var initialValue = 0; + function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (curVal === 1); + } + } -function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (curVal === 1); - } -} - -Object.defineProperty(Array.prototype, "1", { - get: function() { - return "9"; - }, - configurable: true -}); -[0, 1, 2].reduce(callbackfn, initialValue); + Object.defineProperty(Array.prototype, "1", { + get: function () { + return "9"; + }, + configurable: true + }); + [0, 1, 2].reduce(callbackfn, initialValue); assert(testResult, 'testResult !== true'); |