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 <info@bnoordhuis.nl>
  • Loading branch information
ofrobots authored and Ali Sheikh committed Mar 4, 2016
1 parent f7224ca commit 95ebc74
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 95ebc74

Please sign in to comment.