I've written a very simple program exercising SetHandlers and get the
expected results, with setter being called, so it's clearly something in my
real program's particular code, but I've run the debugger as far down into
the v8 code as makes any amount of sense to me and don't understand what's
going on when it decides not to call the setter callback.
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.