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
@@ -559,7 +559,9 @@ public Type getType() {

public StaticScope duplicate() {
StaticScope dupe = new StaticScope(type, enclosingScope, variableNames == null ? NO_NAMES : variableNames);
dupe.setIRScope(irScope);
// irScope is not guaranteed to be set onto StaticScope until it is executed for the first time.
// We can call duplicate before its first execution.
if (irScope != null) dupe.setIRScope(irScope);
dupe.setScopeType(scopeType);
dupe.setPreviousCRefScope(previousCRefScope);
dupe.setModule(cref);

0 comments on commit 511e875

Please sign in to comment.