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

maintain referential integrity for embedded procs

This commit is contained in:
Charles Lowell 2012-06-11 05:14:15 -05:00
parent 6157d35d4a
commit 65acfdbe6a

View file

@ -1,9 +1,16 @@
class V8::Conversion class V8::Conversion
module Proc module Proc
def to_v8 def to_v8
template = V8::C::FunctionTemplate::New() return v8_template.GetFunction()
template.SetCallHandler(InvocationHandler.new, V8::C::External::New(self)) end
return template.GetFunction()
def v8_template
unless @v8_template
@v8_template = V8::C::FunctionTemplate::New()
@v8_template.SetCallHandler(InvocationHandler.new, V8::C::External::New(self))
end
return @v8_template
end end
class InvocationHandler class InvocationHandler