On Mon, Jun 16, 2014 at 1:41 PM, Jasper St. Pierre <[email protected]> wrote:
> > On Mon, Jun 16, 2014 at 1:22 PM, Rick Waldron <[email protected]> > wrote: > >> >> On Mon, Jun 16, 2014 at 1:05 PM, Calvin Metcalf <[email protected] >> > wrote: >> >>> e.g. something like >>> https://gist.github.com/calvinmetcalf/9252f41bf6e3c8b4add7 >>> >> >> re: >> >> let { foo, bar } = import "library"; >> >> Ignoring the UnaryExpression ambiguity, what happens here: >> >> >> // library.js >> export const MAX_VALUE = 1023; >> >> >> // program.js >> let { MAX_VALUE } = import "library"; >> MAX_VALUE = 1; >> > > Seems like a straightforward thing to me. "let" creates a local binding > for the scope of the file. It shouldn't be anything different from: > > function importMyLibrary() { > let module = import "library"; > return module; > } > > let { MAX_VALUE } = importMyLibrary(); > MAX_VALUE = 1; > > Or: > > function importMyLibrary() { > let module = import "library"; > let MAX_VALUE = module.MAX_VALUE; > return { MAX_VALUE: MAX_VALUE }; > } > I think you missed or overlooked the important part: I didn't export a `let` binding, I exported a `const` binding. Rick
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

