Skip to content

Conversation

nicolo-ribaudo
Copy link
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
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