Do Anonymous Exports Solve the Backwards Compatibility Problem?
brendan at mozilla.com
Wed Dec 19 20:24:19 PST 2012
Domenic Denicola wrote:
>> -----Original Message-----
>> From: es-discuss-bounces at mozilla.org [mailto:es-discuss- bounces at mozilla.org] On Behalf Of Brendan Eich
>> Sent: Wednesday, December 19, 2012 23:11
>> In a thread you may not have caught up on, Andreas did argue for a special form such as
>> module foo at "foo";
>> for anonymous import, so that the system can check that "foo" indeed does
>> export = ...
>> and throw otherwise. Sorry if you did see this and reply (in which case I missed the reply!). If not, whaddya think?
[What mis-cited? gmail?]
> IMO this is undesirable. In such a situation, modules can no longer be abstraction boundaries. Instead you must peek inside each module and see which form it exported itself using.
You have to know what a module exports, period. That *is* the
abstraction boundary, the edge you must name or otherwise denote.
All Andreas is arguing for is a runtime error when you try to denote an
anonymous export but the module does not match. This matters, since as
Kevin and Dave just went through, and Andreas already explained, exports
alias and mutation makes this observable.
More information about the es-discuss