Skip to content

"bad module specifier in a dependency" in dynamic-imports-script-error.html should be updated #55598

@allstarschh

Description

@allstarschh

This is discovered when working on https://phabricator.services.mozilla.com/D269568

bad module specifier in a dependency was used to test the ParseError generated when resolving failed in creating module script, therefore it should be the same error object when calling import() twice.

https://web.archive.org/web/20221130023614/https://html.spec.whatwg.org/#creating-a-javascript-module-script

10. For each ModuleRequest record requested of result.[[RequestedModules]]:

    1. Let url be the result of resolving a module specifier given script and requested.[[Specifier]], catching any exceptions.

    2. If the previous step threw an exception, then:

        1. Set script's parse error to that exception.

However, the current spec doesn't iterate [[RequestedModules]] anymore; instead, it throws the resolutionError when the resolution fails.

See HostLoadImportedModules, step 7.2
and step 8, and is then propagated through FinishLoadingImportedModule to the
reject handler in ContinueDynamicImport, step 1.

Therefore, for the test, it should also have the option { differentErrorObjects: true }

CCing @nicolo-ribaudo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions