Rewrite import defer resolution test ot not expect specific error

This commit is contained in:
Nicolò Ribaudo 2025-02-26 11:45:03 +01:00 committed by Ms2ger
parent 88ebb1e375
commit 2ad7f321d7
2 changed files with 18 additions and 8 deletions

View File

@ -9,14 +9,18 @@ info: |
LoadRequestedModules ([ _hostDefined_ ])
- just notice that it does not check if the module is deferred
flags: [module]
flags: [async, module]
includes: [asyncHelpers.js]
features: [import-defer]
negative:
phase: resolution
type: SyntaxError
---*/
$DONOTEVALUATE();
import defer * as ns from "./resolution-error_FIXTURE.js";
asyncTest(async () => {
globalThis.evaluated = false;
try {
await import("./main_FIXTURE.js");
} catch {
assert.sameValue(globalThis.evaluated, false, "The module should not be evaluated");
return;
}
throw new Error("The module should throw");
})

View File

@ -0,0 +1,6 @@
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
import defer * as ns from "./resolution-error_FIXTURE.js";
globalThis.evaluated = true;