diff --git a/devtools/client/webconsole/actions/input.js b/devtools/client/webconsole/actions/input.js index 915458b229da..dcc7541aa2b0 100644 --- a/devtools/client/webconsole/actions/input.js +++ b/devtools/client/webconsole/actions/input.js @@ -481,7 +481,6 @@ function terminalInputChanged(expression, force = false) { ), mapped, eager: true, - disableBreaks: true, }); return dispatch({ diff --git a/devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation.js b/devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation.js index 91b5191fbb77..194cc64531d7 100644 --- a/devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation.js +++ b/devtools/client/webconsole/test/browser/browser_jsterm_eager_evaluation.js @@ -15,6 +15,7 @@ function zzyzx2() { } var obj = {propA: "A", propB: "B"}; var array = [1, 2, 3]; +var $$ = 42;

title

`; @@ -109,6 +110,9 @@ add_task(async function () { setInputValue(hud, "$('html')"); await waitForEagerEvaluationResult(hud, ``); + setInputValue(hud, "$$"); + await waitForEagerEvaluationResult(hud, `42`); + info("Check that $_ wasn't polluted by eager evaluations"); setInputValue(hud, "$_"); await waitForEagerEvaluationResult(hud, `"result: 7"`); diff --git a/devtools/server/actors/webconsole/eval-with-debugger.js b/devtools/server/actors/webconsole/eval-with-debugger.js index 7cb185a6f64e..2ed8741438ce 100644 --- a/devtools/server/actors/webconsole/eval-with-debugger.js +++ b/devtools/server/actors/webconsole/eval-with-debugger.js @@ -193,12 +193,14 @@ function evalWithDebugger(string, options = {}, webConsole) { evalOptions.lineNumber = options.lineNumber; } - if (options.disableBreaks) { - // When we are disabling breakpoints for a given evaluation, + if (options.disableBreaks || options.eager) { + // When we are disabling breakpoints for a given evaluation, or when we are doing an eager evaluation, // also prevent spawning related Debugger.Source object to avoid showing it // in the debugger UI evalOptions.hideFromDebugger = true; + } + if (options.disableBreaks) { // disableBreaks is used for all non-user-provided code, and in this case // extra bindings shouldn't be shadowed. evalOptions.useInnerBindings = true;