Skip to content

Commit c56be98

Browse files
test(test262): assert two more errors webpack reports at build time
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 d515e08 commit c56be98

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",
@@ -886,18 +891,12 @@ const knownBugs = [
886891
// `#mark in obj` needs `isExtensible() === false` without evaluating, so the
887892
// target must be sealed with every export name on it, and a mismatch loses one.
888893
"import/import-defer/evaluation-triggers/ignore-private-name-access.js",
889-
// Host resolution errors must be reported eagerly even for deferred imports;
890-
// webpack turns a missing module into a build error resolved lazily instead.
891-
"import/import-defer/errors/resolution-error/import-defer-of-missing-module-fails.js",
892894
// A deferred module must wait for the whole strongly-connected component when a
893895
// dependency's cycle root is still evaluating-async (`IsModuleSCCEvaluated`).
894896
"import/import-defer/evaluation-top-level-await/async-cycle-dependency-of-deferred-module/main.js",
895897
// It also wants `ownKeys` to be the sorted exports plus `@@toStringTag`, so
896898
// `__esModule` would have to go — the namespace trade-off, not a defer fix.
897899
"import/import-defer/deferred-namespace-object/exotic-object-behavior.js",
898-
// Reported as a build error, earlier than the spec's runtime TypeError: the
899-
// binding stays a `var`, which a runtime condition and HMR accept both need.
900-
"module-code/instn-star-binding.js",
901900
// Improvement- bug with `delete` and `ns[0] = something` when using `import * as ns from "...";`
902901
"module-code/export-expname-binding-index.js",
903902
// `String(ns)`/`Number(ns)` rely on `ns`'s prototype being `null` (a real

0 commit comments

Comments
 (0)