Skip to content

Commit

Permalink
Fix JsonFormat.decode() to return an immutable Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gene Gleyzer committed Nov 4, 2024
1 parent 30c059e commit 576f284
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib_convert/src/main/x/convert/formats/JsonFormat.x
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 576f284

Please sign in to comment.