mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-10 04:24:31 +08:00
Simplify the check for object keys that are themselves objects.
For object keys, we can just skip the part of `nextValue()` that parses values that are objects or arrays. Then the existing logic for unquoted values will already stop at `{` or `[`, and that will produce a `Missing value` exception.
This commit is contained in:
@@ -428,10 +428,6 @@ public class JSONTokener {
|
||||
case '"':
|
||||
case '\'':
|
||||
return this.nextString(c);
|
||||
case '{':
|
||||
throw syntaxError("Nested object not expected here.");
|
||||
case '[':
|
||||
throw syntaxError("Nested array not expected here.");
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user