Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // Array.of does not trigger prototype setters.
2 // (It defines elements rather than assigning to them.)
4 var status = "pass";
5 Object.defineProperty(Array.prototype, "0", {set: v => status = "FAIL 1"});
6 assertEq(Array.of(1)[0], 1);
7 assertEq(status, "pass");
9 function Bag() {}
10 Bag.of = Array.of;
11 Object.defineProperty(Bag.prototype, "0", {set: v => status = "FAIL 2"});
12 assertEq(Bag.of(1)[0], 1);
13 assertEq(status, "pass");