mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-05-27 00:01:37 +00:00
ported from UXP: Issue #1691 - Part 8: Fix --enable-debug builds and continue dynamic module import changes. M1342012 Support import from timeout handlers by associating the initiating script with the compiled JSScript. Fix error message that covers all import() failures that don't throw a JS exception. M1331662 Partial - Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes. Left EvaluateString() in nsXBLProtoImplField.cpp until ExecutionContext errors can be fixed. (1109559a)
This commit is contained in:
@@ -1075,7 +1075,7 @@ void ScriptLoader::FinishDynamicImport(JSContext* aCx,
|
||||
if (NS_FAILED(aResult)) {
|
||||
MOZ_ASSERT(!JS_IsExceptionPending(aCx));
|
||||
JS_ReportErrorNumberUC(aCx, js::GetErrorMessage, nullptr,
|
||||
JSMSG_IMPORT_SCRIPT_NOT_FOUND);
|
||||
JSMSG_DYNAMIC_IMPORT_FAILED);
|
||||
}
|
||||
|
||||
JS::Rooted<JS::Value> referencingScript(aCx,
|
||||
@@ -2393,6 +2393,15 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* static */ LoadedScript* ScriptLoader::GetActiveScript(JSContext* aCx) {
|
||||
JS::Value value = JS::GetScriptedCallerPrivate(aCx);
|
||||
if (value.isUndefined()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return static_cast<LoadedScript*>(value.toPrivate());
|
||||
}
|
||||
|
||||
void
|
||||
ScriptLoader::ProcessPendingRequestsAsync()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user