summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/prototype/map/length-internal.js
blob: 9d4538288c4543c88d1f89c19c7ea4259729d619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// |reftest| skip-if(!this.hasOwnProperty("Tuple"))
Object.defineProperty(Tuple.prototype, "length", {value: 0});
let t = #[1,2,3];
var result = t.map(x => x + 1);
// overriding length shouldn't have an effect
assertEq(result, #[2,3,4]);


Object.defineProperty(Tuple.prototype, "length", {
  get() { return 0 }
});
let u = #[1,2,3];
var result = u.map(x => x + 1);
// overriding length shouldn't have an effect
assertEq(result, #[2,3,4]);

reportCompare(0, 0);