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

19 lines
No EOL
590 B
Ruby

module V8
class Portal
class Proxies
def initialize
@js_proxies = {}
@rb_proxies = {}
end
def register_javascript_proxy(proxy, options = {})
target = options[:for] or fail ArgumentError, "must specify the object that you're proxying with the :for => param"
fail ArgumentError, "javascript proxy must be a Handle to an actual V8 object" unless proxy.kind_of?(V8::C::Handle)
# handle = V8::C::Handle::New(proxy)
# handle.MakeWeak(&clear_jsproy)
@js_proxies[proxy.object_id] = target
end
end
end
end