New ES6 draft now available

Tom Van Cutsem tomvc.be at gmail.com
Sun Nov 25 12:42:53 PST 2012


2012/11/24 David Bruant <bruant.d at gmail.com>

>  Le 23/11/2012 18:48, Allen Wirfs-Brock a écrit :
>
>  Added Keys, [[OwnPropertyKeys]], [[Freeze]], [[Seal]], [[IsFrozen]],
> [[IsSealed]].
>
> For both the enumerations and the layer on top of [[PreventExtension]],
> I'm uneasy.
> * [[Enumerate]], [[Keys]] and [[OwnPropertyKeys]] are very close operations
> * So are [[PreventExtensions]]/[[Freeze]]/[[Seal]] on one side and
> [[IsExtensible]]/[[IsFrozen]]/[[IsSealed]]
>
> I'm afraid that making them distinct operations increases footgun-ness.
> [[HasProperty]] has been removed in favored of [[HasOwnProperty]] (which
> might be removed in favor of only keeping [[GetOwnProperty]], though the
> conclusion of the discussion was the keep both IIRC) because the former
> could be "robustly" composed between
>

The way I see it:
- we have no way of enforcing fully internally consistent proxies anyway
- even with some traps removed (such as "has"), opportunities for
inconsistencies abound
- thus, why be selective and try to combat some inconsistencies while
letting others slip by?

The Handler API seems an adequate solution to avoid the footgun of trap
inconsistencies.


>
>   • instanceof operator no longer uses an internal method. Instead,
> extensible via a @@hasInstance symbol-keyed regular method.
>
> I don't remember a discussion on this topic, but I think it's an
> interesting change. Is it for browser APIs?
> There might be an associated security worry here if any object can have
> its @@hasInstance changed, but one good thing is that the debate of
> trapping instanceof ends if it's a symbol-keyed method.
>

I don't think there's a security issue: can't symbol-keyed properties also
be made non-configurable?

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121125/adde15a2/attachment.html>


More information about the es-discuss mailing list