From 78d233a6bdd4b104dc1b8372dfd9c356054c31a9 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:39:11 +0300 Subject: [PATCH] refactor: remove ArgumentsNode --- .../compilation/values/ArgumentsNode.java | 17 ----------------- .../compilation/values/operations/CallNode.java | 10 ---------- 2 files changed, 27 deletions(-) delete mode 100644 src/java/me/topchetoeu/jscript/compilation/values/ArgumentsNode.java diff --git a/src/java/me/topchetoeu/jscript/compilation/values/ArgumentsNode.java b/src/java/me/topchetoeu/jscript/compilation/values/ArgumentsNode.java deleted file mode 100644 index 104340f..0000000 --- a/src/java/me/topchetoeu/jscript/compilation/values/ArgumentsNode.java +++ /dev/null @@ -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); - } -} diff --git a/src/java/me/topchetoeu/jscript/compilation/values/operations/CallNode.java b/src/java/me/topchetoeu/jscript/compilation/values/operations/CallNode.java index bdd3b74..91dbc78 100644 --- a/src/java/me/topchetoeu/jscript/compilation/values/operations/CallNode.java +++ b/src/java/me/topchetoeu/jscript/compilation/values/operations/CallNode.java @@ -13,7 +13,6 @@ import me.topchetoeu.jscript.common.parsing.Source; import me.topchetoeu.jscript.compilation.CompileResult; import me.topchetoeu.jscript.compilation.JavaScript; 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.ObjectNode; import me.topchetoeu.jscript.compilation.values.ThisNode; @@ -56,15 +55,6 @@ public class CallNode extends Node { else if (func instanceof ThisNode) { 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) { var els = new ArrayList();