-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Upgrade to Nan 2.0.0 #566
Upgrade to Nan 2.0.0 #566
Conversation
38ede95
to
913d18f
Compare
Sorry. I don't know how to make Travis-CI work correctly. But it's built and tested ok on my Windows, Linux and Mac. |
🍺 the commits can be squashed XD |
The failure is io.js 3.0.0 specific—maybe @rvagg can take a look and offer some insight. |
this is a compiler incompatibility, Travis runs on Ubuntu 12.04 and therefore has a GCC that doesn't support the newer C++ functionality being embraced by V8, so you need to upgrade it (tbh I don't know about clang and I see you have
Then under
(the On your builds you should see a gcc version of 4.8. Probably remove the |
Thanks @rvagg |
@@ -63,7 +63,7 @@ | |||
// - Jim Cline | |||
// - Jeff Kohn | |||
// - Todd Heckel | |||
// - Ullrich Poll�hne | |||
// - Ullrich Poll�hne |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
Adding to the list: nodejs/node#2798. |
Disabled 32bit build and dropped 0.8 because node-pre-gyp doesn't support 0.8 anymore. |
Bring back x86 builds on Travis-CI. |
|
||
OpenBaton* baton = new OpenBaton(); | ||
memset(baton, 0, sizeof(OpenBaton)); | ||
strcpy(baton->path, *path); | ||
baton->baudRate = options->Get(NanNew<v8::String>("baudRate"))->ToInt32()->Int32Value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove all ->Get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not removed. It's replace with Nan::Get
, which is said to be compatible with all V8 versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double ToLocalChecked seems redundant and expensive, are you sure its needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToLocalChecked
is introduced by the new Maybe
types, which fails at the point of null value. And there is another counterpart ToLocal
which doesn't do the check. I think the current convention is assuming options->Get
always return non-NULL value. So ToLocalChecked
is the safest replacement.
👍 Travis CI passed. Good to go? |
Looking forward to have this merged to use with latest node stable. |
I performed some tests with this PR on the BeagleBone Black with two different test setups.
|
baton->hupcl = options->Get(NanNew<v8::String>("hupcl"))->ToBoolean()->BooleanValue(); | ||
|
||
v8::Local<v8::Object> platformOptions = options->Get(NanNew<v8::String>("platformOptions"))->ToObject(); | ||
baton->baudRate = Nan::Get(options, Nan::New<v8::String>("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghostoy talking about this double tolocalchecked. Are we sure it needs to be checked twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not being, the "baudRate"
v8::String
is being checked first and then the v8::Value
that results from the Nan::Get()
has to be converted too.
See https://nodesource.com/blog/cpp-addons-for-nodejs-v4 for some details on MaybeLocal
types and why this garbage is needed (in short: blame Haskell).
This is missing the infrastructure update/buildout for Windows. That needs to be done in the appveyor.yml file. Will see if I can handle the update. |
Squashed, rebased and commited as 866e415 |
Upgrade to Nan 2.0.0 to support latest io.js 3.x