Skip to content

[import-defer]: Adding test to validate deferred namespaces exports#4962

Open
caiolima wants to merge 1 commit intotc39:mainfrom
caiolima:deferred-ns-export-from-local
Open

[import-defer]: Adding test to validate deferred namespaces exports#4962
caiolima wants to merge 1 commit intotc39:mainfrom
caiolima:deferred-ns-export-from-local

Conversation

@caiolima
Copy link
Contributor

@caiolima caiolima commented Mar 2, 2026

This tests the case for import defer * as ns from 'dep'; export {ns};.

It adds a case for the change in tc39/proposal-defer-import-eval#79

This tests the case for `import defer * as ns from 'dep'; export {ns};`.
@caiolima caiolima requested a review from a team as a code owner March 2, 2026 15:21
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

Comment on lines +31 to +35
assert.compareArray(globalThis.evaluations, ["reexport"],
"deferred module should not be evaluated");

assert.sameValue(ns[Symbol.toStringTag], "Deferred Module",
"'ns' should be a deferred namespace object");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the linked spec change, both these assertions will fail.

@nicolo-ribaudo nicolo-ribaudo added the awaiting consensus This needs committee consensus before it can be eligible to be merged. label Mar 2, 2026
Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting consensus This needs committee consensus before it can be eligible to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants