aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 03:02:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 03:02:23 +0000
commita4893fb87b344c42f12faa1e453aaddb61a9609b (patch)
treed9d86c1762afea014726d3f456a5f4a7c3984e05
parentf4a5ff40a9d98c2a60e54c4e1a72fad9ded54189 (diff)
downloadruby-a4893fb87b344c42f12faa1e453aaddb61a9609b.tar.gz
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
-rw-r--r--object.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/object.c b/object.c
index 7f0ce75..42a3f77 100644
--- a/object.c
+++ b/object.c
@@ -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