-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove deprecated v8::Handle to upgrade to node@12 #23
Conversation
It seems to compile mostly, just hitting these 2 errors. ../src/pcsclite.cpp:19:40: error: too few arguments to function call, single argument 'context' was not specified ../src/pcsclite.cpp:20:73: error: too few arguments to function call, single argument 'context' was not specified |
the change is also needed for using electron 5.x: https://electronjs.org/blog/nodejs-native-addons-and-electron-5
Getting the same, see: nodejs/node-addon-examples#94 |
A few changes needed for new compatibility, Mostly Syntax -> First All Handles to Local, done in this pull GetFunction has changed constructor.Reset(tpl->GetFunction()); -> context / ToLocalChecked is now needed for GetFunction Local context = Nan::GetCurrentContext(); All occurences of ToString() and UTF8Value need to be changed v8::String::Utf8Value reader_name(info[0]->ToString()); -> Nan::Utf8String reader_name(Nan::To(info[0]).ToLocalChecked()); UInt32 ci->share_mode = info[0]->Uint32Value(); -> ci->share_mode = info[0]->Uint32Value(context).FromJust(); ToObject Local buffer_data = info[0]->ToObject(); -> Local buffer_data = Nan::To(info[0]).ToLocalChecked(); Think thats it |
Thanks! Have you tested it? Still getting errors. |
Yeah, which errors? maybe i missed one... |
Updated the PR, getting
|
uint32_t out_len = info[1]->Uint32Value(); uint32_t protocol = info[2]->Uint32Value(); Local in_buf = info[0]->ToObject(); DWORD control_code = info[1]->Uint32Value(); Local out_buf = info[2]->ToObject(); If you need context . exaxmples 1,2,4 needs to be a the top of the function... Give that a go. |
Did it all here |
Hi @zy4, Thank you very much for your PR. In the end I merged the #26 from @jimmythesaint82 as it was more complete and up-to-date. And now there is #27 that addresses the remaining issues. Nevertheless, I really appreciate the work you did on this. 👍 Thanks again. |
the change is also needed for using electron 5.x: https://electronjs.org/blog/nodejs-native-addons-and-electron-5