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 /parse.y | |
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 'parse.y')
-rw-r--r-- | parse.y | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1974,6 +1974,10 @@ yycompile(f, line) heredoc_end = 0; ruby_sourcefile = strdup(f); ruby_in_compile = 1; + if (ruby_frame && ruby_frame->last_class && + FL_TEST(ruby_frame->last_class, FL_SINGLETON)) { + in_single = 1; + } n = yyparse(); ruby_debug_lines = 0; compile_for_eval = 0; |