From 576f28402cde307a148981f864a8cb551dfdf1e0 Mon Sep 17 00:00:00 2001 From: Gene Gleyzer Date: Mon, 4 Nov 2024 11:05:09 -0500 Subject: [PATCH] Fix JsonFormat.decode() to return an immutable Doc --- lib_convert/src/main/x/convert/formats/JsonFormat.x | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_convert/src/main/x/convert/formats/JsonFormat.x b/lib_convert/src/main/x/convert/formats/JsonFormat.x index c2ea6b6b01..42979f4908 100644 --- a/lib_convert/src/main/x/convert/formats/JsonFormat.x +++ b/lib_convert/src/main/x/convert/formats/JsonFormat.x @@ -28,8 +28,8 @@ const JsonFormat(Printer printer = Printer.DEFAULT) @Override Value decode(String text) { - if (Doc doc := new Parser(new CharArrayReader(text)).next()) { - return doc; + if (Doc doc := new Parser(text.toReader()).next()) { + return doc.makeImmutable(); } else { return Null; }