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

16 lines
No EOL
327 B
Ruby

class V8::Conversion
module Reference
def self.construct!(object)
context = V8::Context.current
constructor = context.to_v8(object.class)
reference = constructor.NewInstance([V8::C::External::New(object)])
return reference
end
def to_v8
Reference.construct! self
end
end
end