summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js')
-rw-r--r--test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js26
1 files changed, 10 insertions, 16 deletions
diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js
index df0f1401e..677a50236 100644
--- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js
+++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-ii-19.js
@@ -7,24 +7,18 @@ es5id: 15.4.4.18-7-c-ii-19
description: Array.prototype.forEach - non-indexed properties are not called
---*/
-var accessed = false;
-var result = true;
+ var accessed = false;
+ var result = true;
+ function callbackfn(val, idx, obj) {
+ accessed = true;
+ if (val === 8) {
+ result = false;
+ }
+ }
-function callbackfn(val, idx, obj) {
- accessed = true;
- if (val === 8) {
- result = false;
- }
-}
+ var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 };
-var obj = {
- 0: 11,
- 10: 12,
- non_index_property: 8,
- length: 20
-};
-
-Array.prototype.forEach.call(obj, callbackfn);
+ Array.prototype.forEach.call(obj, callbackfn);
assert(result, 'result !== true');
assert(accessed, 'accessed !== true');