I don't really understand what this means, but it seems to be choosing to
call the getter because this function returns false:
bool LookupIterator::HolderIsReceiverOrHiddenPrototype() const {
DCHECK(has_property_ || state_ == INTERCEPTOR || state_ == JSPROXY);
// Optimization that only works if configuration_ is not mutable.
if (!check_prototype_chain()) return true;
DisallowHeapAllocation no_gc;
if (*receiver_ == *holder_) return true;
if (!receiver_->IsJSReceiver()) return false;
JSReceiver* current = JSReceiver::cast(*receiver_);
JSReceiver* object = *holder_;
if (!current->map()->has_hidden_prototype()) return false; <=== THIS IS
WHERE IT RETURNS
when called from Object::SetPropertyInternal
On Saturday, October 29, 2016 at 3:33:14 AM UTC-7, Zac Hansen wrote:
>
> I run the following javascript:
>
> var p = new Point(); p.foo = 5;
>
> where Point creates an object from an ObjectTemplate that has
> had SetHandler called on it. However, this calls my getter callback.
> Everything I've tried from javascript calls my getter callback.
>
> object_template->SetHandler(v8::NamedPropertyHandlerConfiguration(
> // Getter
> [](v8::Local<v8::Name> property_name,
> v8::PropertyCallbackInfo<v8::Value> const & info){
> printf("IN GETTER CALLBACK111 %s\n",
> *v8::String::Utf8Value(property_name));
> },
> // setter
> [](v8::Local<v8::Name> property_name,
> v8::Local<v8::Value> new_property_value,
> v8::PropertyCallbackInfo<v8::Value> const & info){
> printf("IN SETTER CALLBACK222 %s\n",
> *v8::String::Utf8Value(property_name));
> },
> nullptr, // query
> nullptr, // deleter
> nullptr, // enumerator
> v8::External::New(this->isolate, (void *)data),
> v8::PropertyHandlerFlags::kNonMasking)); // <== Tried
> with and without this
> };
>
>
> and prints out: IN GETTER CALLBACK111 foo
>
> I originally tried with the older API for string-only property names and
> had the same results.
>
> #define V8_MAJOR_VERSION 5
> #define V8_MINOR_VERSION 6
> #define V8_BUILD_NUMBER 0
> #define V8_PATCH_LEVEL 0
>
> on os x 10.11 clang 3.9
>
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" 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.