Skip to content

Commit 45371d3

Browse files
committed
Escape pass-through callback result
1 parent e173941 commit 45371d3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/command.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ AerospikeCommand::Callback(const int argc, Local<Value> argv[])
7878
Local<Value>
7979
AerospikeCommand::ErrorCallback()
8080
{
81-
Nan::HandleScope scope;
81+
Nan::EscapableHandleScope scope;
8282

8383
if (err.code <= AEROSPIKE_ERR_CLIENT) {
8484
as_v8_error(log, "Client error in %s command: %s [%d]", cmd.c_str(), err.message, err.code);
@@ -87,29 +87,29 @@ AerospikeCommand::ErrorCallback()
8787
}
8888

8989
Local<Value> args[] = { error_to_jsobject(&err, log) };
90-
return Callback(1, args);
90+
return scope.Escape(Callback(1, args));
9191
}
9292

9393
Local<Value>
9494
AerospikeCommand::ErrorCallback(as_error* error)
9595
{
96-
Nan::HandleScope scope;
96+
Nan::EscapableHandleScope scope;
9797

9898
as_error_copy(&err, error);
9999

100-
return ErrorCallback();
100+
return scope.Escape(ErrorCallback());
101101
}
102102

103103
Local<Value>
104104
AerospikeCommand::ErrorCallback(as_status code, const char* func, const char* file,
105105
uint32_t line, const char* fmt, ...)
106106
{
107-
Nan::HandleScope scope;
107+
Nan::EscapableHandleScope scope;
108108

109109
va_list args;
110110
va_start(args, fmt);
111111
as_error_setallv(&err, code, func, file, line, fmt, args);
112112
va_end(args);
113113

114-
return ErrorCallback();
114+
return scope.Escape(ErrorCallback());
115115
}

0 commit comments

Comments
 (0)