- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Fri, 15 Jun 2012 18:44:01 -0400
- To: Travis Leithead <travis.leithead@microsoft.com>
- CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 6/15/12 6:24 PM, Travis Leithead wrote: > First of all, changing an instance's internal prototype is not legit ECMAScript. Yes, yes. But I didn't remember the property descriptor boilerplate offhand. The effect is the same. > Beyond that, the getter (or setter) always has to validate the "this" value > whenever it is invoked because you can always "bind" or "call" the method > with _any_ this value. Yes, of course. The question is what values of "this" should be valid for web APIs. > Off topic: Usually interfaces that are right-hand-side targets for the implements statement > Are marked with [NoInterfaceObject] so that you don't typically see this problem That doesn't help in my example. Setting C as [NoInterfaceObject] does not prevent someone from grabbing a getter from an instance of A and calling it on an instance of B. The question is whether that should throw or "work". The spec right now is somewhere between ambiguous and "work". I would prefer that it said "throw". -Boris
Received on Friday, 15 June 2012 22:44:34 UTC