class V8::Portal::Interceptors::Interceptor
def initialize(portal)
def initialize(portal) @to, @access = portal, portal.access end
def intercept(info, retval = nil, &code)
def intercept(info, retval = nil, &code) obj = @to.rb(info.This()) intercepts = true result = @to.caller.protect do dontintercept = proc do intercepts = false end code.call(obj, dontintercept) end intercepts ? (retval || result) : C::Empty end