Module: V8::Conversion::Accessor

Includes:
Error::Protect
Included in:
Get, IGet, ISet, Set
Defined in:
lib/v8/conversion/class.rb

Instance Method Summary collapse

Methods included from Error::Protect

#protect

Instance Method Details

#intercept(info, key, &block) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/v8/conversion/class.rb', line 69

def intercept(info, key, &block)
  context = V8::Context.current
  access = context.access
  object = context.to_ruby(info.This())
  handles_property = true
  dontintercept = proc do
    handles_property = false
  end
  protect do
    result = block.call(context, access, object, context.to_ruby(key), dontintercept)
    handles_property ? context.to_v8(result) : V8::C::Value::Empty
  end
end