fix: wrong arguments when compilling function bodies

This commit is contained in:
TopchetoEU 2024-09-05 13:03:49 +03:00
parent b6a90b108b
commit e509edc459
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ public class FunctionStatementNode extends FunctionNode {
}
@Override public void compile(CompileResult target, boolean pollute, String name, BreakpointType bp) {
var id = target.addChild(compileBody(target, false, name, null));
var id = target.addChild(compileBody(target, true, name, null));
target.add(_i -> Instruction.loadFunc(id, true, true, false, name, captures(id, target)));
target.add(VariableNode.toSet(target, end, this.name, pollute, true));
}

View File

@ -10,7 +10,7 @@ public class FunctionValueNode extends FunctionNode {
@Override public String name() { return name; }
@Override public void compile(CompileResult target, boolean pollute, String name, BreakpointType bp) {
var id = target.addChild(compileBody(target, false, name, null));
var id = target.addChild(compileBody(target, true, name, null));
target.add(_i -> Instruction.loadFunc(id, true, true, false, name, captures(id, target)));
}