From 45371d343064c8ad7717d23527c6f7103d431535 Mon Sep 17 00:00:00 2001 From: Jan Hecking Date: Wed, 31 Oct 2018 17:16:51 +0800 Subject: [PATCH] Escape pass-through callback result --- src/main/command.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/command.cc b/src/main/command.cc index ffda3907b..bfbcc99bc 100644 --- a/src/main/command.cc +++ b/src/main/command.cc @@ -78,7 +78,7 @@ AerospikeCommand::Callback(const int argc, Local argv[]) Local AerospikeCommand::ErrorCallback() { - Nan::HandleScope scope; + Nan::EscapableHandleScope scope; if (err.code <= AEROSPIKE_ERR_CLIENT) { as_v8_error(log, "Client error in %s command: %s [%d]", cmd.c_str(), err.message, err.code); @@ -87,29 +87,29 @@ AerospikeCommand::ErrorCallback() } Local args[] = { error_to_jsobject(&err, log) }; - return Callback(1, args); + return scope.Escape(Callback(1, args)); } Local AerospikeCommand::ErrorCallback(as_error* error) { - Nan::HandleScope scope; + Nan::EscapableHandleScope scope; as_error_copy(&err, error); - return ErrorCallback(); + return scope.Escape(ErrorCallback()); } Local AerospikeCommand::ErrorCallback(as_status code, const char* func, const char* file, uint32_t line, const char* fmt, ...) { - Nan::HandleScope scope; + Nan::EscapableHandleScope scope; va_list args; va_start(args, fmt); as_error_setallv(&err, code, func, file, line, fmt, args); va_end(args); - return ErrorCallback(); + return scope.Escape(ErrorCallback()); }