1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

referential integrity between class constructors

This commit is contained in:
Charles Lowell 2012-06-15 05:12:52 -05:00
parent 7bc06b27c0
commit bde7661189

View file

@ -3,9 +3,15 @@ class V8::Conversion
include V8::Util::Weakcell
def to_v8
fn = to_v8_template.GetFunction()
V8::Context.current.link self, fn
return fn
end
def to_v8_template
weakcell(:v8_constructor) do
V8::C::FunctionTemplate::New(Constructor.new(self))
end.GetFunction()
template = V8::C::FunctionTemplate::New(Constructor.new(self))
end
end
class Constructor