From 4f2c839d4675c6d0a003a5a3ede55db941164862 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Mon, 22 Feb 2016 20:57:50 -0800 Subject: [PATCH] contextify: replace deprecated SetWeak usage PR-URL: https://github.com/nodejs/node/pull/5392 Reviewed-By: Reviewed-By: bnoordhuis - Ben Noordhuis --- src/node_contextify.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 7675c2ec174f7d..b9529800ad3881 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -45,7 +45,7 @@ using v8::Uint8Array; using v8::UnboundScript; using v8::V8; using v8::Value; -using v8::WeakCallbackData; +using v8::WeakCallbackInfo; class ContextifyContext { @@ -66,7 +66,7 @@ class ContextifyContext { // Allocation failure or maximum call stack size reached if (context_.IsEmpty()) return; - context_.SetWeak(this, WeakCallback); + context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); context_.MarkIndependent(); } @@ -304,10 +304,8 @@ class ContextifyContext { } - template - static void WeakCallback(const WeakCallbackData& data) { + static void WeakCallback(const WeakCallbackInfo& data) { ContextifyContext* context = data.GetParameter(); - context->context_.ClearWeak(); delete context; }