diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js index 0c3321dce..801417004 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js @@ -9,20 +9,21 @@ description: > accessor property without a get function on an Array ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (typeof prevVal === "undefined"); - } - } +var testResult = false; - Object.defineProperty(Array.prototype, "2", { - set: function () { }, - configurable: true - }); +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (typeof prevVal === "undefined"); + } +} - var arr = [0, 1, , ]; +Object.defineProperty(Array.prototype, "2", { + set: function() {}, + configurable: true +}); - arr.reduceRight(callbackfn); +var arr = [0, 1, , ]; + +arr.reduceRight(callbackfn); assert(testResult, 'testResult !== true'); |