Closed Bug 769173 Opened 12 years ago Closed 12 years ago

JSON.stringify(window.performance.timing) results in "{}"

Categories

(Core :: JavaScript Engine, defect)

13 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 760851

People

(Reporter: cobexer, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0 Build ID: 20120624012213 Steps to reproduce: JSON.stringify(window.performance.timing) => "{}"; also Object.keys(window.performance.timing) results in [], although using a for ... in loop enumerates all keys of that object properly. Actual results: "{}" Expected results: I expected a JSON string that properly serialized all properties of the window.performance.timing Object.
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
QA Contact: untriaged → general
This is the behavior the spec requires right now, though there is talk of changing that. In particuar, JSON.stringify only looks at an object's own properties, while for...in looks at the prototype. And per spec all the relevant properties live on the prototype.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.