1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/lib/v8/conversion/class.rb
2012-06-11 07:34:02 -05:00

17 lines
No EOL
431 B
Ruby

class V8::Conversion
module Class
def to_v8
v8_constructor.GetFunction()
end
def v8_constructor
unless @v8_constructor && @v8_constructor.weakref_alive?
template = V8::C::FunctionTemplate::New()
# template.SetCallHandler(InvocationHandler.new, V8::C::External::New(self))
@v8_constructor = WeakRef.new(template)
end
return @v8_constructor.__getobj__
end
end
end