forked from ground/ground
Fix calling functions inside functions
This commit is contained in:
@@ -1884,15 +1884,15 @@ Literal exec(vector<Instruction> in, bool executingFunction) {
|
|||||||
variables[arg.ref.varName] = fnArgs[m];
|
variables[arg.ref.varName] = fnArgs[m];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear function arguments for next call
|
||||||
|
fnArgs.clear();
|
||||||
|
|
||||||
// Call the function
|
// Call the function
|
||||||
Literal retVal = exec(functions[ref.fnName].instructions, true);
|
Literal retVal = exec(functions[ref.fnName].instructions, true);
|
||||||
|
|
||||||
// Restore scope
|
// Restore scope
|
||||||
variables = scopeBackup;
|
variables = scopeBackup;
|
||||||
|
|
||||||
// Clear function arguments for next call
|
|
||||||
fnArgs.clear();
|
|
||||||
|
|
||||||
// Now, assign the return value in the current scope.
|
// Now, assign the return value in the current scope.
|
||||||
if (expectList) {
|
if (expectList) {
|
||||||
variables[returnRef] = retVal;
|
variables[returnRef] = retVal;
|
||||||
|
Reference in New Issue
Block a user