JSON replacer does not behave to specification - serializes key, not return value

RESOLVED DUPLICATE of bug 509184

Status

()

Firefox
General
--
major
RESOLVED DUPLICATE of bug 509184
7 years ago
6 years ago

People

(Reporter: Sky Sanders, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6

When supplying a replacer the value returned is ignored and the member is serialized.

Reproducible: Always

Steps to Reproduce:
1. stringify an object with a date property
2. return an arbitrary string from replacer

Actual Results:  
json contains original member value

Expected Results:  
json should contain value returned from replacer
(Reporter)

Comment 1

7 years ago
screen shots of tests on all browsers/platforms are here: 
http://www.browsercam.com/public.aspx?proj_id=508872

sorry, not segregated to FF.

If you see red, it is because the browser has native json and it failed.

So far only FF fails with native JSON.

Comment 2

7 years ago
I can confirm this bug. There is no way to change the value of the property,
but it can be removed from resulting string by returning 'undefined'.
Same bug: https://bugzilla.mozilla.org/show_bug.cgi?id=543507
(Reporter)

Comment 3

7 years ago
What is the point of having a crippled buggy native JSON implementation?

No one thinks this is an issue?
Note that this will be fixed in FF4. 

FF 3.6:       7 tests of 8 passed, 1 failed.
FF 4 nightly: 8 tests of 8 passed, 0 failed.

Updated

7 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 509184
You need to log in before you can comment on or make changes to this bug.