lib/byebug/helpers/thread.rb in byebug-8.2.5 vs lib/byebug/helpers/thread.rb in byebug-9.0.0
- old
+ new
@@ -26,21 +26,23 @@
end
def context_from_thread(thnum)
ctx = Byebug.contexts.find { |c| c.thnum.to_s == thnum }
- err = case
- when ctx.nil? then pr('thread.errors.no_thread')
- when ctx == context then pr('thread.errors.current_thread')
- when ctx.ignored? then pr('thread.errors.ignored', arg: thnum)
+ err = if ctx.nil?
+ pr('thread.errors.no_thread')
+ elsif ctx == context
+ pr('thread.errors.current_thread')
+ elsif ctx.ignored?
+ pr('thread.errors.ignored', arg: thnum)
end
[ctx, err]
end
private
- # TODO: Check whether it is Byebug.current_context or context
+ # @todo Check whether it is Byebug.current_context or context
def location(ctx)
return context.location if ctx == Byebug.current_context
backtrace = ctx.thread.backtrace_locations
return '' unless backtrace && backtrace[0]