Status: Accepted
Owner: [email protected]
Labels: Type-Bug Priority-Medium ES5

New issue 712 by [email protected]: Object.defineProperty allows overriding an accessor with an empty descriptor
http://code.google.com/p/v8/issues/detail?id=712

When Object.defineProperty is called on an existing non configurable
accessor this accessor will be overridden if the given descriptor is empty
({})

This script will reproduce the issue:
var o = {};
Object.defineProperty(o, 'x', { get: function() { return '42'; },
      configurable: false });
print(o.x);
Object.defineProperty(o, 'x', {});
print(o.x);

Expected output:
42
TypeError: Cannot redefine property

Actual output
42
undefined


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

Reply via email to