Will any new features be tied to constructors?

Andreas Rossberg rossberg at google.com
Thu Jul 2 07:22:29 UTC 2015


On 1 July 2015 at 17:12, Domenic Denicola <d at domenic.me> wrote:

> Similarly, for several V8 built-ins, private state is not done via the
> allocator at all, but instead via "private symbols" that act quite similar
> to data properties. They can be added or removed at any time. In short,
> they're much more part of initialization than of allocation.
>

For the record, the ability to do this is rather an incidental consequence
of private symbols. We don't remove private state anywhere, nor did I
intend it to be used that way. There is one case where we add a private
field dynamically (attaching a stack trace to a thrown object), but that is
a half-broken hack anyway.

I'd love to have a proper allocation-time notion of private state, like
Allen & Kevin suggest. You still have weak maps for more dynamic relations.

/Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150702/cbca6489/attachment-0001.html>


More information about the es-discuss mailing list