From 74118e322903db36189b6b5003c6bdb57847bcf3 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Mon, 4 Jul 2022 02:45:56 +0700 Subject: [PATCH] Fix JSON API parsing subitems as old collections When parsing values inside JSON object/array, stored objects and arrays would always be parsed as `DynamicArray`/`AssociativeArray`, despite starting parsing as new collections. --- sources/Text/JSON/JSONAPI.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/Text/JSON/JSONAPI.uc b/sources/Text/JSON/JSONAPI.uc index 0556503..b8815c9 100644 --- a/sources/Text/JSON/JSONAPI.uc +++ b/sources/Text/JSON/JSONAPI.uc @@ -724,7 +724,7 @@ public final function ArrayList ParseArrayListWith( confirmedState = parser.GetCurrentState(); } // Parse next value - nextValue = ParseWith(parser, parseAsMutable); + nextValue = ParseWith(parser, parseAsMutable, true); parsedValues[parsedValues.length] = nextValue; if (!parser.Ok()) { break; @@ -914,7 +914,7 @@ private function HashTable.Entry ParseHashTableProperty( local HashTable.Entry entry; parser.MStringLiteral(nextKey).Skip().Match(T(default.TCOLON)).Skip(); entry.key = nextKey.IntoText(); - entry.value = ParseWith(parser, parseAsMutable); + entry.value = ParseWith(parser, parseAsMutable, true); return entry; }