js/src/jit-test/tests/arrays/setelem-one-past-nonwritable-length.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:66c25bb1c0cf
1 function f(arr, i, v)
2 {
3 arr[i] = v;
4 }
5
6 function test()
7 {
8 // Use a much-greater capacity than the eventual non-writable length.
9 var a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
10 Object.defineProperty(a, "length", { writable: false, value: 6 });
11
12 for (var i = 0; i < 100; i++)
13 f(a, a.length, i);
14
15 assertEq(a.hasOwnProperty(6), false);
16 assertEq(a[6], undefined);
17 assertEq(a.length, 6);
18 }
19
20 test();

mercurial