ModuleImport

Axel Rauschmayer axel at rauschma.de
Thu Jun 19 02:03:03 PDT 2014


That’s a good solution. Logically, `import { * } from "fs"` may make more sense, but I prefer the “unbraced” asterisk, because it results in less clutter.

Does the proposed syntax clash with `export * FromClause` (which, I’m assuming, re-exports everything, not just the named exports)?

I’d prefer it if named exports and a default export were mutually exclusive, but I understand that is off the table(?) Which is also fine with me…

Axel

On Jun 19, 2014, at 10:15 , David Herman <dherman at mozilla.com> wrote:

> ## Proposal
> 
> OK, so we're talking about a better syntax for importing a module and binding its named exports to a variable (as distinct from importing a module and binding its default export to a variable). Here's my proposal:
> ```js
> import * as fs from "fs"; // importing the named exports as an object
> import Dict from "dict";  // importing a default export, same as ever
> ```

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140619/5c9ca6be/attachment.html>


More information about the es-discuss mailing list