diff options
Diffstat (limited to 'test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js')
-rw-r--r-- | test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js index 57bf3415d..0e26ea86f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-8-6.js @@ -9,15 +9,23 @@ description: > (subclassed Array, length overridden with obj with valueOf) ---*/ - foo.prototype = new Array(1, 2, 3); - function foo() {} - var f = new foo(); +foo.prototype = new Array(1, 2, 3); - var o = { valueOf: function () { return 0;}}; - f.length = o; +function foo() {} +var f = new foo(); - var callCnt = 0; - function cb(){callCnt++} - var i = f.forEach(cb); +var o = { + valueOf: function() { + return 0; + } +}; +f.length = o; + +var callCnt = 0; + +function cb() { + callCnt++ +} +var i = f.forEach(cb); assert.sameValue(callCnt, 0, 'callCnt'); |