Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/debug/frame_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def parameters_info

private def get_singleton_class obj
obj.singleton_class # TODO: don't use it
rescue TypeError
rescue Exception
nil
end

Expand Down
27 changes: 27 additions & 0 deletions test/console/backtrace_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,31 @@ def test_backtrace_prints_without_hanging
end
end
end

class BrokenSingletonMethodBacktraceTest < ConsoleTestCase
def program
<<~RUBY
1| class C
2| def self.foo
3| debugger
4| end
5| def singleton_class
6| raise
7| end
8| def self.singleton_class
9| eval(")") # SyntaxError
10| end
11| end
12| C.foo
RUBY
end

def test_raise_exception
debug_code program do
type 'c'
assert_line_text(/foo/)
type 'c'
end
end
end
end
Loading