diff options
Diffstat (limited to 'test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js')
-rw-r--r-- | test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js index c261643e5..21fd3b12c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-5.js @@ -9,32 +9,33 @@ description: > an own data property that overrides an inherited accessor property ---*/ - var result = false; - function callbackfn(val, idx, obj) { - result = (obj.length === 2); - } - - var proto = {}; - - Object.defineProperty(proto, "length", { - get: function () { - return 3; - }, - configurable: true - }); - - var Con = function () { }; - Con.prototype = proto; - - var child = new Con(); - Object.defineProperty(child, "length", { - value: 2, - configurable: true - }); - child[0] = 12; - child[1] = 11; - child[2] = 9; - - Array.prototype.forEach.call(child, callbackfn); +var result = false; + +function callbackfn(val, idx, obj) { + result = (obj.length === 2); +} + +var proto = {}; + +Object.defineProperty(proto, "length", { + get: function() { + return 3; + }, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); +Object.defineProperty(child, "length", { + value: 2, + configurable: true +}); +child[0] = 12; +child[1] = 11; +child[2] = 9; + +Array.prototype.forEach.call(child, callbackfn); assert(result, 'result !== true'); |