Closed
Bug 493586
Opened 16 years ago
Closed 16 years ago
JSON.parse's replacer function can't return undefined
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: zeniko, Assigned: sayrer)
References
()
Details
(Keywords: fixed1.9.1, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
4.32 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
Returning undefined is supposed to be used for filtering out specific keys.
Filtering out the "key" key from { key: value } correctly results in "{}" in IE8 but the invalid "{key:}" in Shiretoko (stringify can thus return a string which parse can't handle).
Flags: blocking1.9.1?
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Assignee | ||
Updated•16 years ago
|
Assignee: general → sayrer
Assignee | ||
Comment 1•16 years ago
|
||
ugh, embarassing. patch soon.
Assignee | ||
Comment 2•16 years ago
|
||
insidious. source-line test coverage metrics wouldn't catch this.
Attachment #378132 -
Flags: review?(brendan)
Updated•16 years ago
|
Attachment #378132 -
Flags: review?(brendan) → review+
Comment 3•16 years ago
|
||
Comment on attachment 378132 [details] [diff] [review]
fix
So JO and Str are from ES5 draft, but life's simpler there it seems.
>+static JSBool CallReplacerFunction(JSContext *cx, jsid id, JSObject *holder,
>+ StringifyContext *scx, jsval *vp);
>+static JSBool Str(JSContext *cx, jsid id, JSObject *holder,
>+ StringifyContext *scx, jsval *vp, bool callReplacer=true);
Space on both sides of = in house style.
r=me with that, thanks.
/be
Assignee | ||
Comment 4•16 years ago
|
||
(In reply to comment #3)
> (From update of attachment 378132 [details] [diff] [review])
> So JO and Str are from ES5 draft, but life's simpler there it seems.
The spec is written as if implemented in JS. Everything buffers output, rather than streaming when ready.
Assignee | ||
Comment 5•16 years ago
|
||
pushed with correct spacing
http://hg.mozilla.org/tracemonkey/rev/29ed571daf38
Keywords: 4xp
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Comment 6•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•16 years ago
|
||
Keywords: fixed1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•