mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
Fix JS shell module hook build
This commit is contained in:
parent
bcff9710c8
commit
0d06f59dc1
1 changed files with 12 additions and 3 deletions
|
|
@ -3330,6 +3330,15 @@ static const JSClass sandbox_class = {
|
||||||
&sandbox_classOps
|
&sandbox_classOps
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum GlobalAppSlot {
|
||||||
|
GlobalAppSlotModuleMetadataHook,
|
||||||
|
GlobalAppSlotModuleDynamicImportHook,
|
||||||
|
GlobalAppSlotCount
|
||||||
|
};
|
||||||
|
|
||||||
|
static_assert(GlobalAppSlotCount <= JSCLASS_GLOBAL_APPLICATION_SLOTS,
|
||||||
|
"global application slots overflow");
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SetStandardCompartmentOptions(JS::CompartmentOptions& options)
|
SetStandardCompartmentOptions(JS::CompartmentOptions& options)
|
||||||
{
|
{
|
||||||
|
|
@ -4158,7 +4167,7 @@ ParseModule(JSContext* cx, unsigned argc, Value* vp)
|
||||||
|
|
||||||
const char16_t* chars = stableChars.twoByteRange().begin().get();
|
const char16_t* chars = stableChars.twoByteRange().begin().get();
|
||||||
JS::SourceBufferHolder srcBuf(chars, scriptContents->length(),
|
JS::SourceBufferHolder srcBuf(chars, scriptContents->length(),
|
||||||
SourceBufferHolder::NoOwnership);
|
JS::SourceBufferHolder::NoOwnership);
|
||||||
|
|
||||||
RootedObject module(cx, frontend::CompileModule(cx, options, srcBuf));
|
RootedObject module(cx, frontend::CompileModule(cx, options, srcBuf));
|
||||||
if (!module)
|
if (!module)
|
||||||
|
|
@ -4369,7 +4378,7 @@ AbortDynamicModuleImport(JSContext* cx, unsigned argc, Value* vp)
|
||||||
RootedString specifier(cx, args[1].toString());
|
RootedString specifier(cx, args[1].toString());
|
||||||
Rooted<PromiseObject*> promise(cx, &args[2].toObject().as<PromiseObject>());
|
Rooted<PromiseObject*> promise(cx, &args[2].toObject().as<PromiseObject>());
|
||||||
|
|
||||||
cx->setPendingException(args[3]);
|
cx->setPendingException(args[3], nullptr);
|
||||||
return js::FinishDynamicModuleImport(cx, args[0], specifier, promise);
|
return js::FinishDynamicModuleImport(cx, args[0], specifier, promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8422,7 +8431,7 @@ main(int argc, char** argv, char** envp)
|
||||||
|
|
||||||
JS::SetModuleResolveHook(cx->runtime(), ShellModuleResolveHook);
|
JS::SetModuleResolveHook(cx->runtime(), ShellModuleResolveHook);
|
||||||
JS::SetModuleDynamicImportHook(cx, ShellModuleDynamicImportHook);
|
JS::SetModuleDynamicImportHook(cx, ShellModuleDynamicImportHook);
|
||||||
JS::SetModuleMetadataHook(cx, ShellModuleMetadataHook);
|
JS::SetModuleMetadataHook(cx, CallModuleMetadataHook);
|
||||||
|
|
||||||
result = Shell(cx, &op, envp);
|
result = Shell(cx, &op, envp);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue