Module registry in shell module loader needs to be keyed by both module type and path
Categories
(Core :: JavaScript Engine, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox130 | --- | fixed |
People
(Reporter: jon4t4n, Assigned: jon4t4n)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
If we run the code in the example below (in the JS shell), we see the JSON module printed twice. The second import should be a syntax error. The module map needs to be keyed by both the module type and path in the shell as well.
Fixing the module map showed that dynamic imports have been broken from the start but passed all tests because of this bug. We don't properly pass the attributes down into OnResolvedDynamicModule, and instead create the ModuleRequestObject
without any attributes.
Example:
import a from 'test.json' with { type: 'json' }
print(valueToSource(a)); // ({a:123})
import b from 'test.json'
print(valueToSource(b)); // ({a:123})
Updated•4 months ago
|
Assignee | ||
Comment 1•4 months ago
|
||
Assignee | ||
Comment 2•4 months ago
|
||
Depends on D212054
Updated•4 months ago
|
Updated•4 months ago
|
Assignee | ||
Comment 3•2 months ago
|
||
The attributes are currently not exposed to JS, and embedders have no way of
altering what attributes we support. We might want to go back to storing the
attributes on the module request object again when we figure out how the host
hook will work [1]. However, until then, let's only store the module type to
make the code simpler.
Updated•2 months ago
|
Updated•2 months ago
|
Comment 5•2 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e717ebb2097e
https://hg.mozilla.org/mozilla-central/rev/7c094d6f66b5
https://hg.mozilla.org/mozilla-central/rev/f9f78310ac05
Description
•