tc39 / proposal-module-declarations

JavaScript Module Declarations
https://tc39.es/proposal-module-declarations
MIT License
373 stars 7 forks source link

Semantics wording: #2

Closed codehag closed 3 years ago

codehag commented 3 years ago

In https://github.com/littledan/proposal-module-fragments/blob/main/README.md#semantics

It is written:

Like other modules, the host is required to return back the same value of that module when it is imported, or an error.

I think you mean that this is a singleton here? Maybe it would be clearer to say:

Like other modules, if a module is evaluated multiple times, the host is required to return back the same value of that module when it is imported, or the same error. In other words, all modules are singletons

Can create pr if you agree

littledan commented 3 years ago

Hmm, that sentence that I wrote is quite confusing! I don't know what you mean by "evaluated multiple times". I think this is trying to say, "Like other modules, each time the module fragment is imported, the host is required to return the same value of that module. In other words, it's a singleton." PRs welcome.