diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js index 57da7683a..a0225a882 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-32.js @@ -9,27 +9,22 @@ description: > getter terminate iteration on an Array-like object ---*/ -var accessed = false; + var accessed = false; + function callbackfn(prevVal, curVal, idx, obj) { + if (idx <= 1) { + accessed = true; + } + } -function callbackfn(prevVal, curVal, idx, obj) { - if (idx <= 1) { - accessed = true; - } -} - -var obj = { - 0: 0, - 2: 2, - length: 3 -}; -Object.defineProperty(obj, "1", { - get: function() { - throw new RangeError("unhandle exception happened in getter"); - }, - configurable: true -}); + var obj = { 0: 0, 2: 2, length: 3 }; + Object.defineProperty(obj, "1", { + get: function () { + throw new RangeError("unhandle exception happened in getter"); + }, + configurable: true + }); assert.throws(RangeError, function() { - Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); + Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); }); assert.sameValue(accessed, false, 'accessed'); |