Fix import defer test bugs

This commit is contained in:
Nicolò Ribaudo 2025-03-12 15:31:32 +01:00 committed by Philip Chimento
parent c3c318cf11
commit eeacc18d05
4 changed files with 11 additions and 11 deletions

View File

@ -43,10 +43,11 @@ assert.compareArray(
"Deferred namespaces' keys are the exports sorted alphabetically, followed by @@toStringTag" "Deferred namespaces' keys are the exports sorted alphabetically, followed by @@toStringTag"
); );
verifyProperty(ns, "foo", { // We cannot use `verifyProperty` because the property _looks_ writable, but it's actually not
value: 1, const desc = Reflect.getOwnPropertyDescriptor(ns, "foo");
writable: true, assert.sameValue(desc.value, 1, "The value of the 'foo' property is 1");
enumerable: true, assert.sameValue(desc.writable, true, "The 'foo' property is writable");
configurable: false, assert.sameValue(desc.enumerable, true, "The 'foo' property is enumerable");
}); assert.sameValue(desc.configurable, false, "The 'foo' property is not configurable");
assert.sameValue(Reflect.getOwnPropertyDescriptor(ns, "non-existent"), undefined, "No descriptors for non-exports"); assert.sameValue(Reflect.getOwnPropertyDescriptor(ns, "non-existent"), undefined, "No descriptors for non-exports");

View File

@ -37,6 +37,6 @@ features: [import-defer]
import defer * as ns from "./dep_FIXTURE.js"; import defer * as ns from "./dep_FIXTURE.js";
assert(globalThis["error on ns.foo"] instanceof TypeError, "ns.foo while evaluating throws a TypeError"); ns.x;
ns.foo; assert(globalThis["error on ns.foo"] instanceof TypeError, "ns.foo while evaluating throws a TypeError");

View File

@ -1,5 +1,5 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved. // Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
import defer * as ns from "./import-defer-throws_FIXTURE.js"; import defer * as ns from "./throws_FIXTURE.js";
export { ns }; export { ns };

View File

@ -63,8 +63,7 @@ assert.compareArray(globalThis.evaluations, [
"2.1.1 end", "2.1.1 end",
"2.2 end", "2.2 end",
"4.1 start", "4.1 start",
"4.1 end", "4.1 end"
"5"
]); ]);
globalThis.evaluations = []; globalThis.evaluations = [];