lib/byebug/context.rb in byebug-2.7.0 vs lib/byebug/context.rb in byebug-3.0.0

- old
+ new

@@ -1,24 +1,20 @@ module Byebug class Context class << self - def stack_size + def stack_size(byebug_frames = false) if backtrace = Thread.current.backtrace_locations(0) - backtrace.drop_while { |l| !ignored(l.path) } - .drop_while { |l| ignored(l.path) } - .take_while { |l| !ignored(l.path) } - .size + unless byebug_frames + backtrace = backtrace.drop_while { |l| !ignored(l.path) } + .drop_while { |l| ignored(l.path) } + .take_while { |l| !ignored(l.path) } + end + backtrace.size else - print 'No backtrace available!!' + print 'WARNING: No backtrace available!!' 0 - end - end - - def real_stack_size - if backtrace = Thread.current.backtrace_locations(0) - backtrace.size end end def ignored(path) IGNORED_FILES.include?(path)