Debian Codegraph @

js/src/jit-test/tests/gc/alllcation-metadata-builder-over-recursion.js

raw
1 // |jit-test| allow-unhandlable-oom
2
3 // Over-recursion should suppress alloation metadata builder, to avoid another
4 // over-recursion while generating an error object for the first over-recursion.
5 //
6 // This test should catch the error for the "load" testing function's arguments,
7 // or crash with unhandlable OOM inside allocation metadata builder.
8
9 const g = newGlobal();
10 g.enableShellAllocationMetadataBuilder();
11 function run() {
12 const g_load = g.load;
13 g_load.toString = run;
14 return g_load(g_load);
15 }
16 let caught = false;
17 try {
18 run();
19 } catch (e) {
20 caught = true;
21 }
22 assertEq(caught, true);