Skip to content

Commit

Permalink
contextify: replace deprecated SetWeak usage
Browse files Browse the repository at this point in the history
PR-URL: #5392
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
ofrobots authored and Myles Borins committed May 20, 2016
1 parent 9e6d817 commit 8ebdcd6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ using v8::TryCatch;
using v8::UnboundScript;
using v8::V8;
using v8::Value;
using v8::WeakCallbackData;
using v8::WeakCallbackInfo;


class ContextifyContext {
Expand All @@ -64,7 +64,7 @@ class ContextifyContext {
// Allocation failure or maximum call stack size reached
if (context_.IsEmpty())
return;
context_.SetWeak(this, WeakCallback<Context>);
context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter);
context_.MarkIndependent();
}

Expand Down Expand Up @@ -302,10 +302,8 @@ class ContextifyContext {
}


template <class T>
static void WeakCallback(const WeakCallbackData<T, ContextifyContext>& data) {
static void WeakCallback(const WeakCallbackInfo<ContextifyContext>& data) {
ContextifyContext* context = data.GetParameter();
context->context_.ClearWeak();
delete context;
}

Expand Down

0 comments on commit 8ebdcd6

Please sign in to comment.