зеркало из https://github.com/github/ruby.git
* object.c (rb_mod_cvar_defined): wrong id check. a patch from
Mauricio Fernandez <mfp at acm.org>. [ruby-core:09158] * object.c (rb_mod_cvar_get): typo fixed. [ruby-core:09168] * object.c (rb_mod_cvar_set): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f6bf2b3746
Коммит
1115039a0b
|
@ -1,3 +1,12 @@
|
|||
Fri Oct 13 00:34:26 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* object.c (rb_mod_cvar_defined): wrong id check. a patch from
|
||||
Mauricio Fernandez <mfp at acm.org>. [ruby-core:09158]
|
||||
|
||||
* object.c (rb_mod_cvar_get): typo fixed. [ruby-core:09168]
|
||||
|
||||
* object.c (rb_mod_cvar_set): ditto.
|
||||
|
||||
Thu Oct 12 22:58:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* hash.c (rb_hash_compare_by_id): somehow we lost renaming from
|
||||
|
|
8
object.c
8
object.c
|
@ -1707,7 +1707,7 @@ rb_mod_cvar_get(VALUE obj, VALUE iv)
|
|||
ID id = rb_to_id(iv);
|
||||
|
||||
if (!rb_is_class_id(id)) {
|
||||
rb_name_error(id, "`%s' is not allowed as an class variable name", rb_id2name(id));
|
||||
rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id));
|
||||
}
|
||||
return rb_cvar_get(obj, id);
|
||||
}
|
||||
|
@ -1735,7 +1735,7 @@ rb_mod_cvar_set(VALUE obj, VALUE iv, VALUE val)
|
|||
ID id = rb_to_id(iv);
|
||||
|
||||
if (!rb_is_class_id(id)) {
|
||||
rb_name_error(id, "`%s' is not allowed as an class variable name", rb_id2name(id));
|
||||
rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id));
|
||||
}
|
||||
rb_cvar_set(obj, id, val, Qfalse);
|
||||
return val;
|
||||
|
@ -1760,8 +1760,8 @@ rb_mod_cvar_defined(VALUE obj, VALUE iv)
|
|||
{
|
||||
ID id = rb_to_id(iv);
|
||||
|
||||
if (!rb_is_instance_id(id)) {
|
||||
rb_name_error(id, "`%s' is not allowed as an instance variable name", rb_id2name(id));
|
||||
if (!rb_is_class_id(id)) {
|
||||
rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id));
|
||||
}
|
||||
return rb_cvar_defined(obj, id);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче