You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current implementation, if we want to make a readonly property,
we should pass empty setter that is actual function but has no body
as follows:
void HelloSetter(const Npai::CallbackInfo& info,
const Npai::Value& value) {
// This is an empty setter to make a readonly property.
// Do nothing
}
InstanceAccessor("hello_property", &HelloGetter, &HelloSetter);
If we allows taking `nullptr` as the argument, we can simplify user's
code more as follows:
InstanceAccessor("hello_property", &HelloGetter, nullptr);
Currently, above code makes a crash. So, this patch makes
InstanceAccessor() take `nullptr` as the argument and then add some
tests for them.
PR-URL: #159
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Jason Ginchereau <[email protected]>
0 commit comments