Skip to content

Commit eeacc18

Browse files
nicolo-ribaudoptomato
authored andcommitted
Fix import defer test bugs
1 parent c3c318c commit eeacc18

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

test/language/import/import-defer/deferred-namespace-object/exotic-object-behavior.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ assert.compareArray(
4343
"Deferred namespaces' keys are the exports sorted alphabetically, followed by @@toStringTag"
4444
);
4545

46-
verifyProperty(ns, "foo", {
47-
value: 1,
48-
writable: true,
49-
enumerable: true,
50-
configurable: false,
51-
});
46+
// We cannot use `verifyProperty` because the property _looks_ writable, but it's actually not
47+
const desc = Reflect.getOwnPropertyDescriptor(ns, "foo");
48+
assert.sameValue(desc.value, 1, "The value of the 'foo' property is 1");
49+
assert.sameValue(desc.writable, true, "The 'foo' property is writable");
50+
assert.sameValue(desc.enumerable, true, "The 'foo' property is enumerable");
51+
assert.sameValue(desc.configurable, false, "The 'foo' property is not configurable");
52+
5253
assert.sameValue(Reflect.getOwnPropertyDescriptor(ns, "non-existent"), undefined, "No descriptors for non-exports");

test/language/import/import-defer/errors/get-self-while-defer-evaluating/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ features: [import-defer]
3737

3838
import defer * as ns from "./dep_FIXTURE.js";
3939

40-
assert(globalThis["error on ns.foo"] instanceof TypeError, "ns.foo while evaluating throws a TypeError");
40+
ns.x;
4141

42-
ns.foo;
42+
assert(globalThis["error on ns.foo"] instanceof TypeError, "ns.foo while evaluating throws a TypeError");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
22
// This code is governed by the BSD license found in the LICENSE file.
33

4-
import defer * as ns from "./import-defer-throws_FIXTURE.js";
4+
import defer * as ns from "./throws_FIXTURE.js";
55
export { ns };

test/language/import/import-defer/evaluation-top-level-await/flattening-order/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ assert.compareArray(globalThis.evaluations, [
6363
"2.1.1 end",
6464
"2.2 end",
6565
"4.1 start",
66-
"4.1 end",
67-
"5"
66+
"4.1 end"
6867
]);
6968

7069
globalThis.evaluations = [];

0 commit comments

Comments
 (0)