diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-27 04:26:21 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-27 04:26:21 +0000 |
commit | af181db7846b3ca38b443bdf7d65e6d26f87da6a (patch) | |
tree | 9c05af34210f699bd1425b5ff6f5b2e39919f2af | |
parent | 35e4d1319b86f9a2899a0fc1bb6ffafd7f26840e (diff) |
* eval.c (rb_eval): Class#inherited should be called after the
execution of the class body.
* parse.y (primary): remove "return outside of method" check at
compile time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | eval.c | 3 | ||||
-rw-r--r-- | parse.y | 4 |
3 files changed, 12 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Fri Sep 27 13:24:35 2002 Yukihiro Matsumoto <[email protected]> + + * eval.c (rb_eval): Class#inherited should be called after the + execution of the class body. + Fri Sep 27 02:41:53 2002 Akinori MUSHA <[email protected]> * ext/digest/sha1: Use OpenSSL's SHA1 engine if available. It is @@ -27,6 +32,11 @@ Thu Sep 26 22:44:21 2002 Akinori MUSHA <[email protected]> * ext/digest/digest.c (rb_digest_base_s_hexdigest): Get rid of redundant struct allocation. +Thu Sep 26 09:52:52 2002 Yukihiro Matsumoto <[email protected]> + + * parse.y (primary): remove "return outside of method" check at + compile time. + Wed Sep 25 23:51:29 2002 Nobuyoshi Nakada <[email protected]> * dir.c (glob_helper): must not closedir() when exception raised @@ -3281,6 +3281,7 @@ rb_eval(self, n) if (tmp != super) { goto override_class; } + super = 0; } if (ruby_safe_level >= 4) { rb_raise(rb_eSecurityError, "extending class prohibited"); @@ -3291,7 +3292,6 @@ rb_eval(self, n) if (!super) super = rb_cObject; klass = rb_define_class_id(node->nd_cname, super); rb_set_class_path(klass,ruby_cbase,rb_id2name(node->nd_cname)); - rb_class_inherited(super, klass); rb_const_set(ruby_cbase, node->nd_cname, klass); } if (ruby_wrapper) { @@ -3300,6 +3300,7 @@ rb_eval(self, n) } result = module_setup(klass, node->nd_body); + if (super) rb_class_inherited(super, klass); } break; @@ -556,8 +556,6 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem expr : kRETURN call_args { - if (!compile_for_eval && !in_def && !in_single) - yyerror("return appeared outside of method"); $$ = NEW_RETURN(ret_args($2)); } | kBREAK call_args @@ -1339,8 +1337,6 @@ primary : literal } | kRETURN { - if (!compile_for_eval && !in_def && !in_single) - yyerror("return appeared outside of method"); $$ = NEW_RETURN(0); } | kYIELD '(' call_args ')' |