summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-02-02 15:36:13 +0900
committerYusuke Endoh <mame@ruby-lang.org>2022-02-22 11:55:40 +0900
commit4db986431a10d7b635a17cd0024278a2ede59948 (patch)
treef4b4d52b61076938a538b688174d0f8568a5651f
parent89e446683e19fa77e2e0dec6396d4c4c09f36fab (diff)
Let Exception#full_message pass highlight keywords to #detailed_message
.. even when the argument is not explicitly passed.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5516
-rw-r--r--error.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/error.c b/error.c
index 6f925158ce..079c171198 100644
--- a/error.c
+++ b/error.c
@@ -1350,6 +1350,13 @@ exc_full_message(int argc, VALUE *argv, VALUE exc)
highlight = check_highlight_keyword(opt, 1);
order = check_order_keyword(opt);
+ {
+ static VALUE kw_highlight;
+ if (!kw_highlight) kw_highlight = ID2SYM(rb_intern_const("highlight"));
+ if (NIL_P(opt)) opt = rb_hash_new();
+ rb_hash_aset(opt, kw_highlight, highlight);
+ }
+
str = rb_str_new2("");
errat = rb_get_backtrace(exc);
emesg = rb_get_detailed_message(exc, opt);