Status: New
Owner: ----

New issue 968 by [email protected]: Object.defineProperty doesn't preserve the property value if a value-property is omitted.
http://code.google.com/p/v8/issues/detail?id=968

var o = { x : 42 };
Object.defineProperty(o, "x", { writable: false });
print(x.x);  // Should be 42, is undefined.

According to the specification, if the [[Value]] property on the property descriptor isn't included (and it isn't if there is no "value" property on the object passed to ToPropertyDescriptor), the current value should not be changed.

See also discussion on es5-discuss:
 https://mail.mozilla.org/pipermail/es5-discuss/2010-December/003842.html


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

Reply via email to