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
1 change: 1 addition & 0 deletions lib/error_highlight/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def to_s
return msg unless locs

loc = locs.first
return msg unless loc
begin
node = RubyVM::AbstractSyntaxTree.of(loc, keep_script_lines: true)
opts = {}
Expand Down
13 changes: 13 additions & 0 deletions test/test_error_highlight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1194,4 +1194,17 @@ def test_no_final_newline
end
end
end

def test_simulate_funcallv_from_embedded_ruby
assert_error_message(NoMethodError, <<~END) do
undefined method `foo' for nil:NilClass
END

nil.foo + 1
rescue NoMethodError => exc
def exc.backtrace_locations = []
raise
end
end

end