mirror of
https://github.com/stleary/JSON-java.git
synced 2025-10-01 14:25:55 -04:00
Update JSONArray.java for #1007
fix array content starting with ',' in strict mode
This commit is contained in:
parent
9b8eefc2de
commit
9de3005566
@ -105,6 +105,8 @@ public class JSONArray implements Iterable<Object> {
|
|||||||
if (nextChar == 0) {
|
if (nextChar == 0) {
|
||||||
// array is unclosed. No ']' found, instead EOF
|
// array is unclosed. No ']' found, instead EOF
|
||||||
throw x.syntaxError("Expected a ',' or ']'");
|
throw x.syntaxError("Expected a ',' or ']'");
|
||||||
|
} else if (nextChar==',' && jsonParserConfiguration.isStrictMode()) {
|
||||||
|
throw x.syntaxError("Array content starts with a ','");
|
||||||
}
|
}
|
||||||
if (nextChar != ']') {
|
if (nextChar != ']') {
|
||||||
x.back();
|
x.back();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user