mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* class.c (rb_class_new): move class check to rb_check_inheritable().
* class.c (rb_check_inheritable): should not allow subclass of class Class. [ruby-core:26225] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5ee251bdad
commit
5d6440c748
3 changed files with 11 additions and 5 deletions
|
@ -170,8 +170,7 @@ class TestClass < Test::Unit::TestCase
|
|||
o = Object.new
|
||||
c = class << o; self; end
|
||||
assert_raise(TypeError) { Class.new(c) }
|
||||
|
||||
assert_nothing_raised { Class.new(Class) } # is it OK?
|
||||
assert_raise(TypeError) { Class.new(Class) }
|
||||
assert_raise(TypeError) { eval("class Foo < Class; end") }
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue