From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- devtools/server/actors/webconsole/eval-with-debugger.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'devtools/server/actors/webconsole') diff --git a/devtools/server/actors/webconsole/eval-with-debugger.js b/devtools/server/actors/webconsole/eval-with-debugger.js index 34836c354f..b510b0e47b 100644 --- a/devtools/server/actors/webconsole/eval-with-debugger.js +++ b/devtools/server/actors/webconsole/eval-with-debugger.js @@ -325,6 +325,7 @@ function getEvalResult( if (noSideEffectDebugger) { noSideEffectDebugger.removeAllDebuggees(); noSideEffectDebugger.onNativeCall = undefined; + noSideEffectDebugger.shouldAvoidSideEffects = false; } } } @@ -457,11 +458,15 @@ function makeSideeffectFreeDebugger(targetActorDbg) { try { dbg.addDebuggee(global); } catch (e) { - // Ignore the following exception which can happen for some globals in the browser toolbox + // Ignore exceptions from the following cases: + // * A global from the same compartment (happens with parent process) + // * A dead wrapper (happens when the reference gets nuked after + // findAllGlobals call) if ( !e.message.includes( "debugger and debuggee must be in different compartments" - ) + ) && + !e.message.includes("can't access dead object") ) { throw e; } @@ -544,6 +549,7 @@ function makeSideeffectFreeDebugger(targetActorDbg) { // Returning null terminates the current evaluation. return null; }; + dbg.shouldAvoidSideEffects = true; return dbg; } -- cgit v1.2.3