Debian Codegraph @

js/src/jit-test/tests/debug/Memory-trackingAllocationSites-02.js

raw
1 // Test that we don't get allocation sites when nobody has asked for them.
2
3 const root = newGlobal({newCompartment: true});
4
5 const dbg = new Debugger();
6 const wrappedRoot = dbg.addDebuggee(root);
7
8 dbg.memory.trackingAllocationSites = true;
9 root.eval("this.obj = {};");
10 dbg.memory.trackingAllocationSites = false;
11 root.eval("this.obj2 = {};");
12
13 let wrappedObj = wrappedRoot.makeDebuggeeValue(root.obj);
14 let allocationSite = wrappedObj.allocationSite;
15 assertEq(allocationSite != null && typeof allocationSite == "object", true);
16
17 let wrappedObj2 = wrappedRoot.makeDebuggeeValue(root.obj2);
18 let allocationSite2 = wrappedObj2.allocationSite;
19 assertEq(allocationSite2, null);