Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 13c142a1781c
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d3e134ce2236
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Sep 17, 2014

  1. Remove unnecessary cast.

    headius committed Sep 17, 2014
    Copy the full SHA
    241358b View commit details
  2. Copy the full SHA
    d3e134c View commit details
4 changes: 1 addition & 3 deletions core/src/main/java/org/jruby/RubyProc.java
Original file line number Diff line number Diff line change
@@ -152,9 +152,7 @@ private void setup(Block procBlock) {

// modify the block with a new backref/lastline-grabbing scope
StaticScope oldScope = block.getBody().getStaticScope();
StaticScope newScope = getRuntime().getStaticScopeFactory().newBlockScope(oldScope.getEnclosingScope(), oldScope.getVariables());
newScope.setPreviousCRefScope(oldScope.getPreviousCRefScope());
newScope.setModule(oldScope.getModule());
StaticScope newScope = oldScope.duplicate();
block.getBody().setStaticScope(newScope);
} else {
// just use as is
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ public static IRubyObject handleNonlocalReturn(StaticScope scope, DynamicScope d
IRReturnJump rj = (IRReturnJump)rjExc;

// - If we are in a lambda or if we are in the method scope we are supposed to return from, stop propagating
if (inNonMethodBodyLambda((StaticScope)scope, blockType) || (rj.methodToReturnFrom == dynScope)) {
if (inNonMethodBodyLambda(scope, blockType) || (rj.methodToReturnFrom == dynScope)) {
if (isDebug()) System.out.println("---> Non-local Return reached target in scope: " + dynScope);
return (IRubyObject) rj.returnValue;
}
10 changes: 10 additions & 0 deletions core/src/main/java/org/jruby/parser/StaticScope.java
Original file line number Diff line number Diff line change
@@ -556,4 +556,14 @@ public String toString() {
public Type getType() {
return type;
}

public StaticScope duplicate() {
StaticScope dupe = new StaticScope(type, enclosingScope, variableNames == null ? NO_NAMES : variableNames);
dupe.setIRScope(irScope);
dupe.setScopeType(scopeType);
dupe.setPreviousCRefScope(previousCRefScope);
dupe.setModule(cref);

return dupe;
}
}