-
Notifications
You must be signed in to change notification settings - Fork 504
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 V8 deprecation warnings #568
Conversation
@@ -37,7 +37,11 @@ Factory<v8::Boolean>::New(bool value) { | |||
|
|||
Factory<v8::BooleanObject>::return_t | |||
Factory<v8::BooleanObject>::New(bool value) { | |||
#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) | |||
return v8::BooleanObject::New(v8::Isolate::GetCurrent(), value).As<v8::BooleanObject>(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
LGTM with a style nit. |
@bnoordhuis The |
What about |
Hmm, I wasn't seeing a warning for that one. I found these warnings by compiling an arbitrary native module with warnings enabled. Is there an easy way to exercise the full API to make sure I've got all the deprecations? It looks like |
The test suite covers most, but it is far from complete. The removed functionality should be reimplemented without breaking the API. Functional equivalence with no unwanted side effects. Cloning an array element should be fairly straightforward, as it only needs special logic for |
@kkoopa I've got a reimplementation of |
Sounds good. IsFirstPass might be reworkable by adding a constant boolean template parameter to the function, essentially turning it into two functions. On May 10, 2016 2:39:36 AM GMT+03:00, Matthew Loring notifications@github.com wrote:
|
@@ -217,7 +217,13 @@ NAN_INLINE Maybe<int> GetEndColumn(v8::Local<v8::Message> msg) { | |||
NAN_INLINE MaybeLocal<v8::Object> CloneElementAt( | |||
v8::Local<v8::Array> array | |||
, uint32_t index) { | |||
#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) | |||
v8::EscapableHandleScope handle_scope(v8::Isolate::GetCurrent()); | |||
v8::Local<v8::Object> elem = array->Get(index)->ToObject()->Clone(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Current deprecation warnings on Node v6 are SetAccessor, CloneElementAt, and BooleanObject::New.
return array->CloneElementAt(GetCurrentContext(), index); | ||
v8::Local<v8::Context> context = GetCurrentContext(); | ||
#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) | ||
v8::EscapableHandleScope handle_scope(v8::Isolate::GetCurrent()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@kkoopa Do you want any further changes on this PR? |
You could escape the scope before returning on line 233, other than that it looks good to merge. However, I have been waiting for someone to review #569, since it also is necessary to avoid deprecation warnings. |
All fixed. |
Current deprecation warnings on Node v6 are SetAccessor, CloneElementAt,
and BooleanObject::New.