A Precedent

Andrea Giammarchi andrea.giammarchi at gmail.com
Fri Apr 12 01:01:46 PDT 2013


"a principle or rule established in a previous case":
http://en.wikipedia.org/wiki/Precedent

I should not be here and I will not answer, just my last attempt trying to
make a point.

Please consider the main developer behind node.js agrees this property
should never land in JS as it's a minefield game specially when security
and server side stuff is involved.

Current status:
https://gist.github.com/WebReflection/5370050

// all IE < 10 browsers

*if* (*!*('__proto__' *in* {})) {

  console.log('you gonna have hard time');

}

// all Mobile WebKit browsers

*if* ('__proto__' *in* Object.create(*null*)) {

  console.log('you gonna have hard time');

}

// all not so updated Chrome browsers plus many mobile  browsers

*if* (*!*Object.getOwnPropertyDescriptor(Object.prototype,
'__proto__').configurable)
{

  console.log('you gonna have hard time');

}

// all updated Chrome browsers plus current node.js

*if* (*!*Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set)
{

  console.log('you gonna have hard time');

}

now ask yourself how good is for the web to promote early adoption of
broken ideas so that the whole future of the language will get screwed.

I think it's called **Butterfly Effect**, and once again this is the best
time ever to officially drop that property instead of promoting it!

P.S. all the community needed/wanted, wasn't a shame like that property in
the `Object.prototype` but a way to subclass or swap class to native,
untouchable, instances/constructors such NodeList and all non ArrayLike
objects: **nothing else**, really!

`Object.setPrototypeOf(obj, proto):obj` is a way better answer for next JS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130412/600a0161/attachment.html>


More information about the es-discuss mailing list