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:
Éamonn McManus
2023-09-27 12:42:04 -07:00
parent 661114c50d
commit 16967f322e
2 changed files with 2 additions and 6 deletions

View File

@@ -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.");
}
/*