1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Core: Fix JSON.{from,to}_native() issues

This commit is contained in:
Danil Alexeev
2024-11-27 18:15:49 +03:00
parent bbc54692c0
commit bd1a35ce9e
15 changed files with 1237 additions and 874 deletions

View File

@@ -473,10 +473,11 @@ Error Expression::_get_token(Token &r_token) {
} else if (id == "self") {
r_token.type = TK_SELF;
} else {
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
if (id == Variant::get_type_name(Variant::Type(i))) {
{
const Variant::Type type = Variant::get_type_by_name(id);
if (type < Variant::VARIANT_MAX) {
r_token.type = TK_BASIC_TYPE;
r_token.value = i;
r_token.value = type;
return OK;
}
}