Sharing module's environment (i.e., Module Record) along multiple imports

Michiel Sikma michiel at sikma.org
Fri May 22 10:40:47 UTC 2015


2015-05-21 23:24 GMT+01:00 Allen Wirfs-Brock <allen at wirfs-brock.com>:
>
>
> The intent is that a single module source code resource corresponds to a
> single Module Record, regardless of the access path that was used to
> identify the resource. The quoted text from HostResolveImportedModule is
> saying that it is ok to use more than one "path" to identify a specific
> resource and you will still get the same Module Record.  Conversely, "./a"
> referenced from two different places in a directory structure might
> reference different source code resources and hence yield different Module
> Records.
>
> Ultimately, it's up to the implementation provided module loader to define
> the interpretation of all such module references, but a rational
> expectation for the example you provide is case #1
>

Indeed, case #2 seems very strange. Fortunately, anyone implementing case
#2 will probably soon realize that it breaks the world.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150522/851ad371/attachment.html>


More information about the es-discuss mailing list