Merge pull request #1008 from eleumik/eleumik-patch-1007-array

Update JSONArray.java for #1007
This commit is contained in:
Sean Leary
2025-09-18 20:12:55 -05:00
committed by GitHub

View File

@@ -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();