Modules, Concatenation, and Better Solutions

Kevin Smith khs4473 at gmail.com
Tue Oct 16 06:21:53 PDT 2012


> Just to be sure... Does a get printed only the first time the module A is
> imported somewhere, or every time?
>

Only the first time.  But the question here is about nested/inline modules.

Patrick, it must be the other way.  Here's why:

    module A {
        export function f() { console.log("A"); }
    }

    A.f();

No import required before usage of an inline module.  There is a
concatenation strategy which will preserve order-of-execution, but but
without some scope artifacts:

https://gist.github.com/3892979

I'm not saying this is a problem with the current design - just that it
complicates the concatenation story.

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


More information about the es-discuss mailing list