Module Comments

Kevin Smith khs4473 at gmail.com
Sun Dec 9 20:30:49 PST 2012


> Since it is just sugar, and supposed to be equivalent to the
> expansion, you (fortunately) would get an error (statically).
>

OK, then suppose we have these two separate forms:

    import x from "url"; // Bind x to the anonymous export, if defined,
otherwise error

and

    import module x from "url"; // Bind x to the module instance

In the vast majority of cases the "module" keyword above can be inferred
correctly at link-time based on whether or not there is an anonymous export
in the target module.

If it were important for the user to disambiguate in those rare cases, and
load the module instance instead of the anonymous export, then she could
simply provide the optional "module" keyword.

Does that work?

- Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121209/108f7379/attachment.html>


More information about the es-discuss mailing list