Closed
Bug 920125
Opened 11 years ago
Closed 11 years ago
Object.keys/Object.getOwnPropertyDescriptor doesn't work on xrays for WebIDL interface or prototype objects (return an empty array/undefined respectively)
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: asaf, Assigned: bzbarsky)
Details
Attachments
(1 file)
In a xrays-enabled sandbox: Object.keys(CSS2Properties.prototype) returns an empty array whilst Object.keys(CSS2Properties.prototype.wrappedJSObject) returns the full list of css properties, as expected. Boris found out that: 1. getOwnPropertyNames (which also returns non-enumerable properties) does work. 2. Object.getOwnPropertyDescriptor does not work for xrays (returns undefined), and that this may be the root cause for the bug. Not that I pretend to know the code, but my gut feeling is that the underlying bug here is bug 787013.
Comment 1•11 years ago
|
||
(In reply to Mano from comment #0) > In a xrays-enabled sandbox: > > Object.keys(CSS2Properties.prototype) returns an empty array > > whilst > > Object.keys(CSS2Properties.prototype.wrappedJSObject) returns the full list > of css properties, as expected. > > Boris found out that: > 1. getOwnPropertyNames (which also returns non-enumerable properties) does > work. If that's the case, we're probably just mis-labeling these things as non-enumerable.
Reporter | ||
Comment 2•11 years ago
|
||
Cannot tell because propertyIsEnumerable isn't working due to bug 787013.
Assignee | ||
Comment 3•11 years ago
|
||
> If that's the case, we're probably just mis-labeling these things as non-enumerable.
No, it's because getOwnPropertyDescriptor is busted. For example, Object.getOwnPropertyDescriptor(CSS2Properties.prototype, "display") returns undefined, which is totally wrong.
Assignee: nobody → bzbarsky
Summary: Object.keys doesn't work on xrays (return an empty array) / Object.getOwnPropertyDescriptor → Object.keys/Object.getOwnPropertyDescriptor doesn't work on xrays for WebIDL interface or prototype objects (return an empty array/undefined respectively)
Whiteboard: [need review]
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #809303 -
Flags: review?(peterv)
Updated•11 years ago
|
Attachment #809303 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 5•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/baa9a774aad1
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla27
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/acfa7e48b7f2 to be able to back out bug 905493
Assignee | ||
Comment 7•11 years ago
|
||
Relanded: https://hg.mozilla.org/integration/mozilla-inbound/rev/4f5b6468e00d
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4f5b6468e00d
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•