Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9196 closed enhancement (invalid)

parseJSON

Reported by: anonymous Owned by:
Priority: undecided Milestone: 1.next
Component: data Version: 1.6
Keywords: Cc:
Blocked by: Blocking:

Description

If you have a jsonString like that {0 : "zero", 1 : "one"} the native parser failed (Firefox 3.6.13) but the json2.js parser gave a clean result.

Isn't it better to check ifs a valid jsonString before use the native parser?

Change History (2)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfileddata
Resolution: invalid
Status: newclosed

your example isn't valid json and at the end of the day, json2 doesn't matter - the browser implementation does.

comment:2 Changed 12 years ago by anonymous

Then it's also useless to throw an "Invalid JSON" error at the end if it's insignificant for the parsers that the function get a valid JSON string...

Note: See TracTickets for help on using tickets.