Closed Bug 533139 Opened 15 years ago Closed 12 years ago

JSON.stringify(window.navigator) doesn't follow the spec

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: oliver, Unassigned)

Details

Attachments

(1 file)

I noticed a bug in mozilla while working on a webkit bug, JSON stringification of the navigator object doesn't match the spec.

JSON.stringify(window.navigator) produces '{}'

Technically it should throw an exception due to the Plugin->MimeType->Plugin cycle, but even if that was prevented the navigator object has string properties, etc which should appear in the output.

Honestly I have no idea what's actually being done here -- is navigator being special cased? or is their a general idiom mozilla applies to serialising dom objects?
Attached file Testcase
What's happening here is that the properties of Mozilla's window.navigator are from the prototype and so they are excluded. It's basically what's happening in the attached test case. I'm not sure if any spec defines from whence navigator's properties should come.
I guess the attachment title "Testcase" is a bit deceiving in this case...
This is a WebKit bug.
Assignee: general → nobody
Status: NEW → RESOLVED
Closed: 12 years ago
Component: JavaScript Engine → DOM
QA Contact: general → general
Resolution: --- → INVALID
> I'm not sure if any spec defines from whence navigator's properties should come.

At this point, WebIDL does, and they come from the prototype.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: