1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Fix method --super on JRuby

This commit is contained in:
Conrad Irwin 2012-01-31 23:04:52 -08:00
parent b587941931
commit 07ae5c08b5

View file

@ -348,11 +348,11 @@ class Pry
# @return [Pry::Method, nil] The wrapped method that is called when you
# use "super" in the body of this method.
def super(times=1)
if respond_to?(:receiver)
if UnboundMethod === @method
sup = super_using_ancestors(Pry::Method.instance_resolution_order(owner), times)
else
sup = super_using_ancestors(Pry::Method.resolution_order(receiver), times)
sup &&= sup.bind(receiver)
else
sup = super_using_ancestors(Pry::Method.instance_resolution_order(owner), times)
end
Pry::Method.new(sup) if sup
end