This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 226991 - Malformed JSON not detected in Editor
Summary: Malformed JSON not detected in Editor
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: JSON (show other bugs)
Version: 7.3
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-04 17:47 UTC by Shodan
Modified: 2013-07-11 10:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Malformed example of escaped single quotes (75 bytes, application/octet-stream)
2013-03-04 17:51 UTC, Shodan
Details
Malformed example of trailing comma (35 bytes, application/octet-stream)
2013-03-04 17:52 UTC, Shodan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shodan 2013-03-04 17:47:31 UTC
The following two malformed JSON literals are not detected as bad JSON:

1.

{
    "valueName": "The Value!",
    "valName2": "\'The quoted Value\'"
}

The single quotes must not be escaped! Netbeans does not detect this.

2.

{
    "valueName": "The Value!",
}

The trailing comma is not detected by netbeans either.

Both values produce errors e.g., when loaded into a webpage with ajax. 
Both examples when run through linters like www.jslint.com or jsonlint.com produce errors.
Comment 1 Shodan 2013-03-04 17:51:37 UTC
Created attachment 132160 [details]
Malformed example of escaped single quotes
Comment 2 Shodan 2013-03-04 17:52:12 UTC
Created attachment 132161 [details]
Malformed example of trailing comma
Comment 3 Petr Hejl 2013-07-11 10:43:39 UTC
String fixed in web-main 73cb553323fc. Trailing comma is duplicate of #228224.