On Apr 21, 2011, at 6:11 AM, Geoffrey Sneddon wrote:

> On 18/03/11 20:05, Brendan Eich wrote:
>> ...
>> 8. Else goto one of the earlier steps, possibly adjusting specs and impls 
>> based on feedback and uptake.
>> 
>> This is *not* going to be "quick".
> 
> Is there much to be gained by removing __proto__ entirely? IIRC the original 
> proposal was just to change it to being [[Writeable]]: false. Sure, still 
> having it around isn't as nice as removing it entirely, but the cost of 
> removing it would appear to be fairly high (it's fairly widely used in a 
> read-only sense, and getting all that content to change is a lot of work for 
> IMO not that much gain).

Obviously I agree that __proto__ is hard to kill. Hence my reply to Oliver's 
"as quickly as possible", which does not say how quickly, but which suggests 
with all due haste (where our haste does not mean a thing to absent or 
unmotivated content developers).

OTOH we don't need to standardize __proto__. We might instead poison-pill it in 
Harmony, so opting in involves an early error on every use of __proto__, and 
you have to migrate by switching to Object.getPrototypeOf or an object 
initialiser extension that allows presetting the new object's prototype chain 
link.

I don't recommend we do this. Poison pills for arguments.callee, etc., were one 
thing (and arguments.callee in particular is a reflective API not replaceable 
with named function expressions, since it can be eval'ed into arbitrary 
function code where the enclosing function may not have a single known name). 
ES5 strict was trying to get rid of capability leaks ('callee'), and stack 
walking hazards ('caller').

With non-writable __proto__ and Object.getPrototypeOf, there's no capability 
leak. The two are (or should be, modulo implementation baggage) equivalent.

Plus, a poison pill is yet another migration tax. Even for the good of 
eliminating __proto__ some decades hence, it is potentially high: some 
developers may hit the early error and decide "screw Harmony!" and stick with 
the default script type. This is a non-trivial risk of poison-pilling 
__proto__, and it goes directly against the proposed good of eliminating 
__proto__ usage in the wild.

My argument leaves us with __proto__ as non-standard extension, to wean people 
off of if we can, via docs and evangelism. This seems a better course to me 
than premature (anti-)standardization.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to