summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js')
-rw-r--r--js/src/tests/test262/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js b/js/src/tests/test262/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js
new file mode 100644
index 0000000000..f4fde7c5c2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Array/prototype/every/15.4.4.16-7-c-iii-28.js
@@ -0,0 +1,46 @@
+// 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.every
+description: Array.prototype.every - false prevents further side effects
+---*/
+
+var result = false;
+var obj = {
+ length: 20
+};
+
+function callbackfn(val, idx, obj) {
+ if (idx > 1) {
+ result = true;
+ }
+ return val > 10;
+}
+
+Object.defineProperty(obj, "0", {
+ get: function() {
+ return 11;
+ },
+ configurable: true
+});
+
+Object.defineProperty(obj, "1", {
+ get: function() {
+ return 8;
+ },
+ configurable: true
+});
+
+Object.defineProperty(obj, "2", {
+ get: function() {
+ result = true;
+ return 8;
+ },
+ configurable: true
+});
+
+assert.sameValue(Array.prototype.every.call(obj, callbackfn), false, 'Array.prototype.every.call(obj, callbackfn)');
+assert.sameValue(result, false, 'result');
+
+reportCompare(0, 0);