Module import/export bindings

caridy caridy at gmail.com
Wed Mar 18 16:34:56 UTC 2015


Kyle, same answer, `let x = y` is just an assignment. btw, you cannot change `y` in that module, that's a static error.

/caridy

> On Mar 18, 2015, at 12:26 PM, Kyle Simpson <getify at gmail.com> wrote:
> 
>> we are NOT changing the semantic of the assignment expression.
> 
> So the result is going to be `42` / `"orig"`, right? :)
> 
> The reason I asked is not because I thought we were changing the semantic of the assignment expression, but because I wasn't sure if this top-level "const or whatever binding" was some sort of special thing that you can only hold a reference to. Clearly not.
> 
> Also, since `y` keeps a reference to the "orig"inal function reference imported, even if the module updates itself, this very well may affect those who (in places other than this thread, and for different reasons) have often suggested they plan to do stuff like:
> 
> ```js
> import { y } from "..";
> 
> let x = y;
> ..
> // use x now
> ```
> 
> In those cases, I was trying to find out if `x` could be updated by the module itself, like `y` can, because that matters (either good or bad) to the desire to use such a pattern. Since `x` can't get updated here, it's now clear to me that I wouldn't want to use such pattern, for fear that I am not using the latest API binding.
> 
> Thanks for clarifications!
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list