class-private syntax in ES6 (was: ES6, ES7, ES8 and beyond. A Proposed Roadmap.)

Rick Waldron waldron.rick at gmail.com
Mon Apr 29 07:24:39 PDT 2013


On Sun, Apr 28, 2013 at 4:23 PM, Rick Waldron <waldron.rick at gmail.com>wrote:

>
>
>
> On Sun, Apr 28, 2013 at 3:16 PM, Brendan Eich <brendan at mozilla.com> wrote:
>
>> Brian Di Palma wrote:
>>
>>> Another mail that I expected to receive more attention that hasn't...
>>
>>
> @Brian, This is the second time you've opened a thread reply with a rebuke
> regarding (lack of) speedy of response. Just saying...
>
>
>>
>> For some reason my mail program doesn't thread your reply to my o.p. Here
>> it is in the archive, FWIW:
>>
>> https://mail.mozilla.org/**pipermail/es-discuss/2013-**April/029969.html<https://mail.mozilla.org/pipermail/es-discuss/2013-April/029969.html>
>>
>>
>>  We're London based so we had attendants at JQueryUK and the announcement
>>> of
>>> private class state in ES6 was a surprise, a pleasant one but still
>>> surprising.
>>>
>>> Is it the case that the announcement was jumping the gun?
>>>
>>
>> Rembmer, my words were that "I threw up a sketch" -- not a final
>> masterpiece, not the Mona Lisa.
>>
>> However as your meeting notes excerpts show, we still don't quite have
>> consensus on classes _per se_, without including private syntax in ES6.
>>
>> This is an agenda item for the upcoming TC39 meeting. We should try to
>> build on the work by Mark and Tom at
>>
>> http://wiki.ecmascript.org/**doku.php?id=strawman:**relationships<http://wiki.ecmascript.org/doku.php?id=strawman:relationships>
>>
>> and make progress, whether that work ends up in ES6 or ES7 for prudential
>> reasons.
>>
>>
>>  Needless to say for programming with large code bases it would be
>>> excellent to have private state.
>>>
>>
>> Agreed!
>
>
> The introduction of class in ES6 should not be blocked (or postponed until
> ES7) by a lack of class (specific) private declaration form. I understand
> and appreciate Brendan's remarks re: double-blind consensus, but politely
> disagree with the notion that we _must_ produce a specific syntactic form
> when private state can be achieved with the use of a WeakMap or a Symbol:
> https://gist.github.com/rwldrn/5478221
>
>
Mark Miller and I had an offline discussion that clarified for me that the
example using a symbol as a property key would allow the value to be
discovered via ES6's Object.getOwnPropertyKeys() which returns the result
of the internal [[OwnPropertyKeys]] method. The mistake I had made was
assuming that where [[OwnPropertyKeys]] mentions "private Symbol" that it
actually just meant the thing one Symbol that is just a Symbol—which is
incorrect.


Rick



> I've always been an @-name supporter and have had a pending revisitation
> agenda item for the last two meetings, deferred in favor of the bigger fish
> we had to fry ;)
>
> Rick
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130429/0a66a39d/attachment-0001.html>


More information about the es-discuss mailing list