Return error for string literal beginning with single quote (#2964)

In order for a string literal to be valid in JSON, the value must be
surrounded by double quotes.
This commit is contained in:
Matt Meyers authored and GitHub committed 2024-10-06 08:52:56 +09:00
1 parent 1bebd23aad
commit 562d5c5222
2 files changed
+5

No files matched your search

+3
View File
@@ -2187,6 +2187,9 @@ try ["ok", setpath([1]; 1)] catch ["ko", .]
{"hi":"hello"}
["ko","Cannot index object with number"]
try fromjson catch .
"{'a': 123}"
"Invalid string literal; expected \", but got ' at line 1, column 5 (while parsing '{'a': 123}')"
# ltrimstr/1 rtrimstr/1 don't leak on invalid input #2977