Skip to content

Commit e18c589

Browse files
committed
Allow root modules to imported modules
Root modules (non-cacheable) should register their module_id -> URL so that, if they load a nested module, we can get the full URL of the nested module.
1 parent 2815f02 commit e18c589

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/js.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,9 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
728728
if (try m.instantiate(v8_context, resolveModuleCallback) == false) {
729729
return error.ModuleInstantiationError;
730730
}
731-
731+
const arena = self.context_arena;
732+
const owned_url = try arena.dupe(u8, url);
733+
try self.module_identifier.putNoClobber(arena, m.getIdentityHash(), owned_url);
732734
_ = try m.evaluate(v8_context);
733735
}
734736

0 commit comments

Comments
 (0)