Skip to content

Commit

Permalink
copy tainted/untrusted/frozen status when adds the method into single…
Browse files Browse the repository at this point in the history
…ton class
  • Loading branch information
Watson1978 committed Jul 28, 2012
1 parent 3d82777 commit 72daf83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions class.c
Expand Up @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions spec/frozen/tags/macruby/language/def_tags.txt
@@ -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.