feat(#871-strictMode): improved validation, strict mode for quotes implementation

This commit is contained in:
rikkarth
2024-03-15 22:28:31 +00:00
parent c140e91bb8
commit e67abb3842
4 changed files with 956 additions and 1087 deletions

View File

@@ -109,7 +109,11 @@ public class JSONArray implements Iterable<Object> {
this.myArrayList.add(JSONObject.NULL);
} else {
x.back();
this.myArrayList.add(x.nextValue());
if (jsonParserConfiguration.isStrictMode()) {
this.myArrayList.add(x.nextValue(true));
} else {
this.myArrayList.add(x.nextValue());
}
}
switch (x.nextClean()) {
case 0:
@@ -1693,7 +1697,8 @@ public class JSONArray implements Iterable<Object> {
* @throws JSONException If not an array or if an array value is non-finite number.
* @throws NullPointerException Thrown if the array parameter is null.
*/
private void addAll(Object array, boolean wrap, int recursionDepth, JSONParserConfiguration jsonParserConfiguration)
private void addAll(Object array, boolean wrap, int recursionDepth, JSONParserConfiguration
jsonParserConfiguration)
throws JSONException {
if (array.getClass().isArray()) {
int length = Array.getLength(array);