ammend to prev commit
This commit is contained in:
parent
2a5f6aa9aa
commit
f929015f55
@ -18,13 +18,13 @@ public class ArrayNode extends Node {
|
||||
@Override public void compile(CompileResult target, boolean pollute) {
|
||||
target.add(Instruction.loadArr(statements.length));
|
||||
|
||||
if (statements.length > 0) target.add(Instruction.dup(statements.length));
|
||||
|
||||
for (var i = 0; i < statements.length; i++) {
|
||||
var el = statements[i];
|
||||
if (el != null) {
|
||||
target.add(Instruction.dup());
|
||||
target.add(Instruction.pushValue(i));
|
||||
el.compile(target, true);
|
||||
target.add(Instruction.storeMember());
|
||||
target.add(Instruction.storeMember(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,10 +39,9 @@ public class ObjectNode extends Node {
|
||||
|
||||
for (var el : map.entrySet()) {
|
||||
target.add(Instruction.dup());
|
||||
target.add(Instruction.pushValue(el.getKey()));
|
||||
var val = el.getValue();
|
||||
FunctionNode.compileWithName(val, target, true, el.getKey().toString());
|
||||
target.add(Instruction.storeMember());
|
||||
target.add(Instruction.storeMember(el.getKey()));
|
||||
}
|
||||
|
||||
var keys = new ArrayList<Object>();
|
||||
|
Loading…
Reference in New Issue
Block a user