From 367d75fab0ba0e8f6bc76da1ef182fc342c4fa0d 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 --- core/string/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 8d6da31cf3..25c21486d6 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -4420,7 +4420,7 @@ String String::property_name_encode() const { // as well as '"', '=' or ' ' (32) const char32_t *cstr = get_data(); 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() + "\""; } }