Module import/export bindings

Domenic Denicola d at domenic.me
Mon Mar 16 04:43:26 UTC 2015


From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Kyle Simpson

> Would it then be appropriate to explain that conceptually the binding would otherwise indeed be 2-way, but that the immutable/read-only nature of the bindings is what prevents an outside mutation of a module's internals? That is, without such bindings (and errors), a module could be changed from the outside?

I wouldn't really find this an appropriate explanation. That's kind of like saying "this building's 6th story would be blue, but the 5-story nature of its blueprints is what prevents you from accessing the 6th story." There just isn't any 6th story at all. (Similarly, there just isn't any defined [[Set]] behavior for module namespace objects at all. You could make up a plausible one, like pretending it would modify the original module's bindings, and write a revisionist history in which it was removed. But that's not really how the spec works.)


More information about the es-discuss mailing list