[EMAIL PROTECTED] wrote:
> An importer could use this as follows --
>
> var doc = ...;
> var bg = ...;
>
> import
> of fetchModule('http://foo.com/someModule.js'),
> with document: doc, background: bg
> using t: toggle, s: set;
From the descriptions it looks like this could instead use
a syntax based on destructuring assignment, if es-harmony
will have destructuring:
var {toggle: t, set: s} = import
( fetchModule ('http://foo.com/someModule.js'),
{document: doc, background: bg}
);
t();
One advantage would be that people would remember this syntax
easily, since it's useful elsewhere.
As a side effect, one could then choose to use the returned
object instead:
var m = import
( fetchModule ('http://foo.com/someModule.js'),
{document: doc, background: bg}
);
m.toggle();
--
Ingvar von Schoultz
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss