import { foo, bar } as obj from 'module

Darien Valentine valentinium at
Wed Dec 13 21:27:42 UTC 2017

> Those {} that you see in the export and import statements are not
objects, it is just syntax. Yes, I know, people confuse them with objects,
until they realize they aren’t. We probably should have chosen a different
syntax to signal that it is a binding from the module’s environment record.

Not sure about the other folks here, but I wasn’t under the impression that
the braces were an object literal or a binding pattern — though obviously
`* from 'foo'` does return the module namespace exotic object. The idea I
think is that it would be useful to extend NamespaceImport to permit
retrieving a filtered view of the MNSEO that exposes only the specified
bindings. I see that it’s novel because (correct me if I’m wrong) the same
MNSEO instance is returned for namespace imports across multiple importing
modules and is observably the same reference; currently it’s just "create
the first time, retrieve thereafter". So here we’d be explicitly requesting
a new object even if the module instance is already loaded, yes — but
presumably it would be a new MNSEO (or proxy thereof) with the usual
binding semantics, not a pojo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list