Debian Codegraph @

js/src/jit-test/tests/debug/Memory-drainAllocationsLog-11.js

raw
1 // Test logs that shouldn't contain allocations from debuggee compartments
2 // removed as we are logging.
3
4 const dbg = new Debugger();
5
6 const root1 = newGlobal({newCompartment: true});
7 dbg.addDebuggee(root1);
8 const root2 = newGlobal({newCompartment: true});
9 dbg.addDebuggee(root2);
10 const root3 = newGlobal({newCompartment: true});
11 dbg.addDebuggee(root3);
12
13 dbg.memory.trackingAllocationSites = true;
14
15 dbg.removeDebuggee(root1);
16 root1.eval("this.alloc = {}");
17
18 dbg.removeDebuggee(root2);
19 root2.eval("this.alloc = {}");
20
21 dbg.removeDebuggee(root3);
22 root3.eval("this.alloc = {}");
23
24 const allocs = dbg.memory.drainAllocationsLog();
25 assertEq(allocs.length, 0);