summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/prototype/concat/indexed-setters.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/Tuple/prototype/concat/indexed-setters.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/non262/Tuple/prototype/concat/indexed-setters.js b/js/src/tests/non262/Tuple/prototype/concat/indexed-setters.js
new file mode 100644
index 0000000000..da6840927c
--- /dev/null
+++ b/js/src/tests/non262/Tuple/prototype/concat/indexed-setters.js
@@ -0,0 +1,17 @@
+// |reftest| skip-if(!this.hasOwnProperty("Tuple"))
+
+// If an indexed Array setter is overridden, TupleConcat shouldn't use it
+// when constructing the intermediate array
+
+var z = 5;
+for (i = 0; i < 4; i++) {
+ Object.defineProperty(Array.prototype, i, { set: function(y) { z = 42; }});
+}
+var newT = #[1, 2].concat([3, 4]);
+assertEq(z, 5);
+
+newT = #[1, 2].concat("hello");
+assertEq(z, 5);
+
+reportCompare(0, 0);
+