Closed SomeoneWeird closed 9 years ago
@rvagg this looks good to me
Adding to the list: https://github.com/nodejs/node/issues/2798. Btw, this PR fixes #59.
@kkoopa Thanks! I'll fix them up tomorrow when I get a chance :+1:
sorry I haven't had a chance to review this, if @kkoopa is happy then I am, @julianduque has publish rights to push a new one out
@SomeoneWeird let me know when changes from @kkoopa are ready and I'll bump and publish
@julianduque would you mind adding "Adam Brady" (a.k.a. @SomeoneWeird) to both the README and credits.txt before publishing?
@kkoopa Okay, I'm not really up on the best practice for what you should do about checking MaybeLocal
s. I pushed a commit that changes call me maybe to use Nan::To
, if you have any comments on how I should format it etc would be appreciated. If it looks alright, i'll change the others and squash everything so we can merge.
The NAN docs already explain what's what. https://github.com/nodejs/nan/blob/master/doc/maybe_types.md
Best practice is: Use ToLocalChecked
if the handle can be guaranteed not to be empty, otherwise use FromMaybe
or ToLocal
.
Okay I pushed another commit, if you can't tell I barely know C++, so any help would be appreciated. Is something like this better?
Looking better, some places should still use Nan::To<>
, the rest seems fine.
@kkoopa When changing void Init(Handle<Object> exports) {
to NAN_MODULE_INIT(Init) {
I seem to get
../myaddon.cc:10:12: error: use of undeclared identifier 'exports'
Nan::Set(exports, Nan::New("print").ToLocalChecked(),
Am I doing something wrong?
s/exports/target/
Alright, how does this look?
Apart from that one letter documentation fix, it looks good to me.
@kkoopa Awesome, thank you so much for your help :+1:
@julianduque Squashed, merge at will.
Awesome work @SomeoneWeird @kkoopa :)
@julianduque I just fixed an issue in e07cbab618a4d4c0e4b5408e3411ddbf61b259ba, are you able to publish 2.0.1
?
@SomeoneWeird published
I think I found everything that needed changing. Not sure what we want to do about explaining
MaybeLocal
vsLocal
, probably needs a sentence or two when we describe howNan::New
works initially?Also if there are any style things you want me to change etc just lemme know.
R=@rvagg