1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

object.c: update rdoc

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-09-09 03:02:23 +00:00
parent e6a260ecdb
commit 4785df5527

View file

@ -3512,9 +3512,10 @@ InitVM_Object(void)
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)
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)
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