Hi,
Using V8 5.1.
I have this function template class "Group":
templ->SetClassName(v8::String::NewFromUtf8(isolateP, "Group"));
v8::Handle<v8::ObjectTemplate> inst = templ->InstanceTemplate();
inst->SetInternalFieldCount(1);
I set an accessor "foo", and this one gets always called when doing "group.foo":
inst->SetAccessor(v8::String::NewFromUtf8(isolateP, "foo"), getProperty, 0, v8::Int32::New(42));
The interceptor intercepts "bar". GroupNamedQueryInterceptor returns "v8::PropertyAttribute::None" for "bar"
inst->SetHandler(v8::NamedPropertyHandlerConfiguration(
GroupNamedPropertyGetter, NULL, GroupNamedQueryInterceptor, NULL, NULL,
v8::Local<v8::Value>(),
v8::PropertyHandlerFlags(0)));
The initial instance is created with:
v8::Handle<v8::Object> instance = ...>GetFunction()->NewInstance();
And added to the global scope as "group" of class "Group"
When executing "group.bar", I get in the interceptor GroupNamedQueryInterceptor. The getter GroupNamedPropertyGetter creates a new instance of same class "Group", and returns it.
So now "bar" is an instance of "Group" as well.
So I would expect "group.bar.bar" to come back in the interceptor a second time, but it does not!
However "group.bar.foo" accesses the second instance accessor just fine.
It feels really strange. I was hoping someone could unstuck me.
Thanks in advance!
alex