test262
test262 copied to clipboard
Source phase import tests importing from "<do not resolve>" are broken
I believe the following source-phase-import tests are broken because they assume wrong/outdated evaluation order:
language/module-code/source-phase-import/import-source-binding-name.js
language/module-code/source-phase-import/import-source-binding-name2.js
language/module-code/source-phase-import/import-source-newlines.js
They all consist of import "../resources/ensure-linking-error_FIXTURE.js"
followed by import … from '<do not resolve>'
and declare
negative:
phase: resolution
type: SyntaxError
assuming that ensure-linking-error_FIXTURE.js
will cause a SyntaxError
before attempting to load <do not resolve>
.
For that to work, modules would have to be loaded during the linking (resolution) phase, which used to be the case in an older version of the spec, but is no longer the case in the latest spec since there's now a separate "loading" phase (LoadRequestedModules
) that precedes linking, that will run into an error because the requested module cannot be found.
So I think these tests should probably be changed to point to an existing file, so that the loading phase succeeds and the linking phase throws the expected SyntaxError.
Apologies if I missed something (like <do not resolve>
having a special meaning).