summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/xdr/debug-hook.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/xdr/debug-hook.js')
-rw-r--r--js/src/jit-test/tests/xdr/debug-hook.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/xdr/debug-hook.js b/js/src/jit-test/tests/xdr/debug-hook.js
new file mode 100644
index 0000000000..3abb138a80
--- /dev/null
+++ b/js/src/jit-test/tests/xdr/debug-hook.js
@@ -0,0 +1,20 @@
+var g = newGlobal({ newCompartment: true });
+var dbg = new Debugger(g);
+var count = 0;
+
+dbg.onNewScript = script => {
+ count++;
+};
+
+var stencil = g.compileToStencil(`"a"`);
+g.evalStencil(stencil);
+assertEq(count, 1);
+
+count = 0;
+dbg.onNewScript = script => {
+ count++;
+};
+
+var stencilXDR = g.compileToStencilXDR(`"b"`);
+g.evalStencilXDR(stencilXDR);
+assertEq(count, 1);