Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure-block runs before value is returned #3388

Closed
judofyr opened this issue Oct 11, 2015 · 2 comments
Closed

Ensure-block runs before value is returned #3388

judofyr opened this issue Oct 11, 2015 · 2 comments

Comments

@judofyr
Copy link

judofyr commented Oct 11, 2015

def wat
  begin
    a = "hello"
    a
  ensure
    a = nil
  end
end

p wat
$ ruby -v wat.rb
jruby 9.0.1.0 (2.2.2) 2015-09-02 583f336 Java HotSpot(TM) 64-Bit Server VM 24.45-b08 on 1.7.0_45-b18 +jit [darwin-x86_64]
nil
$ ruby -v wat.rb
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
"hello"
@judofyr
Copy link
Author

judofyr commented Oct 11, 2015

This causes problems for Erubis + Tilt: rtomayko/tilt#270.

@enebo enebo added this to the Invalid or Duplicate milestone Oct 11, 2015
@enebo
Copy link
Member

enebo commented Oct 11, 2015

Closing as duplicate of #3356. This will be released with 9.0.2 in the next week.

@enebo enebo closed this as completed Oct 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants