From 367d75fab0ba0e8f6bc76da1ef182fc342c4fa0d Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 11 Nov 2021 13:18:09 +0800 Subject: Add missing characters for property name quoting --- core/string/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/string/ustring.cpp') 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() + "\""; } } -- cgit v1.2.3 From 2beaae4b6f1c4a2c3833a5e205157fd3be2fcabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 11 Nov 2021 09:08:08 +0100 Subject: String: Remove `erase` method, bindings can't mutate String --- core/string/ustring.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'core/string/ustring.cpp') diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 25c21486d6..4798cab641 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -952,10 +952,6 @@ const char32_t *String::get_data() const { return size() ? &operator[](0) : &zero; } -void String::erase(int p_pos, int p_chars) { - *this = left(MAX(p_pos, 0)) + substr(p_pos + p_chars, length() - ((p_pos + p_chars))); -} - String String::capitalize() const { String aux = this->camelcase_to_underscore(true).replace("_", " ").strip_edges(); String cap; -- cgit v1.2.3