Skip to content

Commit 597e6fe

Browse files
committed
Refactor LocalVariableDefinedNode
1 parent 0740836 commit 597e6fe

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

src/main/java/org/truffleruby/core/binding/BindingNodes.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -213,22 +213,10 @@ protected int getCacheLimit() {
213213
}
214214

215215
@ImportStatic({ BindingNodes.class, FindDeclarationVariableNodes.class })
216-
@GenerateUncached
217-
@GenerateNodeFactory
218216
@CoreMethod(names = "local_variable_defined?", required = 1)
219217
@NodeChild(value = "bindingNode", type = RubyNode.class)
220218
@NodeChild(value = "nameNode", type = RubyBaseNodeWithExecute.class)
221-
public abstract static class LocalVariableDefinedNode extends RubySourceNode {
222-
223-
public static LocalVariableDefinedNode create(RubyNode bindingNode, RubyBaseNodeWithExecute nameNode) {
224-
return BindingNodesFactory.LocalVariableDefinedNodeFactory.create(bindingNode, nameNode);
225-
}
226-
227-
public abstract boolean execute(RubyBinding binding, String name);
228-
229-
abstract RubyNode getBindingNode();
230-
231-
abstract RubyBaseNodeWithExecute getNameNode();
219+
public abstract static class LocalVariableDefinedNode extends CoreMethodNode {
232220

233221
@CreateCast("nameNode")
234222
protected RubyBaseNodeWithExecute coerceToString(RubyBaseNodeWithExecute name) {
@@ -265,18 +253,6 @@ protected Object localVariableDefinedLastLine(RubyBinding binding, String name)
265253
protected int getCacheLimit() {
266254
return getLanguage().options.BINDING_LOCAL_VARIABLE_CACHE;
267255
}
268-
269-
private RubyBaseNodeWithExecute getNameNodeBeforeCasting() {
270-
return ((NameToJavaStringNode) getNameNode()).getValueNode();
271-
}
272-
273-
@Override
274-
public RubyNode cloneUninitialized() {
275-
return create(
276-
getBindingNode().cloneUninitialized(),
277-
getNameNodeBeforeCasting().cloneUninitialized()).copyFlags(this);
278-
}
279-
280256
}
281257

282258
@CoreMethod(names = "local_variable_get", required = 1)

0 commit comments

Comments
 (0)