summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-13 01:22:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-13 01:22:01 +0000
commit0fa955360437fc8e1aee58c72ab7fc96f0d54f0d (patch)
tree7aa76cfb675f0ee80ca33ced97747671b837b0cf /eval.c
parent92c1d1a9503cc2920082195dc7afcdc5be0e4ca7 (diff)
eval.c: fix message as same as previous versions
* eval.c (rb_frozen_class_p): fix message for singleton class of class/module as same as previous versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 90da225..1dabe2e 100644
--- a/eval.c
+++ b/eval.c
@@ -412,8 +412,21 @@ rb_frozen_class_p(VALUE klass)
if (OBJ_FROZEN(klass)) {
const char *desc;
- if (FL_TEST(klass, FL_SINGLETON))
+ if (FL_TEST(klass, FL_SINGLETON)) {
desc = "object";
+ klass = rb_ivar_get(klass, id__attached__);
+ if (!SPECIAL_CONST_P(klass)) {
+ switch (BUILTIN_TYPE(klass)) {
+ case T_MODULE:
+ case T_ICLASS:
+ desc = "Module";
+ break;
+ case T_CLASS:
+ desc = "Class";
+ break;
+ }
+ }
+ }
else {
switch (BUILTIN_TYPE(klass)) {
case T_MODULE: