Skip to content

Commit 34801cc

Browse files
committed
Add a comment explaining the rationale for 2 specializations in Kernel#eval
1 parent 4e5dd65 commit 34801cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/truffleruby/core/kernel/KernelNodes.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,10 @@ public RubyRootNode getRootNode() {
571571
}
572572
}
573573

574-
public abstract Object execute(VirtualFrame frame, Object self, DynamicObject str, DynamicObject binding, DynamicObject file, int line);
574+
public abstract Object execute(VirtualFrame frame, Object self, DynamicObject source, DynamicObject binding, DynamicObject file, int line);
575+
576+
// If the source defines new local variables, those should be set in the Binding.
577+
// So we have 2 specializations for whether or not the code defines new local variables.
575578

576579
@Specialization(guards = {
577580
"equalNode.execute(rope(source), cachedSource)",

0 commit comments

Comments
 (0)