Exporting Symbols

Isiah Meadows isiahmeadows at gmail.com
Sun Oct 18 04:54:31 UTC 2015


May I ask what the use case for exporting symbol-named values is? I
can't seem to think of any obvious one.

On Fri, Oct 16, 2015 at 5:29 PM, Dean Landolt <dean at deanlandolt.com> wrote:
>  [snip]
>
>>
>> So if you export an opaque identity that you created yourself, and don't
>> expose some mechanism for downstream consumers to know what it means, you're
>> handing a bag of meaningless tokens which are, by definition, completely
>> useless to them.
>
>
> I should add: if you only intend to default-export a *single* symbol, this
> is not semantically meaningless. It may be possible to infer some kind of
> meaning from the module path of the import. I'm not convinced this is
> valuable, but it seems like something which could be made to work.
>
> My point only holds when not doing a default-export of a symbol -- e.g.
> using symbol keys on a default-exported object or using unregistered symbols
> as export bindings (if this were even possible).
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
Isiah Meadows


More information about the es-discuss mailing list