fix: add location data for LOAD_FUNCs
This commit is contained in:
parent
39eb6ffac5
commit
5c2fd00bfb
@ -19,8 +19,8 @@ public class FunctionStatementNode extends FunctionNode {
|
|||||||
|
|
||||||
@Override public void compile(CompileResult target, boolean pollute, String name, BreakpointType bp) {
|
@Override public void compile(CompileResult target, boolean pollute, String name, BreakpointType bp) {
|
||||||
var id = target.addChild(compileBody(target, name, null));
|
var id = target.addChild(compileBody(target, name, null));
|
||||||
target.add(Instruction.loadFunc(id, name, captures(id, target)));
|
target.add(Instruction.loadFunc(id, name, captures(id, target))).setLocation(loc());;
|
||||||
target.add(VariableNode.toInit(target, end, this.name));
|
target.add(VariableNode.toSet(target, end, this.name, false, true));
|
||||||
if (pollute) target.add(Instruction.pushUndefined());
|
if (pollute) target.add(Instruction.pushUndefined());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ public class FunctionValueNode extends FunctionNode {
|
|||||||
|
|
||||||
@Override public void compile(CompileResult target, boolean pollute, String name, BreakpointType bp) {
|
@Override public void compile(CompileResult target, boolean pollute, String name, BreakpointType bp) {
|
||||||
var id = target.addChild(compileBody(target, name, name));
|
var id = target.addChild(compileBody(target, name, name));
|
||||||
target.add(Instruction.loadFunc(id, name, captures(id, target)));
|
target.add(Instruction.loadFunc(id, name, captures(id, target))).setLocation(loc());
|
||||||
}
|
}
|
||||||
|
|
||||||
public FunctionValueNode(Location loc, Location end, List<VariableNode> params, CompoundNode body, String name) {
|
public FunctionValueNode(Location loc, Location end, List<VariableNode> params, CompoundNode body, String name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user