Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 var a = [1, 2, 3, 4];
2 var count = 0;
4 function f(arr, i) {
5 arr[2] = i;
6 }
8 for (var i=0; i<80; i++) {
9 f(a, i);
10 assertEq(a[2], i);
11 }
13 delete a[2];
14 f(a, 50);
15 assertEq(a[2], 50);
17 Object.defineProperty(Object.prototype, "2", {
18 set: function() { count++; }
19 });
20 delete a[2];
22 f(a, 100);
23 f(a, 100);
25 assertEq(a[2], undefined);
26 assertEq(count, 2);