From 38267bba6661bd5f1bbdb24695db532a4b10f954 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 20 Feb 2018 05:21:05 +0100 Subject: [PATCH 1/2] src: fix deprecation warning in node_perf.cc Currently the following deprecation warning is produced when compiling node_perf.cc: ./src/node_perf.cc:91:11: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] node::MakeCallback(env->isolate(), ^ ../src/node.h:172:50: note: 'MakeCallback' has been explicitly marked deprecated here NODE_EXTERN v8::Local MakeCallback( ^ 1 warning generated. This commit adds an async_context to the call and checks the maybe result. --- src/node_perf.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_perf.cc b/src/node_perf.cc index 48b8d02b79facc..8ee805a8382c4e 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -91,7 +91,8 @@ void PerformanceEntry::Notify(Environment* env, node::MakeCallback(env->isolate(), env->process_object(), env->performance_entry_callback(), - 1, &object); + 1, &object, + node::async_context{0, 0}).ToLocalChecked(); } } From 69c461f32037243b080e852dbb7c8a247896657a Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 20 Feb 2018 05:41:28 +0100 Subject: [PATCH 2/2] test: fix deprecation warning in binding.cc Currently, the make-callback-domain-warning addon generates the following warning: ../binding.cc:22:9: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] node::MakeCallback(isolate, recv, method, 0, nullptr); ^ ../../../../src/node.h:172:50: note: 'MakeCallback' has been explicitly marked deprecated here NODE_EXTERN v8::Local MakeCallback( ^ 1 warning generated. This commit fixes this warning. --- test/addons/make-callback-domain-warning/binding.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/addons/make-callback-domain-warning/binding.cc b/test/addons/make-callback-domain-warning/binding.cc index c42166c7455277..d02c8f517661eb 100644 --- a/test/addons/make-callback-domain-warning/binding.cc +++ b/test/addons/make-callback-domain-warning/binding.cc @@ -19,7 +19,8 @@ void MakeCallback(const FunctionCallbackInfo& args) { Local recv = args[0].As(); Local method = args[1].As(); - node::MakeCallback(isolate, recv, method, 0, nullptr); + node::MakeCallback(isolate, recv, method, 0, nullptr, + node::async_context{0, 0}); } void Initialize(Local exports) {