class V8::Function

Public Instance Methods

call(*args) click to toggle source
# File lib/v8/function.rb, line 18
def call(*args)
  @portal.open do
    self.methodcall(@portal.context.native.Global(), *args)
  end
end
methodcall(thisObject, *args) click to toggle source
# File lib/v8/function.rb, line 4
def methodcall(thisObject, *args)
  err = nil
  return_value = nil
  @portal.open do |to|
    C::TryCatch.try do |try|
      this = to.v8(thisObject)
      return_value = to.rb(@native.Call(this, to.v8(args)))
      err = JSError.new(try, to) if try.HasCaught()
    end
  end
  raise err if err
  return return_value
end
name() click to toggle source
# File lib/v8/function.rb, line 30
def name
  @portal.open do |to|
    to.rb(@native.GetName())
  end
end
name=(name) click to toggle source
# File lib/v8/function.rb, line 36
def name=(name)
  name.tap do
    @portal.open do |to|
      @native.SetName(to.v8(name))
    end
  end
end
new(*args) click to toggle source
# File lib/v8/function.rb, line 24
def new(*args)
  @portal.open do |to|
    to.rb(@native.NewInstance(to.v8(args)))
  end
end