Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
duplicating staticscopes can happen before irscope has been set
  • Loading branch information
enebo committed Oct 16, 2014
1 parent 3388591 commit 511e875
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
Expand Up @@ -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);
Expand Down

0 comments on commit 511e875

Please sign in to comment.