Bug 1704561 - Ensure that Module return value is an object before binding it to evaluationPromise; r=evilpie

Differential Revision: https://phabricator.services.mozilla.com/D111849
This commit is contained in:
Yulia Startsev
2021-04-15 12:28:48 +00:00
parent d8fac0ee17
commit e4c9822381
2 changed files with 2 additions and 2 deletions

View File

@@ -3207,7 +3207,7 @@ nsresult ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest) {
} else {
// Path for when Top Level Await is enabled
JS::Rooted<JSObject*> aEvaluationPromise(cx);
if (NS_SUCCEEDED(rv)) {
if (rval.isObject()) {
// If the user cancels the evaluation on an infinite loop, we need
// to skip this step. In that case, ModuleEvaluate will not return a
// promise, rval will be undefined. We should treat it as a failed