Bug 1658724 - Don't start the parser worker if it's not needed when evaluating an expression in the console. r=jdescottes. DONTBUILD

In `getMappedExpression`, we check if the expression contains `await `, and in
such case, transform the input to handle top-level await expressions.

The catch is that we first check the existence of this.parserService, and the
getter for parserService will start the parser worker if it wasn't the case yet.
That means we were always spawning the parser worker, even if it wasn't going
to be used, consuming unnecessary resources.

This patch removes the conditions in the if, as `parserService` will always be truthy.

Differential Revision: https://phabricator.services.mozilla.com/D86826
This commit is contained in:
Nicolas Chevobbe 2020-08-17 13:22:51 +00:00
Родитель cf7ae9564e
Коммит 6a8d6386cb
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -301,7 +301,7 @@ class WebConsole {
return panel.getMappedExpression(expression);
}
if (this.parserService && expression.includes("await ")) {
if (expression.includes("await ")) {
const shouldMapBindings = false;
const shouldMapAwait = true;
const res = this.parserService.mapExpression(