Skip to content

Commit

Permalink
src: fix deprecated SetWeak usage in base-object
Browse files Browse the repository at this point in the history
PR-URL: nodejs#5204
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
  • Loading branch information
ofrobots authored and Ali Sheikh committed Mar 3, 2016
1 parent ea4f27c commit bdbd3a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/base-object-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ inline Environment* BaseObject::env() const {

template <typename Type>
inline void BaseObject::WeakCallback(
const v8::WeakCallbackData<v8::Object, Type>& data) {
const v8::WeakCallbackInfo<Type>& data) {
Type* self = data.GetParameter();
self->persistent().Reset();
delete self;
Expand All @@ -53,7 +53,8 @@ inline void BaseObject::MakeWeak(Type* ptr) {
CHECK_GT(handle->InternalFieldCount(), 0);
Wrap(handle, ptr);
handle_.MarkIndependent();
handle_.SetWeak<Type>(ptr, WeakCallback<Type>);
handle_.SetWeak<Type>(ptr, WeakCallback<Type>,
v8::WeakCallbackType::kParameter);
}


Expand Down
2 changes: 1 addition & 1 deletion src/base-object.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BaseObject {

template <typename Type>
static inline void WeakCallback(
const v8::WeakCallbackData<v8::Object, Type>& data);
const v8::WeakCallbackInfo<Type>& data);

v8::Persistent<v8::Object> handle_;
Environment* env_;
Expand Down

0 comments on commit bdbd3a2

Please sign in to comment.