Browse Source

Add missing characters for property name quoting

Haoyu Qiu 3 years ago
parent
commit
367d75fab0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/string/ustring.cpp

+ 1 - 1
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() + "\"";
 		}
 	}