diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-28 15:58:32 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-28 15:58:32 +0000 |
| commit | eb901c015e2ed8751176b7fbf120df44fea93946 (patch) | |
| tree | d82f07a115b775135a5399260bce12db80469899 /variable.c | |
| parent | c9973228854c96058060e8e8692ae91f4c88f441 (diff) | |
| download | ruby-eb901c015e2ed8751176b7fbf120df44fea93946.tar.gz ruby-eb901c015e2ed8751176b7fbf120df44fea93946.tar.xz ruby-eb901c015e2ed8751176b7fbf120df44fea93946.zip | |
* eval.c (ev_const_get), variable.c (rb_const_get_0): retry only when
autoload succeeded.
* variable.c (rb_autoload_load): now return true if autoload
succeeded. fixed: [ruby-dev:27331]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
| -rw-r--r-- | variable.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/variable.c b/variable.c index 24a339b09..afa05e3ff 100644 --- a/variable.c +++ b/variable.c @@ -1215,16 +1215,16 @@ autoload_delete(VALUE mod, ID id) return (NODE *)load; } -void +VALUE rb_autoload_load(VALUE klass, ID id) { VALUE file; NODE *load = autoload_delete(klass, id); if (!load || !(file = load->nd_lit) || rb_provided(RSTRING(file)->ptr)) { - const_missing(klass, id); + return Qfalse; } - rb_require_safe(file, load->nd_nth); + return rb_require_safe(file, load->nd_nth); } static VALUE @@ -1283,7 +1283,7 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse) while (tmp) { while (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) { if (value == Qundef) { - rb_autoload_load(tmp, id); + if (!RTEST(rb_autoload_load(tmp, id))) break; continue; } if (exclude && tmp == rb_cObject && klass != rb_cObject) { |
