diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js index 3973a3593..74613a078 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js @@ -10,29 +10,30 @@ description: > an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } - - Object.defineProperty(Array.prototype, "2", { - get: function () { - return 2; - }, - configurable: true - }); - - var arr = [0, 1, , ]; - - Object.defineProperty(arr, "2", { - get: function () { - return "20"; - }, - configurable: true - }); - - arr.reduceRight(callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} + +Object.defineProperty(Array.prototype, "2", { + get: function() { + return 2; + }, + configurable: true +}); + +var arr = [0, 1, , ]; + +Object.defineProperty(arr, "2", { + get: function() { + return "20"; + }, + configurable: true +}); + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); |