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

ruby-changes:44046

From: nobu <ko1@a...>
Date: Fri, 9 Sep 2016 12:02:29 +0900 (JST)
Subject: [ruby-changes:44046] nobu:r56120 (trunk): object.c: update rdoc

nobu	2016-09-09 12:02:23 +0900 (Fri, 09 Sep 2016)

  New Revision: 56120

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56120

  Log:
    object.c: update rdoc
    
    * object.c (InitVM_Object): update rdoc of NIL/TRUE/FALSE, and use
      rb_deprecate_constant.

  Modified files:
    trunk/object.c
Index: object.c
===================================================================
--- object.c	(revision 56119)
+++ object.c	(revision 56120)
@@ -3512,9 +3512,10 @@ InitVM_Object(void) https://github.com/ruby/ruby/blob/trunk/object.c#L3512
     rb_undef_alloc_func(rb_cNilClass);
     rb_undef_method(CLASS_OF(rb_cNilClass), "new");
     /*
-     * An alias of +nil+
+     * An obsolete alias of +nil+
      */
     rb_define_global_const("NIL", Qnil);
+    rb_deprecate_constant(rb_cObject, "NIL");
 
     rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0);
     rb_define_method(rb_cModule, "===", rb_mod_eqq, 1);
@@ -3596,9 +3597,10 @@ InitVM_Object(void) https://github.com/ruby/ruby/blob/trunk/object.c#L3597
     rb_undef_alloc_func(rb_cTrueClass);
     rb_undef_method(CLASS_OF(rb_cTrueClass), "new");
     /*
-     * An alias of +true+
+     * An obsolete alias of +true+
      */
     rb_define_global_const("TRUE", Qtrue);
+    rb_deprecate_constant(rb_cObject, "TRUE");
 
     rb_cFalseClass = rb_define_class("FalseClass", rb_cObject);
     rb_define_method(rb_cFalseClass, "to_s", false_to_s, 0);
@@ -3610,17 +3612,10 @@ InitVM_Object(void) https://github.com/ruby/ruby/blob/trunk/object.c#L3612
     rb_undef_alloc_func(rb_cFalseClass);
     rb_undef_method(CLASS_OF(rb_cFalseClass), "new");
     /*
-     * An alias of +false+
+     * An obsolete alias of +false+
      */
     rb_define_global_const("FALSE", Qfalse);
-
-    {
-	VALUE names[3];
-	names[0] = ID2SYM(rb_intern_const("TRUE"));
-	names[1] = ID2SYM(rb_intern_const("FALSE"));
-	names[2] = ID2SYM(rb_intern_const("NIL"));
-	rb_mod_deprecate_constant(3, names, rb_cObject);
-    }
+    rb_deprecate_constant(rb_cObject, "FALSE");
 }
 
 void

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

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