diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-08 05:20:34 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-08 05:20:34 +0000 |
commit | d4110a1e7150384ace36a42a9483d1772f12b8c8 (patch) | |
tree | 24f82ed966318b3bf512feec2aa15b164cc8fba1 /eval.c | |
parent | ebd6cbda2fb3727a54735071ed9845765ffe5a06 (diff) |
* parse.y (yycompile): should inherit "in_single" if eval happened
in a singleton method.
* eval.c (rb_eval): class variables from singleton methods defined
within singleton class statement should work like ones defined
by sington def statements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1847,7 +1847,6 @@ is_defined(self, node, buf) } break; } - self = rb_iv_get(ruby_cbase, "__attached__"); /* fall through */ case NODE_CVAR2: if (rb_cvar_defined(rb_cvar_singleton(self), node->nd_vid)) { @@ -4598,7 +4597,7 @@ rb_call(klass, recv, mid, argc, argv, scope) /* self must be kind of a specified form for private method */ if ((noex & NOEX_PROTECTED)) { VALUE defined_class = klass; - while (TYPE(defined_class) == T_ICLASS) + if (TYPE(defined_class) == T_ICLASS) defined_class = RBASIC(defined_class)->klass; if (!rb_obj_is_kind_of(ruby_frame->self, defined_class)) return rb_undefined(recv, mid, argc, argv, CSTAT_PROT); |