Bug 1568143 - Don't use JsTerm reference to evaluate code. r=jdescottes.

JSTerm `execute` function is renamed to `_execute` to emphasize
that it's a private function.
A `dispatchEvaluateExpression` is added to the WebConsoleWrapper
so other panels can use that if they need to.
A test helper is added to be able to evaluate without grabbing
the jsterm reference, and tests are modified to use the new
helper, or the existing `executeAndWaitForMessage`.

Differential Revision: https://phabricator.services.mozilla.com/D39024
This commit is contained in:
Nicolas Chevobbe
2019-08-01 06:52:25 +00:00
parent c2ebae7e8a
commit a81a1e8f40
87 changed files with 737 additions and 556 deletions

View File

@@ -344,11 +344,8 @@ class MarkupContextMenu {
*/
_showDOMProperties() {
this.toolbox.openSplitConsole().then(() => {
const panel = this.toolbox.getPanel("webconsole");
const jsterm = panel.hud.jsterm;
jsterm.execute("inspect($0)");
jsterm.focus();
const { hud } = this.toolbox.getPanel("webconsole");
hud.ui.wrapper.dispatchEvaluateExpression("inspect($0)");
});
}