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: Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
  • Loading branch information
ofrobots authored and rvagg committed Mar 16, 2016
1 parent bfff07b commit 4f2c839
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 @@ -45,7 +45,7 @@ using v8::Uint8Array;
using v8::UnboundScript;
using v8::V8;
using v8::Value;
using v8::WeakCallbackData;
using v8::WeakCallbackInfo;


class ContextifyContext {
Expand All @@ -66,7 +66,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 @@ -304,10 +304,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 4f2c839

Please sign in to comment.