node-addon-examples icon indicating copy to clipboard operation
node-addon-examples copied to clipboard

unify `1-getting-started/6_object_wrap` samples to implements the same logics.

Open UrielCh opened this issue 1 year ago • 0 comments

The 3 example in 1-getting-started/6_object_wrap do not implement the same addon.

  • Nan implement value() as a function
  • Napi implement value as a field
  • node-addon-api implement value() as a function

this PR implement value as a Read and Write field and add a getValue() as a function.

the 2 accessor (set and set) and the getter are now called in the addon.js.

the 3 addon.js files are now the same.

note: the NaN::InstanceAccessor wasn't use in any example before this PR.

UrielCh avatar Sep 10 '24 07:09 UrielCh