[前][次][番号順一覧][スレッド一覧]

ruby-changes:61762

From: Yusuke <ko1@a...>
Date: Thu, 18 Jun 2020 09:20:10 +0900 (JST)
Subject: [ruby-changes:61762] 35a6741816 (master): Revert "[DOC] Added Exception.exception to Exception.new [ci skip]"

https://git.ruby-lang.org/ruby.git/commit/?id=35a6741816

From 35a67418160ebde3901c1a6f1413a950a867514f Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Thu, 18 Jun 2020 09:19:43 +0900
Subject: Revert "[DOC] Added Exception.exception to Exception.new [ci skip]"

This reverts commit 957825639c1422777c09578d4a03adf571eac55d.

Do not use [ci skip]!!!!

diff --git a/error.c b/error.c
index d812f49..af4dc23 100644
--- a/error.c
+++ b/error.c
@@ -1003,8 +1003,7 @@ exc_init(VALUE exc, VALUE mesg) https://github.com/ruby/ruby/blob/trunk/error.c#L1003
 
 /*
  * call-seq:
- *    Exception.new(msg = nil)        ->  exception
- *    Exception.exception(msg = nil)  ->  exception
+ *    Exception.new(msg = nil)   ->  exception
  *
  *  Construct a new Exception object, optionally passing in
  *  a message.
@@ -2573,7 +2572,7 @@ void https://github.com/ruby/ruby/blob/trunk/error.c#L2572
 Init_Exception(void)
 {
     rb_eException   = rb_define_class("Exception", rb_cObject);
-    rb_define_alias(rb_singleton_class(rb_eException), "exception", "new");
+    rb_define_singleton_method(rb_eException, "exception", rb_class_new_instance, -1);
     rb_define_singleton_method(rb_eException, "to_tty?", exc_s_to_tty_p, 0);
     rb_define_method(rb_eException, "exception", exc_exception, -1);
     rb_define_method(rb_eException, "initialize", exc_initialize, -1);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]