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

Use class constructor to generate object proxies

This commit is contained in:
Charles Lowell 2012-06-15 08:26:47 -05:00
parent d020ba13b3
commit e7db9d8d38

View file

@ -3,8 +3,9 @@ class V8::Conversion
include V8::Util::Weakcell
def to_v8
object = to_v8_template.NewInstance()
V8::Context.link self, object
context = V8::Context.current
constructor = context.to_v8(self.class)
object = constructor.NewInstance([V8::C::External::New(self)])
return object
end