class V8::Function

Public Class Methods

new(native = nil) click to toggle source
Calls superclass method V8::Object.new
# File lib/v8/function.rb, line 4
def initialize(native = nil)
  super do
    native || V8::C::FunctionTemplate::New().GetFunction()
  end
end

Public Instance Methods

call(*args) click to toggle source
# File lib/v8/function.rb, line 17
def call(*args)
  @context.enter do
    methodcall @context.native.Global(), *args
  end
end
methodcall(this, *args) click to toggle source
# File lib/v8/function.rb, line 10
def methodcall(this, *args)
  @context.enter do
    this ||= @context.native.Global()
    @context.to_ruby try {native.Call(@context.to_v8(this), args.map {|a| @context.to_v8 a})}
  end
end
new(*args) click to toggle source
# File lib/v8/function.rb, line 23
def new(*args)
  @context.enter do
    @context.to_ruby try {native.NewInstance(args.map {|a| @context.to_v8 a})}
  end
end