Skip to content

Commit

Permalink
Merge pull request #3163 from mattn/fix-public_methods
Browse files Browse the repository at this point in the history
Fix public methods
  • Loading branch information
matz committed Jun 18, 2016
2 parents a8af43f + 8a15ab0 commit fa1c1ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/kernel.c
Expand Up @@ -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 */
/*
Expand Down
5 changes: 5 additions & 0 deletions test/t/kernel.rb
Expand Up @@ -423,6 +423,11 @@ class NoInspectClass

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'
Expand Down

0 comments on commit fa1c1ab

Please sign in to comment.