Skip to content

[export-defer] Add cases for namespace operations that triggers evaluation#5035

Open
caiolima wants to merge 2 commits intotc39:mainfrom
caiolima:export-defer-and-ns-objects
Open

[export-defer] Add cases for namespace operations that triggers evaluation#5035
caiolima wants to merge 2 commits intotc39:mainfrom
caiolima:export-defer-and-ns-objects

Conversation

@caiolima
Copy link
Copy Markdown
Contributor

Test the observable deferred evaluation semantics of export defer and namespace objects combination. The proposal only inserts EvaluateModuleSync into [[Get]], so only operations that route through [[Get]] on the namespace object trigger deferred source evaluation.

Tests use three template families that reflect this classification:

  • trigger-on-exported/ (4 variants: string-exported, string-not-exported, then-exported, then-not-exported): For operations that route through [[Get]] and trigger evaluation when the key is a deferred-reexported name. The string-not-exported and then-not-exported variants verify that non-exported keys do NOT trigger (the [[Get]] returns undefined before reaching GetOptionalIndirectExportsModuleRequests).
  • no-trigger-on-exported/ (4 variants: string-exported, string-not-exported, then-exported, then-not-exported): For key-sensitive operations that never route through [[Get]].
  • no-trigger/ (1 variant: no key): For operations that take no property key or where the key is irrelevant, evaluation is never triggered.

…cases

Test the observable deferred evaluation semantics of `export defer`
namespace objects. The proposal only inserts EvaluateModuleSync into
[[Get]], so only operations that route through [[Get]] on the namespace
object trigger deferred source evaluation.

Tests use three template families that reflect this classification:

  trigger-on-exported/ (4 variants: string-exported, string-not-exported,
    then-exported, then-not-exported)
    For operations that route through [[Get]] and trigger evaluation when
    the key is a deferred-reexported name. The string-not-exported and
    then-not-exported variants verify that non-exported keys do NOT trigger
    (the [[Get]] returns undefined before reaching
    GetOptionalIndirectExportsModuleRequests).

  no-trigger-on-exported/ (4 variants: string-exported,
    string-not-exported, then-exported, then-not-exported)
    For key-sensitive operations that never route through [[Get]].

  no-trigger/ (1 variant: no key)
    For operations that take no property key or where the key is
    irrelevanr, ns evaluation is never triggered.
@caiolima caiolima requested a review from a team as a code owner April 16, 2026 19:41
@nicolo-ribaudo nicolo-ribaudo added the awaiting stage 2.7 Supports a "Stage 2" feature label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting stage 2.7 Supports a "Stage 2" feature needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants