Skip to content

Commit

Permalink
Add spec for non-local return bubbling through lambda.
Browse files Browse the repository at this point in the history
Add for #3143.
  • Loading branch information
headius committed Jul 16, 2015
1 parent eff3dcc commit 807c75f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/ruby/language/return_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,21 @@ def f()
ScratchPad.recorded.should == :before_return
end

# jruby/jruby#3143
describe "downstream from a lambda" do
it "returns to its own return-capturing lexical enclosure" do
def a
->{ yield }.call
return 2
end
def b
a { return 1 }
end

b.should == 1
end
end

end

describe "within two blocks" do
Expand Down

0 comments on commit 807c75f

Please sign in to comment.