Sfoglia il codice sorgente

Add missing characters for property name quoting

(cherry picked from commit 367d75fab0ba0e8f6bc76da1ef182fc342c4fa0d)
Haoyu Qiu 3 anni fa
parent
commit
f83b17e4eb
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      core/ustring.cpp

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