Actions
Bug #14749
closedIRB: `_` is not updated after exception raised
Bug #14749:
IRB: `_` is not updated after exception raised
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-05-10 trunk 63393) [x86_64-linux]
Description
After r63150, once exception raised, irb holds that exception to _ instead of the last evaluated value.
$ irb -f
irb(main):001:0> RUBY_VERSION
=> "2.6.0"
irb(main):002:0> _
=> "2.6.0"
irb(main):003:0> raise RUBY_RELEASE_DATE
Traceback (most recent call last):
(snip)
1: from (irb):3
RuntimeError (2018-05-10)
irb(main):004:0> _
=> #<RuntimeError: 2018-05-10>
irb(main):005:0> RUBY_REVISION
=> 63393
irb(main):006:0> _
=> #<RuntimeError: 2018-05-10>
The last result of above example should be 63393.
The following patch works fine for me, but I'm not sure it is enough or not.
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r63409.
irb.rb: update _
- lib/irb.rb (IRB::Irb#eval_input): update
_after exception.
[ruby-core:86989] [Bug #14749]
Actions