summaryrefslogtreecommitdiff
path: root/lib/irb.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb.rb')
-rw-r--r--lib/irb.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index c22e6db03b..665f67b946 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -669,6 +669,8 @@ module IRB
lines = lines.reverse if order == :bottom
lines.map{ |l| l + "\n" }.join
}
+ # The "<top (required)>" in "(irb)" may be the top level of IRB so imitate the main object.
+ message = message.gsub(/\(irb\):(?<num>\d+):in `<(?<frame>top \(required\))>'/) { "(irb):#{$~[:num]}:in `<main>'" }
puts message
end
print "Maybe IRB bug!\n" if irb_bug