Pass referrer to HostLoadImportedModule in dynamic import
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
This is a follow-up from https://phabricator.services.mozilla.com/D214569
According to the spec, https://tc39.es/ecma262/#sec-evaluate-import-call
We need to get the referrer information and pass it to HostLoadImportedModule.
| Assignee | ||
Updated•1 year ago
|
Comment 1•11 months ago
|
||
For dynamic import we have the possibility that the referrer is a classic script. Currently the referrer is passed as a module object. There are a couple of ways we could make this work (pass either using a Value or always pass a script). Currently the module loader doesn't use referrer much, possibly because it's not always available.
The aim of all of this should be to have a single HostLoadImportedModule function in the engine that is used in all places. Currently we call the module load hook twice outside of this function.
Comment 2•11 months ago
|
||
Previously we passed the module object for modules and nullptr for other cases.
This patch makes it so we pass the script for both module and classic script
referrers, and nullptr for the realm case.
Comment 3•11 months ago
|
||
This already takes the referrer script. We can use the referrer script to keep
its private value alive in DynamicImportContextObject which is much simpler.
Comment 4•11 months ago
|
||
Comment 5•11 months ago
|
||
Comment 6•11 months ago
|
||
Comment 8•11 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/373a0f470ec4
https://hg.mozilla.org/mozilla-central/rev/46cf58f2d993
https://hg.mozilla.org/mozilla-central/rev/1c8a5ff6db56
https://hg.mozilla.org/mozilla-central/rev/4a453f447cba
https://hg.mozilla.org/mozilla-central/rev/713598f2054c
Updated•10 months ago
|
Description
•