提交 68207cd4 编写于 作者: S Sean Griffin

Merge pull request #22385 from headius/each_object_singleton_test

Test if each_object(singleton_class) works, since JRuby added it.
......@@ -3,7 +3,8 @@
class Class
begin
ObjectSpace.each_object(Class.new) {}
# Test if this Ruby supports each_object against singleton_class
ObjectSpace.each_object(Numeric.singleton_class) {}
def descendants # :nodoc:
descendants = []
......@@ -12,7 +13,7 @@ def descendants # :nodoc:
end
descendants
end
rescue StandardError # JRuby
rescue StandardError # JRuby 9.0.4.0 and earlier
def descendants # :nodoc:
descendants = []
ObjectSpace.each_object(Class) do |k|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册