зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1525627 - Report an error if there's no ScriptLoader for the current context. r=baku
This commit is contained in:
Родитель
9743935cf6
Коммит
019d226699
|
@ -749,6 +749,10 @@ RefPtr<GenericPromise> ScriptLoader::StartFetchingModuleAndDependencies(
|
|||
}
|
||||
|
||||
static ScriptLoader* GetCurrentScriptLoader(JSContext* aCx) {
|
||||
auto reportError = mozilla::MakeScopeExit([aCx]() {
|
||||
JS_ReportErrorASCII(aCx, "No ScriptLoader found for the current context");
|
||||
});
|
||||
|
||||
JSObject* object = JS::CurrentGlobalOrNull(aCx);
|
||||
if (!object) {
|
||||
return nullptr;
|
||||
|
@ -775,6 +779,7 @@ static ScriptLoader* GetCurrentScriptLoader(JSContext* aCx) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
reportError.release();
|
||||
return loader;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче