Merge pull request #3163 from mattn/fix-public_methods

Fix public methods
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-06-18 11:40:32 +09:00
committed by GitHub
2 changed files with 6 additions and 3 deletions
+1 -3
View File
@@ -722,9 +722,7 @@ mrb_obj_singleton_methods(mrb_state *mrb, mrb_bool recur, mrb_value obj)
static mrb_value
mrb_obj_methods(mrb_state *mrb, mrb_bool recur, mrb_value obj, mrb_method_flag_t flag)
{
if (recur)
return mrb_class_instance_method_list(mrb, recur, mrb_class(mrb, obj), 0);
return mrb_obj_singleton_methods(mrb, recur, obj);
return mrb_class_instance_method_list(mrb, recur, mrb_class(mrb, obj), 0);
}
/* 15.3.1.3.31 */
/*
+5
View File
@@ -423,6 +423,11 @@ end
assert('Kernel#public_methods', '15.3.1.3.38') do
assert_equal Array, public_methods.class
class Foo
def foo
end
end
assert_equal [:foo], Foo.new.public_methods(false)
end
# Kernel#puts is defined in mruby-print mrbgem. '15.3.1.3.39'