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: 3a3b7e5a9e98
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ae0495fdc210
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Apr 27, 2018

  1. Copy the full SHA
    f2dab99 View commit details
  2. Copy the full SHA
    ae0495f View commit details
Showing with 6 additions and 4 deletions.
  1. +3 −1 core/src/main/java/org/jruby/ir/IRBuilder.java
  2. +1 −1 spec/compiler/general_spec.rb
  3. +2 −2 test/jruby/test_method.rb
4 changes: 3 additions & 1 deletion core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -3783,7 +3783,9 @@ public InterpreterContext buildEvalRoot(RootNode rootNode) {

public static InterpreterContext buildRoot(IRManager manager, RootNode rootNode) {
// FIXME: This filename should switch to ByteList
IRScriptBody script = new IRScriptBody(manager, manager.runtime.newSymbol(rootNode.getFile()), rootNode.getStaticScope());
String file = rootNode.getFile();
if (file == null) file = "(anon)";
IRScriptBody script = new IRScriptBody(manager, manager.runtime.newSymbol(file), rootNode.getStaticScope());

return topIRBuilder(manager, script).buildRootInner(rootNode);
}
2 changes: 1 addition & 1 deletion spec/compiler/general_spec.rb
Original file line number Diff line number Diff line change
@@ -403,7 +403,7 @@ def self.bar
run("a = 0; 1.times { a += 1; redo if a < 2 }; a") {|result| expect(result).to eq 2 }
run("def foo(&b); while true; b.call; end; end; foo { break 3 }") {|result| expect(result).to eq 3 }

expect(lambda { run("def foo(&b); while true; b.call; end; end; foo { eval 'break 3' }") }).to raise_error(LocalJumpError)
expect(lambda { run("def foo(&b); while true; b.call; end; end; foo { eval 'break 3' }") }).to raise_error(SyntaxError)
end

it "compiles block passing" do
4 changes: 2 additions & 2 deletions test/jruby/test_method.rb
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@ def test_jruby_3491
def test_function_break
obj = Object.new
def obj.broken_method
break # TODO this is a SyntaxError on MRI 2.2.2
break # TODO this is a SyntaxError at parse time on MRI 2.5
end
assert_raise(LocalJumpError){ obj.broken_method }
assert_raise(SyntaxError){ obj.broken_method }
end

module Methods