mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-05-27 03:20:56 +00:00
ported from UXP: Issue #1691 - Part 1: Provide a way of associating a private value with a script or module. (1a6b3a82)
This commit is contained in:
@@ -800,13 +800,13 @@ ScriptLoader::StartFetchingModuleAndDependencies(ModuleLoadRequest* aParent,
|
||||
|
||||
// 8.1.3.8.1 HostResolveImportedModule(referencingModule, specifier)
|
||||
JSObject*
|
||||
HostResolveImportedModule(JSContext* aCx, JS::Handle<JSObject*> aModule,
|
||||
HostResolveImportedModule(JSContext* aCx,
|
||||
JS::Handle<JS::Value> aReferencingPrivate,
|
||||
JS::Handle<JSString*> aSpecifier)
|
||||
{
|
||||
// Let referencing module script be referencingModule.[[HostDefined]].
|
||||
JS::Value value = JS::GetModuleHostDefinedField(aModule);
|
||||
auto script = static_cast<ModuleScript*>(value.toPrivate());
|
||||
MOZ_ASSERT(script->ModuleRecord() == aModule);
|
||||
auto script = static_cast<ModuleScript*>(aReferencingPrivate.toPrivate());
|
||||
MOZ_ASSERT(JS::GetModulePrivate(script->ModuleRecord()) == aReferencingPrivate);
|
||||
|
||||
// Let url be the result of resolving a module specifier given referencing
|
||||
// module script and specifier.
|
||||
@@ -814,7 +814,7 @@ HostResolveImportedModule(JSContext* aCx, JS::Handle<JSObject*> aModule,
|
||||
if (!string.init(aCx, aSpecifier)) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!aModule || !aCx) {
|
||||
if (!script || !aCx) {
|
||||
// Our module context was ripped out from under us...
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user