Hi, I've looked through v8::ObjectTemplate::SetAccessCheckCallbacks docs and can't fully get how it callbacks used:
/** * Sets access check callbacks on the object template and enables * access checks. * * When accessing properties on instances of this object template, * the access check callback will be called to determine whether or * not to allow cross-context access to the properties. */ void SetAccessCheckCallbacks(NamedSecurityCallback named_handler, IndexedSecurityCallback indexed_handler, Local<Value> data = Local<Value >()); /** * Returns true if cross-context access should be allowed to the named * property with the given key on the host object. */ typedef bool (*NamedSecurityCallback)(Local<Object> host, Local<Value> key, AccessType type, Local<Value> data); /** * Returns true if cross-context access should be allowed to the indexed * property with the given index on the host object. */ typedef bool (*IndexedSecurityCallback)(Local<Object> host, uint32_t index , AccessType type, Local<Value> data);Enter code here... I tried to set both named_handler and indexed_handler, but it looks like only named_handler called. Also, I didn't find indexed_handler usage in v8 tests. Other thing that I didn't get is that "key" argument in NamedSecurityCal lback in my cases is "undefined" (key.IsUndefined() == true), and I also didn't find it use cases in test. As an example TEST(PrototypeGetterAccessCheck) test case from tests-accessors.cc was used. Can someone please provide explanations on v8::ObjectTemplate::SetAccessCheckCallbacks usage and on both handler type and probably point me on what I get wrong and maybe suggest some additional readings. Thanks. -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
