#6147 closed bug (invalid)
jQuery.parseJSON('{"name":NaN}'); handle failed
Reported by: | xianke2009 | Owned by: | |
---|---|---|---|
Priority: | Milestone: | 1.4.2 | |
Component: | core | Version: | 1.4.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
var obj = jQuery.parseJSON('{"name":NaN}'); var obj = jQuery.parseJSON('{"name":Infinity}'); var obj = jQuery.parseJSON('{"name":-Infinity}');
Change History (3)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Component: | unfiled → core |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:3 Changed 11 years ago by
Why is it invalid JSON? The following statement is true:
typeof Infinity === "number"
So it adheres to the specification in my Eyes. By the way: JSON-Strings with Infinity and NaN *can* be converted to objects via eval().
Note: See
TracTickets for help on using
tickets.
Infinity and NaN aren't valid JSON, see http://www.json.org/. Unfortunately there isn't a way to specify those values in JSON.