From f83b17e4eb4e544a40b5c2f158809e274b70c777 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 11 Nov 2021 13:18:09 +0800 Subject: [PATCH] Add missing characters for property name quoting (cherry picked from commit 367d75fab0ba0e8f6bc76da1ef182fc342c4fa0d) --- core/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index 02bc0417950..acc5b62f1bb 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -4128,7 +4128,7 @@ String String::property_name_encode() const { // as well as '"', '=' or ' ' (32) const CharType *cstr = c_str(); for (int i = 0; cstr[i]; i++) { - if (cstr[i] == '=' || cstr[i] == '"' || cstr[i] < 33 || cstr[i] > 126) { + if (cstr[i] == '=' || cstr[i] == '"' || cstr[i] == ';' || cstr[i] == '[' || cstr[i] == ']' || cstr[i] < 33 || cstr[i] > 126) { return "\"" + c_escape_multiline() + "\""; } }