* Remove unused method and constant from IRB::Debug

* Update comments

https://github.com/ruby/irb/commit/98914a963c
This commit is contained in:
Stan Lo 2023-08-29 13:54:21 +01:00 коммит произвёл git
Родитель 0cfb779692
Коммит 6ed1a504d4
2 изменённых файлов: 3 добавлений и 16 удалений

Просмотреть файл

@ -439,9 +439,9 @@ module IRB
@scanner = RubyLex.new(@context)
end
# A hook point for `debug` command's TracePoint after :IRB_EXIT as well as its clean-up
# A hook point for `debug` command's breakpoint after :IRB_EXIT as well as its clean-up
def debug_break
# it means the debug command is executed
# it means the debug integration has been activated
if defined?(DEBUGGER__) && DEBUGGER__.respond_to?(:capture_frames_without_irb)
# after leaving this initial breakpoint, revert the capture_frames patch
DEBUGGER__.singleton_class.send(:alias_method, :capture_frames, :capture_frames_without_irb)
@ -547,14 +547,13 @@ module IRB
each_top_level_statement do |statement, line_no|
signal_status(:IN_EVAL) do
begin
# If the integration with debugger is activated, we need to handle certain input differently
# If the integration with debugger is activated, we return certain input if it should be dealt with by debugger
if @context.with_debugger && statement.should_be_handled_by_debugger?
return statement.code
end
@context.evaluate(statement.evaluable_code, line_no)
# Don't echo if the line ends with a semicolon
if @context.echo? && !statement.suppresses_echo?
if statement.is_assignment?
if @context.echo_on_assignment?

Просмотреть файл

@ -2,10 +2,6 @@
module IRB
module Debug
BINDING_IRB_FRAME_REGEXPS = [
'<internal:prelude>',
binding.method(:irb).source_location.first,
].map { |file| /\A#{Regexp.escape(file)}:\d+:in `irb'\z/ }
IRB_DIR = File.expand_path('..', __dir__)
class << self
@ -76,14 +72,6 @@ module IRB
irb.context.irb_name += ":rdbg"
end
def binding_irb?
caller.any? do |frame|
BINDING_IRB_FRAME_REGEXPS.any? do |regexp|
frame.match?(regexp)
end
end
end
module SkipPathHelperForIRB
def skip_internal_path?(path)
# The latter can be removed once https://github.com/ruby/debug/issues/866 is resolved