Skip to content
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

Nan::Maybe<T> ToChecked not implemented for Node.js 6.x #851

Closed
LinusU opened this issue May 1, 2019 · 2 comments · Fixed by #852
Closed

Nan::Maybe<T> ToChecked not implemented for Node.js 6.x #851

LinusU opened this issue May 1, 2019 · 2 comments · Fixed by #852

Comments

@LinusU
Copy link
Contributor

LinusU commented May 1, 2019

I'm getting the following error when I fixing a warning that told me the return value of Get was unchecked.

../src/backend/ImageBackend.cc: In static member function ‘static void ImageBackend::Initialize(v8::Local<v8::Object>)’:
../src/backend/ImageBackend.cc:69:53: error: ‘Nan::Maybe<bool>’ has no member named ‘ToChecked’
            Nan::GetFunction(ctor).ToLocalChecked()).ToChecked();

Automattic/node-canvas#1415Travis CI jobs/526851510#L638

Is this something that should be added to nan_maybe_pre_43_inl.h?

@bnoordhuis
Copy link
Member

#852

kkoopa pushed a commit that referenced this issue May 16, 2019
* Add missing methods to Nan::Maybe<T>

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

* Fix cpplint warnings.

The code base is now `make lint`-clean again.
@LinusU
Copy link
Contributor Author

LinusU commented May 16, 2019

@kkoopa would love it if you could tag a release with this in ❤️ would like to get my PR to node-canvas moving forward 🐎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants