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
Add missing methods to Nan::Maybe<T> #852
Conversation
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.
Awesome! Thanks for the quick turn around on this 😍
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.
LGTM with a small nit
nan.h
Outdated
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ | ||
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) | ||
// Allow implicit conversions from v8::Maybe<T> to Nan::Maybe<T>. | ||
Maybe(const v8::Maybe<T>& that) |
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.
can you add a comment for the linter to suppress warnings about runtime/explicit
here
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.
Done, sorry about that. I added a second commit that fixes all the other style violations.
Nan::Maybe<T> was an alias for v8::Maybe<T> with most Node.js versions but that's problematic because v8::Maybe<T> has grown new methods over time that are missing in older versions. From now on we use our custom Maybe<T> implementation with all Node.js versions. This commit also adds the following missing methods: * Maybe<T>::Check() const * Maybe<T>::To(T*) const * Maybe<T>::ToChecked() const Fixes: #851
The code base is now `make lint`-clean again.
Even better. Thanks. |
@kkoopa Is there a reason you squashed the commits? Not that it really matters, I'm just curious. |
Nan::Maybe was an alias for v8::Maybe with most Node.js versions
but that's problematic because v8::Maybe has grown new methods over
time that are missing in older versions.
From now on we use our custom Maybe implementation with all Node.js
versions. This commit also adds the following missing methods:
Fixes: #851