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

ruby-changes:59448

From: Nobuyoshi <ko1@a...>
Date: Tue, 24 Dec 2019 20:18:14 +0900 (JST)
Subject: [ruby-changes:59448] 4ba9347554 (master): `Object#=~` warning also obeys `Warning[:deprecated]`

https://git.ruby-lang.org/ruby.git/commit/?id=4ba9347554

From 4ba9347554ab1ac79fdaf1d5b3320776a2b10615 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 24 Dec 2019 18:49:57 +0900
Subject: `Object#=~` warning also obeys `Warning[:deprecated]`


diff --git a/object.c b/object.c
index 0bb0e0f..61be0d3 100644
--- a/object.c
+++ b/object.c
@@ -1624,8 +1624,10 @@ rb_false(VALUE obj) https://github.com/ruby/ruby/blob/trunk/object.c#L1624
 static VALUE
 rb_obj_match(VALUE obj1, VALUE obj2)
 {
-    rb_warn("deprecated Object#=~ is called on %"PRIsVALUE
-            "; it always returns nil", rb_obj_class(obj1));
+    if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) {
+        rb_warn("deprecated Object#=~ is called on %"PRIsVALUE
+                "; it always returns nil", rb_obj_class(obj1));
+    }
     return Qnil;
 }
 
-- 
cgit v0.10.2


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

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