Status: New
Owner: ----

New issue 1310 by [email protected]: Object.getOwnPropertyDescriptor/defineProperty should work on __proto__
http://code.google.com/p/v8/issues/detail?id=1310


var a = {};
var d = Object.getOwnPropertyDescriptor(a, "__proto__");
d.writable = false;
Object.defineProperty(a, "__proto__", d);

JSON.stringify(Object.getOwnPropertyDescriptor(a, "__proto__"));

On FF4:

"{"value":{},"writable":false,"enumerable":false,"configurable":false}"

On V8, getOwnPropertyDescriptor(o, "__proto__") returns undefined.


Interestingly, FF4 also allows setting __proto__ to be an accessor rather than a property:

var a = {};
//var d = Object.getOwnPropertyDescriptor(a, "__proto__");
//d.writable = false;
d = { get: function() { return { m: 42 }; } };
Object.defineProperty(a, "__proto__", d);
JSON.stringify(Object.getOwnPropertyDescriptor(a, "__proto__"));
a.m;    // undefined
a.__proto__.m;    // 42
Object.getPrototypeOf(a).m;   // undefined



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to