mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Issue #1691 - Part 6e: Fix problems due to divergent codebases. This gets basic dynamic import working. Fix a problem in Part 5b where Mozilla used toGCThing() and we don't. Fix a problem in Part 4 where runtime() returns nullptr in our codebase since it runs on JS Helper thread. We need to get the runtime via runtimeFromAnyThread() instead.
(cherry picked from commit dddb46225bbd1adff11f635e32934aee36923e47)
This commit is contained in:
parent
c3daecc218
commit
e7d0b58e56
3 changed files with 3 additions and 3 deletions
|
|
@ -842,7 +842,7 @@ ModuleObject::maybeScript() const
|
|||
if (value.isUndefined())
|
||||
return nullptr;
|
||||
|
||||
return value.toGCThing()->as<JSScript>();
|
||||
return static_cast<JSScript*>(value.toPrivate());
|
||||
}
|
||||
|
||||
JSScript*
|
||||
|
|
|
|||
|
|
@ -9088,7 +9088,7 @@ BytecodeEmitter::emitTree(ParseNode* pn, ValueUsage valueUsage /* = ValueUsage::
|
|||
break;
|
||||
|
||||
case PNK_CALL_IMPORT:
|
||||
if (!cx->asJSContext()->runtime()->moduleDynamicImportHook) {
|
||||
if (!cx->compartment()->runtimeFromAnyThread()->moduleDynamicImportHook) {
|
||||
reportError(nullptr, JSMSG_NO_DYNAMIC_IMPORT);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10515,7 +10515,7 @@ Parser<ParseHandler>::importExpr(YieldHandling yieldHandling)
|
|||
|
||||
MUST_MATCH_TOKEN_MOD(TOK_RP, TokenStream::Operand, JSMSG_PAREN_AFTER_ARGS);
|
||||
|
||||
if (!context->asJSContext()->runtime()->moduleDynamicImportHook && !abortIfSyntaxParser()) {
|
||||
if (!context->compartment()->runtimeFromAnyThread()->moduleDynamicImportHook && !abortIfSyntaxParser()) {
|
||||
return null();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue