Skip to content

Commit

Permalink
[Truffle] Code review updates, update default args
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Sep 15, 2016
1 parent 3a85306 commit 40715f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions truffle/src/main/ruby/core/type.rb
Expand Up @@ -84,7 +84,7 @@ def self.object_respond_to?(obj, name, include_private = false)

def self.object_respond_to_no_built_in?(obj, name, include_private = false)
meth = Truffle.invoke_primitive :vm_method_lookup, obj, name
!meth.nil? && !(Truffle.invoke_primitive :vm_method_is_basic, meth)
!meth.nil? && !Truffle.invoke_primitive(:vm_method_is_basic, meth)
end

def self.check_funcall_callable(obj, name)
Expand Down Expand Up @@ -241,7 +241,7 @@ def self.convert_type(obj, cls, meth, raise_on_error)
r
end

def self.check_funcall(recv, meth, args = undefined)
def self.check_funcall(recv, meth, args = [])
check_funcall_default(recv, meth, args, undefined)
end

Expand All @@ -260,10 +260,11 @@ def self.check_funcall_respond_to(obj, meth, priv)
end

def self.check_funcall_missing(recv, meth, args, respond, default)
return default unless basic_obj_respond_to_missing(recv, meth, false) #PRIV false
res = basic_obj_respond_to_missing(recv, meth, false) #PRIV false
return default unless res
if object_respond_to_no_built_in?(recv, :method_missing, true)
begin
return recv.__send__(:method_missing, meth) # , args
return recv.__send__(:method_missing, meth, *args)
rescue NoMethodError
# TODO BJF usually more is done here
raise
Expand Down

0 comments on commit 40715f1

Please sign in to comment.