Closed Bug 878380 Opened 12 years ago Closed 12 years ago

JSON.stringify does not properly serialize performance.timing.

Categories

(Core :: DOM: Core & HTML, defect)

21 Branch
x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 760851

People

(Reporter: andrew.hodge, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release) Build ID: 20130511120803 Steps to reproduce: In console, execute JSON.stringify(performance.timing); Compare against performance.timing. Test against existing (Chrome and IE8+) results. Actual results: Returned "{}" Expected results: Should have returned serialized object.
https://bugzilla.mozilla.org/show_bug.cgi?id=727392 was a similar bug but unsure if this falls in the same vein.
The behavior is correct per spec. JSON.stringify only looks at own properties, but all the properties here are on PerformanceTiming.prototype. Chrome violates the spec by putting the properties on the object itself. IE violates the spec by adding a toJSON method on the object, last I checked, which is not in the spec but affects the behavior of JSON.stringify... See bug 760851 for details.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.