Private Slots

Dean Landolt dean at deanlandolt.com
Tue Jan 15 11:21:28 PST 2013


On Tue, Jan 15, 2013 at 2:01 PM, Kevin Smith <khs4473 at gmail.com> wrote:

>
>
>> (b) is a change from ES5 but you don't object to weak maps -- why not?
>>
>
> WeakMaps provide a new feature without extending the object model.  They
> are "external" to objects, if you like.
>
>
>>
>> (c) is not a change from JS's object model!
>
>
> Sure - but I'm not objecting to closed-over state (in any form).  That
> would be ludicrous.  : )
>

Would it? I'd love to see a stronger form of freeze that "purified" an
object's scope.


>
>>  and by (a) you're assuming the conclusion.
>>>
>>
>> No, I'm saying the horse already left the barn.
>
>
> Again, not objecting to private state.  But just because we allow private
> state, it does not necessarily follow that we should mess with the object
> model to accommodate it.  Maybe it's worth it, I don't know.  That's the
> whole point:  I don't know.  And when in doubt...
>

You keep objecting on the grounds of object model changes, but you seem to
be totally fine with the notion of unique objects, which IMHO are the
substantial object model change. Compared to this, the ability to specify
keys as "non-reflectable" (as Nathan put it) seems trivial. This ability
seems to me to be a natural extension of property definitions, it's just
that it wasn't necessary in ES5 because it is meaningless for string keys.

[snipped the rest]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130115/f97a181a/attachment.html>


More information about the es-discuss mailing list