Kevin Smith zenparsing at
Tue Jul 1 11:18:10 PDT 2014

>     module name from './path'
>     ...
>     name.method();

Right - that would work for objects-as-modules, but this wouldn't:

    import { something } from "./path";

Unless you somehow emitted getters for all references to "something".
 Without consulting documentation, I would expect that these two things:

    module x from "./path";
        // From within some function or other;

    import { foo } from "./path";
        // From within some function or other

would be equivalent.  I think a beginner would find a difference there

Also, consider hoisting.

    // Call an imported function directly
    import { foo } from "./path";

    module m from "./path";;

With "object-as-module", neither one is going to work if you have a
circular dependency at play.

Of course, these gains aren't giant - they support edge cases.  But they
are real.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list