Understanding module bindings

Domenic Denicola domenic at domenicdenicola.com
Mon Jun 23 14:31:58 PDT 2014


The exported values change, and any bindings created by import statements now reference the new values.
________________________________
From: Guy Bedford<mailto:guybedford at gmail.com>
Sent: ‎2014-‎06-‎23 17:30
To: es-discuss<mailto:es-discuss at mozilla.org>
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140623/f400c06d/attachment.html>


More information about the es-discuss mailing list