Skip to content

Commit

Permalink
fix Yuescript issue. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Mar 19, 2024
1 parent b316fe7 commit 334f749
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Source/3rdParty/yuescript/yue_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3787,11 +3787,6 @@ class YueCompilerImpl {
}

void transformNilCoalesedExp(Exp_t* exp, str_list& out, ExpUsage usage, ExpList_t* assignList = nullptr, bool nilBranchOnly = false) {
if (usage == ExpUsage::Closure) {
if (transformAsUpValueFunc(exp, out)) {
return;
}
}
auto x = exp;
str_list temp;
auto left = exp->new_ptr<Exp_t>();
Expand All @@ -3814,6 +3809,12 @@ class YueCompilerImpl {
}
std::string* funcStart = nullptr;
if (usage == ExpUsage::Closure) {
left->nilCoalesed.set(exp->nilCoalesed);
if (transformAsUpValueFunc(left, temp)) {
out.push_back(join(temp));
return;
}
left->nilCoalesed.set(nullptr);
pushAnonFunctionScope();
pushAnonVarArg();
funcStart = &temp.emplace_back();
Expand Down

0 comments on commit 334f749

Please sign in to comment.