Do Anonymous Exports Solve the Backwards Compatibility Problem?

Brendan Eich brendan at mozilla.com
Wed Dec 19 20:10:30 PST 2012


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?

/be

David Herman wrote:
> On Dec 19, 2012, at 12:05 PM, Andreas Rossberg<rossberg at google.com>  wrote:
>
>>> Assigning a single exports also nudges people to make small modules
>>> that do one thing.
>> It rather nudges people into exporting an object as a module, instead of writing a real module. The only "benefit" of that is that they lose all static checking.
>
> I don't think that's fair. It's just an anonymous export. The contents of an export are always dynamic.
>
> All this "nudge" stuff makes me itch, though. I have about ε sympathy for enforcing/encouraging aesthetics and styles. That ain't JavaScript's way, and I sure don't trust TC39 (i.e., me) to take on a paternalistic role.
>
> Dave
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list