Hi,
interceptors intercept all property access, so they will always be
called first. If your interceptor does not want to handle a property
access, it should return an empty handle. Returning an empty handle
tells V8 that the interceptor did not handle the access and it will
then use the accessor instead.
-- Mads
On Thu, Oct 23, 2008 at 4:38 PM, <[EMAIL PROTECTED]> wrote:
>
> I have an object, for example "document", that owns some static
> properties(such as document.URL) and some dynamic properties(such as
> document.theFormName), and now I want to let v8engine accesses static
> properties with AccessorsCallback, and all other dynamic properties
> with InterceptorsCallback, so I do follow thing:
>
> Persistent<ObjectTemplate> ot =
> Persistent<ObjectTemplate>::New(ObjectTemplate::New());
> ot->SetAccessor(String::New("URL"), MyStaticGetter,
> MyStaticSetter); // <----- used for document.URL
> ot->SetNamedPropertyHandler(MyDynamicGetter, MyDynamicSetter); //
> <----- used for document.theFormName
> ......
>
> What happens? Yes, My AccessorsCallback has NOT been invoked, all
> calls enter my InterceptorsCallback. So why? It is a bug?
> >
>
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---