Permalink
Browse files

copy tainted/untrusted/frozen status when adds the method into single…

…ton class
  • Loading branch information...
1 parent 3d82777 commit 72daf83748c3536c2213ea03195cfc2e84c49767 @Watson1978 Watson1978 committed Jul 28, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −0 class.c
  2. +0 −2 spec/frozen/tags/macruby/language/def_tags.txt
View
@@ -1193,6 +1193,12 @@ rb_singleton_class(VALUE obj)
klass = rb_make_metaclass(obj, RBASIC(obj)->klass);
break;
}
+
+ OBJ_INFECT(klass, obj);
+ if (OBJ_FROZEN(obj)) {
+ OBJ_FREEZE(klass);
+ }
+
return klass;
}
@@ -1,5 +1,3 @@
fails:A method definition in an eval creates a class method
fails:Defining an 'initialize_copy' method should make it private
fails:Defining an 'initialize_copy' method sets the method's visibility to private
-fails:A singleton method definition raises RuntimeError if frozen
-fails:A method definition inside a metaclass scope raises RuntimeError if frozen

0 comments on commit 72daf83

Please sign in to comment.