refactor: remove ArgumentsNode

This commit is contained in:
TopchetoEU 2024-09-04 10:39:11 +03:00
parent 3f25868f19
commit 78d233a6bd
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
2 changed files with 0 additions and 27 deletions

View File

@ -1,17 +0,0 @@
package me.topchetoeu.jscript.compilation.values;
import me.topchetoeu.jscript.common.Instruction;
import me.topchetoeu.jscript.common.parsing.Location;
import me.topchetoeu.jscript.compilation.CompileResult;
import me.topchetoeu.jscript.compilation.Node;
public class ArgumentsNode extends Node {
@Override public void compile(CompileResult target, boolean pollute) {
if (pollute) target.add(Instruction.loadArgs());
}
public ArgumentsNode(Location loc) {
super(loc);
}
}

View File

@ -13,7 +13,6 @@ import me.topchetoeu.jscript.common.parsing.Source;
import me.topchetoeu.jscript.compilation.CompileResult; import me.topchetoeu.jscript.compilation.CompileResult;
import me.topchetoeu.jscript.compilation.JavaScript; import me.topchetoeu.jscript.compilation.JavaScript;
import me.topchetoeu.jscript.compilation.Node; import me.topchetoeu.jscript.compilation.Node;
import me.topchetoeu.jscript.compilation.values.ArgumentsNode;
import me.topchetoeu.jscript.compilation.values.ArrayNode; import me.topchetoeu.jscript.compilation.values.ArrayNode;
import me.topchetoeu.jscript.compilation.values.ObjectNode; import me.topchetoeu.jscript.compilation.values.ObjectNode;
import me.topchetoeu.jscript.compilation.values.ThisNode; import me.topchetoeu.jscript.compilation.values.ThisNode;
@ -56,15 +55,6 @@ public class CallNode extends Node {
else if (func instanceof ThisNode) { else if (func instanceof ThisNode) {
res = "this"; res = "this";
} }
else if (func instanceof ArgumentsNode) {
res = "arguments";
}
// else if (func instanceof VariableIndexNode) {
// var i = ((VariableIndexNode)func).index;
// if (i == 0) res = "this";
// else if (i == 1) res = "arguments";
// }
else if (func instanceof ArrayNode) { else if (func instanceof ArrayNode) {
var els = new ArrayList<String>(); var els = new ArrayList<String>();