Debian Codegraph @

js/src/jit-test/tests/ion/recover-lambdas-bug1113940.js

raw
1
2 gczeal(14);
3
4 // The object metadata callback can iterate over the stack. Thus during the
5 // allocation of the lambda we might inspect the stack which is still incomplete
6 // because the lambda is not yet reconstructed.
7 //
8 // enableShellAllocationMetadataBuilder ignores its argument, because we don't
9 // permit metadata callbacks to run JS any more, so this test may be
10 // unnecessary. We'll preserve its structure just in case.
11 enableShellAllocationMetadataBuilder(function() {});
12 function f() {
13 (function() {
14 '' ^ Object
15 })();
16 }
17 x = 0;
18 for (var j = 0; j < 99; ++j) {
19 x += f();
20 }
21
22 try {
23 x = true;
24 // Same comment as above.
25 enableShellAllocationMetadataBuilder(function([x, y, z], ... Debugger) {});
26 for (var i = 0; i < 10; ++i) {
27 var f = function() {
28 function g() {
29 x++;
30 }
31 g();
32 }
33 f();
34 }
35 } catch (e) {
36 assertEq(e instanceof TypeError, true);
37 }