Debian Codegraph @

js/src/jit-test/tests/arguments/bug2029317.js

raw
1 function test() {
2 var f = function() { return arguments; };
3 var template = new Array(9000).fill(0);
4
5 var a = f.apply(null, template);
6 Object.defineProperty(a, 0, {value: "v1", writable: false, configurable: true});
7
8 for (var alloc = 4; alloc < 15; alloc++) {
9 var args = null;
10 var ok = false;
11 oomAtAllocation(alloc);
12 try {
13 args = f.apply(null, template);
14 ok = true;
15 Object.defineProperty(args, 0, {value: "v1", writable: false, configurable: true});
16 } catch (e) {}
17 resetOOMFailure();
18
19 if (ok) {
20 Object.defineProperty(args, 0, {value: "v2"});
21 assertEq(args[0], "v2");
22 }
23 }
24 }
25 test();