__proto__ and accessor descriptors

Asen Bozhilov asen.bozhilov at gmail.com
Fri Oct 26 13:56:19 PDT 2012


I would like to define custom getter and setter for `__proto__` property:

var obj = Object.defineProperty({}, '__proto__', {
    get : function () {return '__proto__ getter'},
    set : function (){return '__proto__ setter'}
});


console.log(obj.__proto__); //[object Object]
console.log(obj.__proto__ = {}); //[object Object]


I didn't find an engine which outputs the values in get and set. The idea
behind my code is to reject the `__proto__` ability to change the internal
[[Prototype]].

Is the above behavior should be observed according ECMAScript 6?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121026/197fb974/attachment.html>


More information about the es-discuss mailing list