mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Fix error when calling coroutine with await in _ready
The code paths for calling async functions seemed to be missing in some cases, causing a debug break and false positive error.
This commit is contained in:
parent
68117f5e75
commit
2e4ee06b7a
4 changed files with 23 additions and 2 deletions
|
@ -494,9 +494,17 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
|
|||
} else if ((codegen.function_node && codegen.function_node->is_static) || call->function_name == "new") {
|
||||
GDScriptCodeGenerator::Address self;
|
||||
self.mode = GDScriptCodeGenerator::Address::CLASS;
|
||||
gen->write_call(result, self, call->function_name, arguments);
|
||||
if (within_await) {
|
||||
gen->write_call_async(result, self, call->function_name, arguments);
|
||||
} else {
|
||||
gen->write_call(result, self, call->function_name, arguments);
|
||||
}
|
||||
} else {
|
||||
gen->write_call_self(result, call->function_name, arguments);
|
||||
if (within_await) {
|
||||
gen->write_call_self_async(result, call->function_name, arguments);
|
||||
} else {
|
||||
gen->write_call_self(result, call->function_name, arguments);
|
||||
}
|
||||
}
|
||||
} else if (callee->type == GDScriptParser::Node::SUBSCRIPT) {
|
||||
const GDScriptParser::SubscriptNode *subscript = static_cast<const GDScriptParser::SubscriptNode *>(call->callee);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue