As Domenic said, your examples should be fine as long as the assignment
happens in the module that originally exports the bindings. This is how
I’ve implemented it with the new transpiler rewrite:
https://github.com/square/es6-module-transpiler/tree/rewrite-with-bindings/test/examples/bindings

Note that this would be an error:

import { a } from ‘./a’;
export { a };
a++;


On Mon, Jun 23, 2014 at 2:31 PM, Domenic Denicola <
[email protected]> wrote:

>  The exported values change, and any bindings created by import
> statements now reference the new values.
>  ------------------------------
> From: Guy Bedford <[email protected]>
> Sent: ‎2014-‎06-‎23 17:30
> To: es-discuss <[email protected]>
> Subject: Understanding module bindings
>
>  I was just looking to clarify how module bindings behave.
>
>  What happens in the following example:
>
>  export var template = '...template string...';
> export var counter = 0;
> export var obj = {};
>
>  template += 'post-script';
> counter++;
> obj = { new: 'obj' };
>
>  Do these throw an error? Does the exported value change, or does the
> internal value change only?
>
>  It would be good to make sure we're implementing this right.
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to