From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- .../debug/onNewScript-CloneAndExecuteScript.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 js/src/jit-test/tests/debug/onNewScript-CloneAndExecuteScript.js (limited to 'js/src/jit-test/tests/debug/onNewScript-CloneAndExecuteScript.js') diff --git a/js/src/jit-test/tests/debug/onNewScript-CloneAndExecuteScript.js b/js/src/jit-test/tests/debug/onNewScript-CloneAndExecuteScript.js new file mode 100644 index 0000000000..abc417c4a8 --- /dev/null +++ b/js/src/jit-test/tests/debug/onNewScript-CloneAndExecuteScript.js @@ -0,0 +1,28 @@ +// Debugger should be notified of scripts created with cloneAndExecuteScript. + +var g = newGlobal({newCompartment: true}); +var g2 = newGlobal({newCompartment: true}); +var dbg = new Debugger(g, g2); +var log = ''; + +dbg.onNewScript = function (evalScript) { + log += 'e'; + + dbg.onNewScript = function (clonedScript) { + log += 'c'; + clonedScript.setBreakpoint(0, { + hit(frame) { + log += 'b'; + assertEq(frame.script, clonedScript); + } + }); + }; +}; + +dbg.onDebuggerStatement = function (frame) { + log += 'd'; +}; + +assertEq(log, ''); +g.cloneAndExecuteScript("debugger; // nee", g2); +assertEq(log, 'ecbd'); -- cgit v1.2.3