Sha256: 7fea4252f44903ce0f5006ebf61167faf534d7c0d860d75c7c38fd19ecc8a601

Contents?: true

Size: 622 Bytes

Versions: 37

Compression:

Stored size: 622 Bytes

Contents

class V8::Function < V8::Object
  include V8::Error::Try

  def initialize(native = nil)
    super do
      native || V8::C::FunctionTemplate::New().GetFunction()
    end
  end

  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

  def call(*args)
    @context.enter do
      methodcall @context.native.Global(), *args
    end
  end

  def new(*args)
    @context.enter do
      @context.to_ruby try {native.NewInstance(args.map {|a| @context.to_v8 a})}
    end
  end
end

Version data entries

37 entries across 37 versions & 8 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/therubyracer-0.12.2/lib/v8/function.rb
therubyracer-0.12.3 lib/v8/function.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.11.4/lib/v8/function.rb
therubyracer-xcode-0.12.3 lib/v8/function.rb
therubyracer-xcode-0.12.2 lib/v8/function.rb
therubyracer-tmpfork-0.12.2 lib/v8/function.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/therubyracer-0.12.2/lib/v8/function.rb
therubyracer-0.12.2 lib/v8/function.rb
therubyracer-0.12.1 lib/v8/function.rb
therubyracer-discourse-0.12.0 lib/v8/function.rb
therubyracer-0.12.0 lib/v8/function.rb
therubyracer-0.11.4 lib/v8/function.rb
therubyracer-0.11.3 lib/v8/function.rb
therubyracer-0.11.2 lib/v8/function.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/therubyracer-0.11.0/lib/v8/function.rb
therubyracer-0.11.1 lib/v8/function.rb
therubyracer-0.11.1beta1 lib/v8/function.rb
therubyracer-0.11.0 lib/v8/function.rb
therubyracer-0.11.0beta8-x86-freebsd-9 lib/v8/function.rb
therubyracer-0.11.0beta8-x86_64-linux lib/v8/function.rb