diff options
| -rw-r--r-- | lib/irb/command/debug.rb | 2 | ||||
| -rw-r--r-- | test/irb/test_context.rb | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/irb/command/debug.rb b/lib/irb/command/debug.rb index 9a2c641251..bdf91766bc 100644 --- a/lib/irb/command/debug.rb +++ b/lib/irb/command/debug.rb @@ -11,7 +11,7 @@ module IRB BINDING_IRB_FRAME_REGEXPS = [ '<internal:prelude>', binding.method(:irb).source_location.first, - ].map { |file| /\A#{Regexp.escape(file)}:\d+:in `irb'\z/ } + ].map { |file| /\A#{Regexp.escape(file)}:\d+:in (`|'Binding#)irb'\z/ } def execute(pre_cmds: nil, do_cmds: nil) if irb_context.with_debugger diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index 71d4aae907..059c486767 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -72,7 +72,7 @@ module TestIRB expected_output = if RUBY_3_4 [ - :*, /\(irb\):1:in '<top \(required\)>': Foo \(RuntimeError\)\n/, + :*, /\(irb\):1:in '<main>': Foo \(RuntimeError\)\n/, :*, /#<RuntimeError: Foo>\n/, :*, /0$/, :*, /0$/, @@ -107,8 +107,8 @@ module TestIRB expected_output = if RUBY_3_4 [ - :*, /\(irb\):1:in '<top \(required\)>': Foo \(RuntimeError\)\n/, - :*, /\(irb\):2:in '<top \(required\)>': Bar \(RuntimeError\)\n/, + :*, /\(irb\):1:in '<main>': Foo \(RuntimeError\)\n/, + :*, /\(irb\):2:in '<main>': Bar \(RuntimeError\)\n/, :*, /#<RuntimeError: Bar>\n/, ] else @@ -531,7 +531,7 @@ module TestIRB [ :*, /\(irb\):1:in 'fuga': unhandled exception\n/, :*, /\tfrom \(irb\):1:in 'hoge'\n/, - :*, /\tfrom \(irb\):1:in '<top \(required\)>'\n/, + :*, /\tfrom \(irb\):1:in '<main>'\n/, :* ] elsif RUBY_VERSION < '3.0.0' && STDOUT.tty? @@ -569,7 +569,7 @@ module TestIRB [ :*, /\(irb\):1:in 'fuga': A\\xF3B \(RuntimeError\)\n/, :*, /\tfrom \(irb\):1:in 'hoge'\n/, - :*, /\tfrom \(irb\):1:in '<top \(required\)>'\n/, + :*, /\tfrom \(irb\):1:in '<main>'\n/, :* ] elsif RUBY_VERSION < '3.0.0' && STDOUT.tty? |
