fix(compiler): do not consider arguments when determining recursion
The static reflectory check for macro function recursion was too agressive and disallowed calling a function with argument that also calls the same function. For example, it disallowed nested animation groups. Fixes: #17467
This commit is contained in:

committed by
Alex Rickabaugh

parent
cc2a4c41f9
commit
e64b54b67b
@ -376,7 +376,6 @@ export class StaticReflector implements CompileReflector {
|
||||
if (calling.get(functionSymbol)) {
|
||||
throw new Error('Recursion not supported');
|
||||
}
|
||||
calling.set(functionSymbol, true);
|
||||
try {
|
||||
const value = targetFunction['value'];
|
||||
if (value && (depth != 0 || value.__symbolic != 'error')) {
|
||||
@ -387,6 +386,7 @@ export class StaticReflector implements CompileReflector {
|
||||
if (defaults && defaults.length > args.length) {
|
||||
args.push(...defaults.slice(args.length).map((value: any) => simplify(value)));
|
||||
}
|
||||
calling.set(functionSymbol, true);
|
||||
const functionScope = BindingScope.build();
|
||||
for (let i = 0; i < parameters.length; i++) {
|
||||
functionScope.define(parameters[i], args[i]);
|
||||
|
Reference in New Issue
Block a user