From 87a0ac741215c7d5e0e241c058367b6a496a3c0a 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 82b14e468281cc..33f5e5b9a06ba9 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(); } @@ -305,10 +305,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; }