Skip to content

Editorial: Add a note about the possibility of deferring getting the list of exports - #69

Open
nicolo-ribaudo wants to merge 2 commits into
tc39:mainfrom
nicolo-ribaudo:alternative-68
Open

Editorial: Add a note about the possibility of deferring getting the list of exports#69
nicolo-ribaudo wants to merge 2 commits into
tc39:mainfrom
nicolo-ribaudo:alternative-68

Conversation

@nicolo-ribaudo

Copy link
Copy Markdown
Member

A goal of the proposal is that implementations can, under some circumstances, easily implement lazy loading of deferred modules (when they know that they don't have syntax errors or transitive async dependencies). While trying to actually implement an example of that, I found a problem: even though it's not user-exposed, the spec eagerly reads the list of exports in GetModuleNamespace.

This PR centralized the logic to get and sort the list of names in a single place, and adds a note explaining that it's a pure operation and thus can actually be deferred if needed for implementation purposes.

Closes #68

@guybedford

Copy link
Copy Markdown
Collaborator

This does seem preferable to #68, noting laziness as a property implementations can use as opposed to trying to hard code it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants