diff options
Diffstat (limited to 'test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js')
-rw-r--r-- | test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js index a4b5e78bb..b62dda53c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-10.js @@ -9,29 +9,28 @@ description: > an inherited accessor property ---*/ -var result = false; + var result = false; + function callbackfn(val, idx, obj) { + result = (obj.length === 2); + } -function callbackfn(val, idx, obj) { - result = (obj.length === 2); -} + var proto = {}; -var proto = {}; + Object.defineProperty(proto, "length", { + get: function () { + return 2; + }, + configurable: true + }); -Object.defineProperty(proto, "length", { - get: function() { - return 2; - }, - configurable: true -}); + var Con = function () { }; + Con.prototype = proto; -var Con = function() {}; -Con.prototype = proto; + var child = new Con(); + child[0] = 12; + child[1] = 11; + child[2] = 9; -var child = new Con(); -child[0] = 12; -child[1] = 11; -child[2] = 9; - -Array.prototype.forEach.call(child, callbackfn); + Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); |