Module: V8::Conversion::Constructor::Args

Defined in:
lib/v8/conversion/class.rb

Instance Method Summary collapse

Instance Method Details

#construct(cls) ⇒ Object


49
50
51
# File 'lib/v8/conversion/class.rb', line 49

def construct(cls)
  context.link cls.new(*to_args), This()
end

#contextObject


53
54
55
# File 'lib/v8/conversion/class.rb', line 53

def context
  V8::Context.current
end

43
44
45
46
47
# File 'lib/v8/conversion/class.rb', line 43

def link
  external = self[0]
  This().SetHiddenValue("rr::implementation", external)
  context.link external.Value(), This()
end

#linkage_call?Boolean

Returns:

  • (Boolean)

39
40
41
# File 'lib/v8/conversion/class.rb', line 39

def linkage_call?
  self.Length() == 1 && self[0].IsExternal()
end

#to_argsObject


57
58
59
60
61
62
63
# File 'lib/v8/conversion/class.rb', line 57

def to_args
  args = ::Array.new(Length())
  0.upto(args.length - 1) do |i|
    args[i] = self[i]
  end
  return args
end