On Tue, Feb 20, 2018 at 12:49 PM, J Decker <
d3c...@gmail.com> wrote:
> (Oops hit enter too soon)
>
> node: '9.2.0',
> v8: '6.2.414.44-node.11',
>
> Local<Object> c = Object::New( isolate );
> c->SetAccessorProperty( String::NewFromUtf8( isolate, "password" )
> , Local<Function>()
> , Function::New( isolate, ControlObject::setEditFieldPassword )
> , DontDelete );
>
> This is an attempt to make a set-only property... SetAccessorProperty
> crashes on access of a NULL pointer.
That's essentially "you can't do that" code. JS doesn't really have a
concept of setter-only properties and that's reflected in the C++ API.
You can emulate it with a getter that returns undefined, that mimics
the behavior of `Object.defineProperty(obj, key, { set: set })`.