Jan 29 TC39 Meeting Notes

Brendan Eich brendan at mozilla.com
Thu Feb 7 10:30:33 PST 2013

On Feb 7, 2013, at 9:09 AM, David Bruant <bruant.d at gmail.com> wrote:

> Le 07/02/2013 17:25, Rick Waldron a écrit :
>> ## __proto__.
>> Discussion re: MOP semantics with __proto__
>> BE: Proxy has to stratify the MOP.
> Speaking of proxies, what should happen in the following case (setter and proxy from same realm):
> var protoSetter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set
> var p = new Proxy({}, handler);
> protoSetter.call(p, {});
> ?
> Ideas:
> 1) add a setPrototypeOf trap
> 2) throw because it's a proxy (which wouldn't be entirely absurd since extracting the setter shouldn't be encouraged).

I think most favored (2) for all arguments, but we need to confirm.

> This problem is inexistent with a data property. Is an extractable setter *required* for web-compatibility? I've seen lots of use of __proto__ as a pseudo property, but no one extracting the setter yet.

Of course, because until very recently __proto__ has only ever reflected as a data property.

We were going to spec it that way, but implementors felt it more regular to reflect as an accessor. But they also preferred to build in a realm check, rather than poisoning reflected setter and getter. Here we are!

>> AWB: Another issue… Objects that are non-extensible, can you change __proto__? Specifically, now that we're talking about being able to change __proto__, what type of objects can be changed?
>> BE: Wait for Mark?
>> YK?: Changing __proto__ is a write, not adding a property, so it should not be affected by extensibility.
>> AWB: Agree
> How can one defend itself against abusive __proto__ modification? __proto__ becoming standard, "delete Object.prototype.__proto__" is hardly a reliable option, because more code will rely on its existence. If that's not the [[Extensible]] boolean, another boolean has to be added.

Mark reminded us that ES5 (not 6) stipulates that [[Extensible]] false prevents [[Prototype]] writes.


> David
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

More information about the es-discuss mailing list