summaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-09 18:33:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-09 18:33:52 +0000
commit6c96aef2df77517199e1b6f54190247fd869230c (patch)
tree5628bd9e80090bdbba957883afa0559d81cce1c7 /variable.c
parent414b7c9b819cd1049efdb9d45941304a649ffd32 (diff)
downloadruby-6c96aef2df77517199e1b6f54190247fd869230c.tar.gz
ruby-6c96aef2df77517199e1b6f54190247fd869230c.tar.xz
ruby-6c96aef2df77517199e1b6f54190247fd869230c.zip
* variable.c (rb_mod_name): search module path if classname is not
set yet. (ruby-bugs-ja PR#424) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/variable.c b/variable.c
index 0f5185a5f..2f35d5311 100644
--- a/variable.c
+++ b/variable.c
@@ -182,7 +182,7 @@ rb_mod_name(mod)
VALUE path = classname(mod);
if (path) return rb_str_dup(path);
- return rb_str_new(0,0);
+ return rb_str_dup(rb_class_path(mod));
}
VALUE
@@ -1112,7 +1112,7 @@ rb_obj_remove_instance_variable(obj, name)
rb_raise(rb_eSecurityError, "Insecure: can't modify instance variable");
if (OBJ_FROZEN(obj)) rb_error_frozen("object");
if (!rb_is_instance_id(id)) {
- rb_name_error(id, "`%s' is not an instance variable", rb_id2name(id));
+ rb_name_error(id, "`%s' is not allowed as an instance variable name", rb_id2name(id));
}
switch (TYPE(obj)) {
@@ -1232,7 +1232,7 @@ rb_mod_remove_const(mod, name)
VALUE val;
if (!rb_is_const_id(id)) {
- rb_name_error(id, "`%s' is not constant", rb_id2name(id));
+ rb_name_error(id, "`%s' is not allowed as a constant name", rb_id2name(id));
}
if (!OBJ_TAINTED(mod) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't remove constant");