Modules, Concatenation, and Better Solutions

Sam Tobin-Hochstadt samth at ccs.neu.edu
Wed Oct 17 09:09:18 PDT 2012


On Wed, Oct 17, 2012 at 9:51 AM, Kevin Smith <khs4473 at gmail.com> wrote:
>
>> Do we log "you need me" only when f is called for the first time?
>
>
> Sorry - that makes no sense.  What I meant was:
>
>     module A {
>       console.log("you need me");
>       export var x = "x";
>     }
>
>     export function f() {
>       console.log(A.x);
>     }
>
> Do we log "you need me" only when f is called for the first time?

I think that would be far to hard to understand.  Instead, we should
treat a module with a reference like `A.x` to an unimported module as
if it implicitly had an import of `A`, so "you need me" would be
logged as soon as the surrounding module was imported, even if `f` is
never called.
-- 
sam th
samth at ccs.neu.edu


More information about the es-discuss mailing list