Module Execution Order

Kevin Smith zenparsing at gmail.com
Wed Apr 10 07:06:31 PDT 2013


Hi,

I can't seem to remember or find the rationale behind lazy (interleaved)
execution of external modules.  For example:

    // x.js
    console.log("inside x");
    export var x;

    // y.js
    console.log("inside y");
    import x from "x.js";

With lazy execution, loading "y.js" would produce:

    > inside y
    > inside x

The alternative would be to execute dependencies prior to executing the
requested module:

    > inside x
    > inside y

What was the rationale for choosing the first alternative?

Thanks!

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130410/dd3a1db1/attachment.html>


More information about the es-discuss mailing list