On 27 August 2012 11:46, Shijun He <[email protected]> wrote: > On Mon, Aug 27, 2012 at 2:11 PM, Luke Hoban <[email protected]> wrote: >>> And is there any difference if module A is write as: >> >>> module A { >>> var _a = 'a' >>> export function changeA(v) { >>> a = v >>> } >>> export {a: _a} >>> } >> >> This should not work. There is no value in scope inside the module 'A' with >> the name 'a' here. The exported name 'a' is only available as a member of >> the module 'A' via 'A.a'. >> > > Sorry I don't get it. Do you mean > > import {a} in A // compile error? > > but > > A.a // accessible?
No, Luke just meant that the assignment in changeA should read _a = v since that is the local name of the variable. After changing that, the module is indeed equivalent to the other version. /Andreas _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

