summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js')
-rw-r--r--js/src/tests/test262/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js b/js/src/tests/test262/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js
new file mode 100644
index 0000000000..8e0f1cc5f0
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Array/prototype/forEach/15.4.4.18-7-b-3.js
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 Ecma International. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-array.prototype.foreach
+description: >
+ Array.prototype.forEach - deleted properties in step 2 are visible
+ here
+---*/
+
+var accessed = false;
+var testResult = true;
+
+function callbackfn(val, idx, obj) {
+ accessed = true;
+ if (idx === 8) {
+ testResult = false;
+ }
+}
+var obj = {
+ 2: 6.99,
+ 8: 19
+};
+
+Object.defineProperty(obj, "length", {
+ get: function() {
+ delete obj[8];
+ return 10;
+ },
+ configurable: true
+});
+
+Array.prototype.forEach.call(obj, callbackfn);
+
+assert(testResult, 'testResult !== true');
+assert(accessed, 'accessed !== true');
+
+reportCompare(0, 0);