summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Memory-drainAllocationsLog-12.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Memory-drainAllocationsLog-12.js')
-rw-r--r--js/src/jit-test/tests/debug/Memory-drainAllocationsLog-12.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Memory-drainAllocationsLog-12.js b/js/src/jit-test/tests/debug/Memory-drainAllocationsLog-12.js
new file mode 100644
index 000000000..ed1c4e5f6
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Memory-drainAllocationsLog-12.js
@@ -0,0 +1,17 @@
+// Test that disabling the debugger disables allocation tracking.
+
+load(libdir + "asserts.js");
+
+const dbg = new Debugger();
+const root = newGlobal();
+dbg.addDebuggee(root);
+
+dbg.memory.trackingAllocationSites = true;
+dbg.enabled = false;
+
+root.eval("this.alloc = {}");
+
+// We shouldn't accumulate allocations in our log while the debugger is
+// disabled.
+let allocs = dbg.memory.drainAllocationsLog();
+assertEq(allocs.length, 0);