Modules: Curly Free

Andreas Rossberg rossberg at google.com
Tue Apr 23 06:07:23 PDT 2013


On 23 April 2013 15:02, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
> On Tue, Apr 23, 2013 at 8:55 AM, Andreas Rossberg <rossberg at google.com> wrote:
>> On 22 April 2013 22:10, David Herman <dherman at mozilla.com> wrote:
>>> On Apr 22, 2013, at 6:48 AM, Andreas Rossberg <rossberg at google.com> wrote:
>>>
>>>> (And semantics, I presume, because
>>>> Dave hasn't actually told us how the "anonymous" export would be
>>>> distinguished internally.)
>>>
>>> Yes I have! I've explained it before, at least at the March meeting and again in passing in this thread. The anonymous export would be available on the module instance object under a standard unique symbol.
>>
>> Just to be clear, AFAICT, this requires a semantic extension. A module
>> body is, first and foremost, a lexical environment, and environments
>> do not currently have a notion of symbol-named variables (nor should
>> they, IMO).
>
> No, this does not require a semantic extension. I think everyone
> agrees that environments should not have symbol-named variables.
> However, this is neither here nor there for module instance objects,
> which are reflections of module exports as "plain" JS objects. There
> is no semantic extension required for them to have symbol-named
> properties.

Then it is a semantic extension simply because default imports and
exports cannot be rewritten to plain module syntax, i.e. are _not_
syntactic sugar, right?

/Andreas


More information about the es-discuss mailing list