On Mar 21, 2012, at 3:28 PM, David Herman wrote:
> * importing with renaming:
>
> import { draw: drawGun } from "cowboy.js",
> { draw: drawWidget } from "widgets.js";
Hey Dave,
This all looks really nice! - the only thing that threw me was the export
rename – I intuitively expect the think on the left of the colon to be the new
name, not the old one. I guess my expectation comes from existing JS: :-)
var oldName = 42;
var o = { newName: oldName };
The contextual 'as' looks nice to me for module renames, and would make the
direction of the renaming clear - was this been considered for the exports too?
import { draw as drawGun } from "cowboy.js",
{ draw as drawWidget } from "widgets.js";
Also, are the braces necessary to parse this? Perhaps they could be omitted?
import draw as drawGun from "cowboy.js";
cheers,
G.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss