mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
[ruby/error_highlight] Enable ErrorHighlight for TypeError/ArgumentError only after Ruby 3.2
... because changing TypeError#message and ArgumentError#message is
highly incompatible.
39aa897c7a
This commit is contained in:
parent
96d29dff66
commit
8bfd4dd4e1
1 changed files with 7 additions and 2 deletions
|
@ -37,6 +37,11 @@ module ErrorHighlight
|
||||||
end
|
end
|
||||||
|
|
||||||
NameError.prepend(CoreExt)
|
NameError.prepend(CoreExt)
|
||||||
|
|
||||||
|
if Exception.method_defined?(:detailed_message)
|
||||||
|
# ErrorHighlight is enabled for TypeError and ArgumentError only when Exception#detailed_message is available.
|
||||||
|
# This is because changing ArgumentError#message is highly incompatible.
|
||||||
TypeError.prepend(CoreExt)
|
TypeError.prepend(CoreExt)
|
||||||
ArgumentError.prepend(CoreExt)
|
ArgumentError.prepend(CoreExt)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue