Fix calling functions inside functions

This commit is contained in:
2025-08-30 13:39:51 +10:00
parent d8cc3ff9e0
commit 06ed44a010

View File

@@ -1883,15 +1883,15 @@ Literal exec(vector<Instruction> in, bool executingFunction) {
// Create the variable
variables[arg.ref.varName] = fnArgs[m];
}
// Clear function arguments for next call
fnArgs.clear();
// Call the function
Literal retVal = exec(functions[ref.fnName].instructions, true);
// Restore scope
variables = scopeBackup;
// Clear function arguments for next call
fnArgs.clear();
// Now, assign the return value in the current scope.
if (expectList) {