Class: V8::Portal::FunctionAdapter::Call

Inherits:
Object
  • Object
show all
Defined in:
lib/v8/portal/function.rb

Direct Known Subclasses

BindAndCall, BoundCall

Instance Method Summary collapse

Constructor Details

#initialize(portal) ⇒ Call

Returns a new instance of Call.



23
24
25
# File 'lib/v8/portal/function.rb', line 23

def initialize(portal)
  @portal = portal
end

Instance Method Details

#call(arguments) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/v8/portal/function.rb', line 27

def call(arguments)
  proc = arguments.Data()
  rbargs = [@portal.rb(arguments.This())]
  for i in 0..arguments.Length() - 1
    rbargs << @portal.rb(arguments[i])
  end
  @portal.caller.invoke(proc, *rbargs)
end