diff options
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js')
-rw-r--r-- | test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js index 62c9245a9..98aea64ef 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-11.js @@ -10,28 +10,33 @@ description: > Array-like object ---*/ - var testResult = false; - function callbackfn(prevVal, curVal, idx, obj) { - if (idx === 1) { - testResult = (prevVal === "20"); - } - } - - var proto = { 0: 0, 1: 1, 2: 2 }; - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - child.length = 3; - - Object.defineProperty(child, "2", { - get: function () { - return "20"; - }, - configurable: true - }); - - Array.prototype.reduceRight.call(child, callbackfn); +var testResult = false; + +function callbackfn(prevVal, curVal, idx, obj) { + if (idx === 1) { + testResult = (prevVal === "20"); + } +} + +var proto = { + 0: 0, + 1: 1, + 2: 2 +}; + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +child.length = 3; + +Object.defineProperty(child, "2", { + get: function() { + return "20"; + }, + configurable: true +}); + +Array.prototype.reduceRight.call(child, callbackfn); assert(testResult, 'testResult !== true'); |