Skip to content

Commit d6e86c0

Browse files
test(test262): assert two more errors webpack reports at build time (#21906)
A module that fails to resolve is a build error whether or not the import is deferred, and assigning to a namespace import is one since #21867. Both were skipped as bugs; now the suite checks webpack reports them.
1 parent 6a963fe commit d6e86c0

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎test/test262.spectest.js‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,11 @@ const baseDir = path.posix.resolve(test262Dir, "./test/language/");
838838
// The spec rejects `import()` for these link errors; webpack, like rollup,
839839
// esbuild and bun, resolves linking at build time and reports them there.
840840
const linkErrorsAtBuildTime = new Set([
841+
// A module that fails to resolve is a build error, deferred or not.
842+
"import/import-defer/errors/resolution-error/import-defer-of-missing-module-fails.js",
843+
// Assigning to a namespace import is a build error, earlier than the
844+
// spec's runtime TypeError.
845+
"module-code/instn-star-binding.js",
841846
// ambiguous star re-export
842847
"expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-ambiguous-import.js",
843848
"expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-ambiguous-import.js",
@@ -889,18 +894,12 @@ const knownBugs = [
889894
// `#mark in obj` needs `isExtensible() === false` without evaluating, so the
890895
// target must be sealed with every export name on it, and a mismatch loses one.
891896
"import/import-defer/evaluation-triggers/ignore-private-name-access.js",
892-
// Host resolution errors must be reported eagerly even for deferred imports;
893-
// webpack turns a missing module into a build error resolved lazily instead.
894-
"import/import-defer/errors/resolution-error/import-defer-of-missing-module-fails.js",
895897
// A deferred module must wait for the whole strongly-connected component when a
896898
// dependency's cycle root is still evaluating-async (`IsModuleSCCEvaluated`).
897899
"import/import-defer/evaluation-top-level-await/async-cycle-dependency-of-deferred-module/main.js",
898900
// It also wants `ownKeys` to be the sorted exports plus `@@toStringTag`, so
899901
// `__esModule` would have to go — the namespace trade-off, not a defer fix.
900902
"import/import-defer/deferred-namespace-object/exotic-object-behavior.js",
901-
// Reported as a build error, earlier than the spec's runtime TypeError: the
902-
// binding stays a `var`, which a runtime condition and HMR accept both need.
903-
"module-code/instn-star-binding.js",
904903
// Improvement- bug with `delete` and `ns[0] = something` when using `import * as ns from "...";`
905904
"module-code/export-expname-binding-index.js",
906905
// `String(ns)`/`Number(ns)` rely on `ns`'s prototype being `null` (a real

0 commit comments

Comments
 (0)