Class: V8::Portal::FunctionAdapter::BindAndCall

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

Instance Method Summary collapse

Methods inherited from Call

#initialize

Constructor Details

This class inherits a constructor from V8::Portal::FunctionAdapter::Call

Instance Method Details

#call(arguments) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/v8/portal/function.rb', line 49

def call(arguments)
  method = arguments.Data()
  rbargs = []
  for i in 0..arguments.Length() - 1
    rbargs << @portal.rb(arguments[i])
  end
  this = @portal.rb(arguments.This())
  @portal.caller.protect do
    method.bind(this).call(*rbargs)
  end
end