Bug 1685090 - [devtools] Print exceptions when importing functions thrown in browser toolbox tests. r=jdescottes

Without this, we were silently ignoring many errors when evaluating a piece of JS.
Imported function may still work, but were missing global variables. Very misleading!

Differential Revision: https://phabricator.services.mozilla.com/D100927
This commit is contained in:
Alexandre Poirot 2021-01-11 13:11:50 +00:00
Родитель c6424c9f35
Коммит 6bd8a09aee
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -155,7 +155,14 @@ async function initBrowserToolboxTask({
}
async function importScript(script) {
await consoleFront.evaluateJSAsync(script);
const response = await consoleFront.evaluateJSAsync(script);
if (response.hasException) {
ok(
false,
"ToolboxTask.spawn exception while importing script: " +
response.exceptionMessage
);
}
}
async function destroy() {