How implement change of argument of function by referrence with in N-API native method?

22 views
Skip to first unread message

Alexander Feodorov

unread,
May 1, 2018, 10:54:10 AM5/1/18
to nodejs
Hi, i a try use new N-API but have some troubles in implementation my possible simple idea.
I try change argument by referrence in native method but it not working as expected.
After return from native methor argument not changed.

napi_get_cb_info method has this documentation:
[out] argv: Buffer to which the napi_value representing the arguments are copied.

let o = {};


function proc(a) {
 a
.foo = 'bar';
}


proc
(o);


// { foo: 'bar' }
console
.log(o);


Reply all
Reply to author
Forward
0 new messages