summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/with.js
blob: 54585ebc79664a9546cc888e959194fff839e9a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// |reftest| 

Object.defineProperty(Array.prototype, 0, {
  set() {
    throw "bad";
  },
});

// Single element case.
assertDeepEq([0].with(0, 1), [1]);

// More than one element.
assertDeepEq([1, 2].with(0, 3), [3, 2]);
assertDeepEq([1, 2].with(1, 3), [1, 3]);

if (typeof reportCompare === "function")
  reportCompare(0, 0);