Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/jruby/parser/StaticScope.java
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ public class StaticScope implements Serializable {
// Next CRef down the lexical structure
private StaticScope previousCRefScope = null;

// Our name holder (offsets are assigned as variables are added
// Our name holder (offsets are assigned as variables are added)
private String[] variableNames;

// Arity of this scope if there is one
@@ -235,6 +235,7 @@ public int getNumberOfVariables() {

public void setVariables(String[] names) {
assert names != null : "names is not null";
assert namesAreInterned(names);

variableNames = new String[names.length];
System.arraycopy(names, 0, variableNames, 0, names.length);
@@ -501,6 +502,7 @@ public long getCommandArgumentStack() {
}

private void growVariableNames(String name) {
assert name == name.intern();
String[] newVariableNames = new String[variableNames.length + 1];
System.arraycopy(variableNames, 0, newVariableNames, 0, variableNames.length);
variableNames = newVariableNames;

0 comments on commit fc23b56

Please sign in to comment.