summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/prototype/concat/indexed-setters.js
blob: da6840927cc642d67d4cd357c4b32f9b1cab4215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);