diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-28 08:44:45 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-28 08:44:45 +0000 |
commit | 4f38c453b4fccfbc529909781c2c1659f256697b (patch) | |
tree | f5f2eb688ce0d96f6b51515366f2dbf048cc3639 /eval.c | |
parent | ae6afaaedbe2c88abbfc315a66685e6b99e4050c (diff) | |
download | ruby-4f38c453b4fccfbc529909781c2c1659f256697b.tar.gz |
* eval.c (is_defined): defined?(Foo::Baz) should check constants
only, no methods.
* eval.c (is_defined): should not dump core on defined?(a::b)
where a is not a class nor a module.
* object.c (Init_Object): remove dup and clone from TrueClass,
FalseClass, and NilClass.
* array.c (rb_ary_fill): Array#fill takes block to get the value to
fill.
* string.c (rb_str_to_i): to_i(0) auto-detects base radix.
* array.c (rb_ary_initialize): fill by the block evaluation value
if block is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1934,8 +1934,9 @@ is_defined(self, node, buf) case T_MODULE: if (rb_const_defined_at(val, node->nd_mid)) return "constant"; + break; default: - if (rb_method_boundp(val, node->nd_mid, 1)) { + if (rb_method_boundp(CLASS_OF(val), node->nd_mid, 1)) { return "method"; } } @@ -2937,7 +2938,7 @@ rb_eval(self, n) default: return rb_funcall(klass, node->nd_mid, 0, 0); } - result = rb_const_get_at(klass, node->nd_mid); + result = rb_const_get(klass, node->nd_mid); } break; |