Module: V8::Conversion::Class

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

Instance Method Summary collapse

Methods included from Code

#to_v8

Methods included from Weak::Cell

#weakcell

Instance Method Details

#to_templateObject


5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/v8/conversion/class.rb', line 5

def to_template
  weakcell(:constructor) do
    template = V8::C::FunctionTemplate::New(V8::Conversion::Constructor.new(self))
    prototype = template.InstanceTemplate()
    prototype.SetNamedPropertyHandler(V8::Conversion::Get, V8::Conversion::Set)
    prototype.SetIndexedPropertyHandler(V8::Conversion::IGet, V8::Conversion::ISet)
    if self != ::Object && superclass != ::Object && superclass != ::Class
      template.Inherit(superclass.to_template)
    end
    template
  end
end