Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Throwing TypeError in resolve a module specifier? #277

@allstarschh

Description

@allstarschh

According to the import maps spec, resolve a module specifier will throw,
https://wicg.github.io/import-maps/#resolve-a-module-specifier, step 12

Also the callers will be updated as well, according to https://wicg.github.io/import-maps/#resolving-updates

But what about https://html.spec.whatwg.org/multipage/webappapis.html#validate-requested-module-specifiers
According to the HTML spec, the error should be propagated to the script's parse error
https://html.spec.whatwg.org/multipage/webappapis.html#concept-script-parse-error

and later it will be the error to rethrow object of the script.
https://html.spec.whatwg.org/multipage/webappapis.html#concept-script-error-to-rethrow

So in this case, should 'resolve a module specifier' still throw a TypeError if it has any?
Or it should return failure (like the original 'resolve a module specifier' does), and let script to propagate the error?

Note: V8's implementation is in
JSModuleScript::Create
ModulatorImplBase::ResolveModuleSpecifier
and
ImportMap::Resolve

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions