mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 01:44:58 +00:00
LibJS+LibWeb: Another round of bringing module loading closer to spec
In particular, this patch focuses on: - Updating the old "import assertions" to the new "import attributes" - Allowing realms as module import referrer
This commit is contained in:
parent
82977ab44b
commit
07f567cd9f
14 changed files with 244 additions and 178 deletions
|
@ -59,8 +59,8 @@ DeprecatedString module_type_from_module_request(JS::ModuleRequest const& module
|
|||
// 1. Let moduleType be "javascript".
|
||||
DeprecatedString module_type = "javascript"sv;
|
||||
|
||||
// 2. If moduleRequest.[[Assertions]] has a Record entry such that entry.[[Key]] is "type", then:
|
||||
for (auto const& entry : module_request.assertions) {
|
||||
// 2. If moduleRequest.[[Attributes]] has a Record entry such that entry.[[Key]] is "type", then:
|
||||
for (auto const& entry : module_request.attributes) {
|
||||
if (entry.key != "type"sv)
|
||||
continue;
|
||||
|
||||
|
@ -719,7 +719,7 @@ void fetch_single_imported_module_script(JS::Realm& realm,
|
|||
{
|
||||
// 1. Assert: moduleRequest.[[Attributes]] does not contain any Record entry such that entry.[[Key]] is not "type",
|
||||
// because we only asked for "type" attributes in HostGetSupportedImportAttributes.
|
||||
for (auto const& entry : module_request.assertions)
|
||||
for (auto const& entry : module_request.attributes)
|
||||
VERIFY(entry.key == "type"sv);
|
||||
|
||||
// 2. Let moduleType be the result of running the module type from module request steps given moduleRequest.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue