Skip to content

Commit

Permalink
Merge pull request #287 from aerospike/node11-deprecation-warnings
Browse files Browse the repository at this point in the history
Fix deprecation warnings in Node 10.12 & 11 builds
  • Loading branch information
jhecking authored Nov 1, 2018
2 parents 716cd61 + 640bfd1 commit 608829b
Show file tree
Hide file tree
Showing 36 changed files with 177 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ image:
platform: x64
environment:
matrix:
- nodejs_version: "10"
- nodejs_version: "8"
- nodejs_version: "6"
- nodejs_version: "4"

install:
- ps: Install-Product node $env:nodejs_version $env:platform
Expand Down
13 changes: 13 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@
'src/include',
"<!(node -e \"require('nan')\")",
],
'configurations': {
'Release': {
"cflags": [
"-Wno-deprecated-declarations",
],
"xcode_settings": {
"OTHER_CFLAGS": [
"-Wno-deprecated-declarations",
],
},
'msvs_disabled_warnings': [4996],
},
},
'conditions': [
['OS=="linux"',{
'libraries': [
Expand Down
4 changes: 2 additions & 2 deletions src/main/aerospike.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ NAN_METHOD(register_as_event_loop)

as_policy_event policy;
as_policy_event_init(&policy);
eventpolicy_from_jsobject(&policy, info[0]->ToObject(), &g_log_info);
eventpolicy_from_jsobject(&policy, info[0].As<Object>(), &g_log_info);

as_event_loop* loop;
as_error err;
Expand Down Expand Up @@ -76,7 +76,7 @@ NAN_METHOD(setDefaultLogging)
{
Nan::HandleScope();
if (info[0]->IsObject()){
if (log_from_jsobject(&g_log_info, info[0]->ToObject()) == AS_NODE_PARAM_OK) {
if (log_from_jsobject(&g_log_info, info[0].As<Object>()) == AS_NODE_PARAM_OK) {
if (g_log_info.level < 0) {
// common logging does not support log level "OFF"
as_log_set_level(AS_LOG_LEVEL_ERROR);
Expand Down
2 changes: 1 addition & 1 deletion src/main/async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ bool async_scan_listener(as_error* err, as_record* record, void* udata, as_event

bool continue_scan = true;
if (result->IsBoolean()) {
continue_scan = result->ToBoolean()->Value();
continue_scan = Nan::To<bool>(result).FromJust();
as_v8_debug(log, "Async scan callback returned: %s", continue_scan ? "true" : "false");
}
return continue_scan;
Expand Down
28 changes: 13 additions & 15 deletions src/main/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,16 @@ NAN_METHOD(AerospikeClient::New)
as_config config;
as_config_init(&config);

if (info[0]->IsObject()) {
Local<Value> v8_log_info = info[0]->ToObject()->Get(Nan::New("log").ToLocalChecked()) ;
if (v8_log_info->IsObject()) {
log_from_jsobject(client->log, v8_log_info->ToObject());
}
Local<Object> v8Config = info[0].As<Object>();

Local<Value> v8LogInfo = v8Config->Get(Nan::New("log").ToLocalChecked()) ;
if (v8LogInfo->IsObject()) {
log_from_jsobject(client->log, v8LogInfo.As<Object>());
}

if (info[0]->IsObject()) {
int result = config_from_jsobject(&config, info[0]->ToObject(), client->log);
if (result != AS_NODE_PARAM_OK) {
Nan::ThrowError("Invalid client configuration");
}
int result = config_from_jsobject(&config, v8Config, client->log);
if (result != AS_NODE_PARAM_OK) {
Nan::ThrowError("Invalid client configuration");
}

aerospike_init(client->as, &config);
Expand Down Expand Up @@ -159,8 +157,8 @@ NAN_METHOD(AerospikeClient::AddSeedHost)
TYPE_CHECK_REQ(info[0], IsString, "hostname must be a string");
TYPE_CHECK_REQ(info[1], IsNumber, "port must be a number");

Nan::Utf8String hostname(info[0]->ToString());
uint16_t port = (uint16_t) info[1]->ToInteger()->Value();
Nan::Utf8String hostname(info[0].As<String>());
uint16_t port = (uint16_t) Nan::To<uint32_t>(info[1]).FromJust();

as_cluster_add_seed(client->as->cluster, *hostname, NULL, port);
}
Expand All @@ -176,8 +174,8 @@ NAN_METHOD(AerospikeClient::RemoveSeedHost)
TYPE_CHECK_REQ(info[0], IsString, "hostname must be a string");
TYPE_CHECK_REQ(info[1], IsNumber, "port must be a number");

Nan::Utf8String hostname(info[0]->ToString());
uint16_t port = (uint16_t) info[1]->ToInteger()->Value();
Nan::Utf8String hostname(info[0].As<String>());
uint16_t port = (uint16_t) Nan::To<uint32_t>(info[1]).FromJust();

as_cluster_remove_seed(client->as->cluster, *hostname, port);
}
Expand All @@ -186,7 +184,7 @@ NAN_METHOD(AerospikeClient::SetLogLevel)
{
AerospikeClient* client = Nan::ObjectWrap::Unwrap<AerospikeClient>(info.Holder());
if (info[0]->IsObject()) {
log_from_jsobject(client->log, info[0]->ToObject());
log_from_jsobject(client->log, info[0].As<Object>());
}
info.GetReturnValue().Set(info.Holder());
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/commands/apply_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ NAN_METHOD(AerospikeClient::ApplyAsync)
char* udf_module = NULL;
char* udf_function = NULL;

if (key_from_jsobject(&key, info[0]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (key_from_jsobject(&key, info[0].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Key object invalid");
goto Cleanup;
}
key_initalized = true;

if (udfargs_from_jsobject(&udf_module, &udf_function, &udf_args, info[1]->ToObject(), log) != AS_NODE_PARAM_OK ) {
if (udfargs_from_jsobject(&udf_module, &udf_function, &udf_args, info[1].As<Object>(), log) != AS_NODE_PARAM_OK ) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "UDF args object invalid");
goto Cleanup;
}

if (info[2]->IsObject()) {
if (applypolicy_from_jsobject(&policy, info[2]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (applypolicy_from_jsobject(&policy, info[2].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid");
goto Cleanup;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/commands/batch_exists.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ prepare(const Nan::FunctionCallbackInfo<Value> &info)

if (info[1]->IsObject()) {
cmd->policy = (as_policy_batch*) cf_malloc(sizeof(as_policy_batch));
if (batchpolicy_from_jsobject(cmd->policy, info[1]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (batchpolicy_from_jsobject(cmd->policy, info[1].As<Object>(), log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Batch policy parameter invalid");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/commands/batch_get.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ prepare(const Nan::FunctionCallbackInfo<v8::Value> &info)

if (info[1]->IsObject() ) {
cmd->policy = (as_policy_batch*) cf_malloc(sizeof(as_policy_batch));
if (batchpolicy_from_jsobject(cmd->policy, info[1]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (batchpolicy_from_jsobject(cmd->policy, info[1].As<Object>(), log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Batch policy parameter invalid");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/commands/batch_read_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NAN_METHOD(AerospikeClient::BatchReadAsync)
}

if (info[1]->IsObject()) {
if (batchpolicy_from_jsobject(&policy, info[1]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (batchpolicy_from_jsobject(&policy, info[1].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid");
free_batch_records(records);
goto Cleanup;
Expand Down
2 changes: 1 addition & 1 deletion src/main/commands/batch_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ prepare(const Nan::FunctionCallbackInfo<v8::Value> &info)

if (info[2]->IsObject() ) {
cmd->policy = (as_policy_batch*) cf_malloc(sizeof(as_policy_batch));
if (batchpolicy_from_jsobject(cmd->policy, info[2]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (batchpolicy_from_jsobject(cmd->policy, info[2].As<Object>(), log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Batch policy parameter invalid");
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/commands/exists_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ NAN_METHOD(AerospikeClient::ExistsAsync)
as_policy_read* p_policy = NULL;
as_status status;

if (key_from_jsobject(&key, info[0]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (key_from_jsobject(&key, info[0].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Key object invalid");
goto Cleanup;
}
key_initalized = true;

if (info[1]->IsObject()) {
if (readpolicy_from_jsobject(&policy, info[1]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (readpolicy_from_jsobject(&policy, info[1].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid");
goto Cleanup;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/commands/get_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ NAN_METHOD(AerospikeClient::GetAsync)
as_policy_read* p_policy = NULL;
as_status status = AEROSPIKE_ERR;

if (key_from_jsobject(&key, info[0]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (key_from_jsobject(&key, info[0].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Key object invalid");
goto Cleanup;
}
key_initalized = true;

if (info[1]->IsObject()) {
if (readpolicy_from_jsobject(&policy, info[1]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (readpolicy_from_jsobject(&policy, info[1].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid");
goto Cleanup;
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/commands/index_create.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,27 @@ prepare(const Nan::FunctionCallbackInfo<Value> &info)
IndexCreateCommand* cmd = new IndexCreateCommand(client, info[7].As<Function>());
LogInfo* log = client->log;

if (as_strlcpy(cmd->ns, *Nan::Utf8String(info[0]->ToString()), AS_NAMESPACE_MAX_SIZE) > AS_NAMESPACE_MAX_SIZE) {
if (as_strlcpy(cmd->ns, *Nan::Utf8String(info[0].As<String>()), AS_NAMESPACE_MAX_SIZE) > AS_NAMESPACE_MAX_SIZE) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Namespace exceeds max. length (%d)", AS_NAMESPACE_MAX_SIZE);
}

if (info[1]->IsString()) {
if (as_strlcpy(cmd->set, *Nan::Utf8String(info[1]->ToString()), AS_SET_MAX_SIZE) > AS_SET_MAX_SIZE) {
if (as_strlcpy(cmd->set, *Nan::Utf8String(info[1].As<String>()), AS_SET_MAX_SIZE) > AS_SET_MAX_SIZE) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Set exceeds max. length (%d)", AS_SET_MAX_SIZE);
}
}

if (as_strlcpy(cmd->bin, *Nan::Utf8String(info[2]->ToString()), AS_BIN_NAME_MAX_LEN) > AS_BIN_NAME_MAX_LEN) {
if (as_strlcpy(cmd->bin, *Nan::Utf8String(info[2].As<String>()), AS_BIN_NAME_MAX_LEN) > AS_BIN_NAME_MAX_LEN) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Bin name exceeds max. length (%d)", AS_BIN_NAME_MAX_LEN);
}

cmd->index = strdup(*Nan::Utf8String(info[3]->ToString()));
cmd->itype = (as_index_type) info[4]->ToInteger()->Value();
cmd->dtype = (as_index_datatype) info[5]->ToInteger()->Value();
cmd->index = strdup(*Nan::Utf8String(info[3].As<String>()));
cmd->itype = (as_index_type) Nan::To<int>(info[4]).FromJust();
cmd->dtype = (as_index_datatype) Nan::To<int>(info[5]).FromJust();

if (info[6]->IsObject()) {
cmd->policy = (as_policy_info*) cf_malloc(sizeof(as_policy_info));
if (infopolicy_from_jsobject(cmd->policy, info[6]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (infopolicy_from_jsobject(cmd->policy, info[6].As<Object>(), log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Policy parameter is invalid");
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/commands/index_remove.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ prepare(const Nan::FunctionCallbackInfo<Value> &info)
IndexRemoveCommand* cmd = new IndexRemoveCommand(client, info[3].As<Function>());
LogInfo* log = cmd->log = client->log;

if (as_strlcpy(cmd->ns, *Nan::Utf8String(info[0]->ToString()), AS_NAMESPACE_MAX_SIZE) > AS_NAMESPACE_MAX_SIZE) {
if (as_strlcpy(cmd->ns, *Nan::Utf8String(info[0].As<String>()), AS_NAMESPACE_MAX_SIZE) > AS_NAMESPACE_MAX_SIZE) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Namespace exceeds max. length (%d)", AS_NAMESPACE_MAX_SIZE);
}

cmd->index = strdup(*Nan::Utf8String(info[1]->ToString()));
cmd->index = strdup(*Nan::Utf8String(info[1].As<String>()));

if (info[2]->IsObject()) {
cmd->policy = (as_policy_info*)cf_malloc(sizeof(as_policy_info));
if(infopolicy_from_jsobject(cmd->policy, info[2]->ToObject(), log) != AS_NODE_PARAM_OK) {
if(infopolicy_from_jsobject(cmd->policy, info[2].As<Object>(), log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Policy parameter is invalid");
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/commands/info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ prepare(const Nan::FunctionCallbackInfo<v8::Value> &info)

if (info[0]->IsString()) {
cmd->request = (char*) cf_malloc(MAX_INFO_REQUEST_LEN);
size_t reqlen = as_strlcpy(cmd->request, *Nan::Utf8String(info[0]->ToString()), MAX_INFO_REQUEST_LEN);
size_t reqlen = as_strlcpy(cmd->request, *Nan::Utf8String(info[0].As<String>()), MAX_INFO_REQUEST_LEN);
if (reqlen > MAX_INFO_REQUEST_LEN) {
as_v8_info(log, "Info request exceeds max. length (%zu > %i): \"%s...\"", reqlen, MAX_INFO_REQUEST_LEN, cmd->request);
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Info request exceeds max. length");
Expand All @@ -70,14 +70,14 @@ prepare(const Nan::FunctionCallbackInfo<v8::Value> &info)
}

if (info[1]->IsObject()) {
if (host_from_jsobject(info[1]->ToObject(), &cmd->addr, &cmd->port, log) != AS_NODE_PARAM_OK) {
if (host_from_jsobject(info[1].As<Object>(), &cmd->addr, &cmd->port, log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Host parameter is invalid");
}
}

if (info[2]->IsObject()) {
cmd->policy = (as_policy_info*) cf_malloc(sizeof(as_policy_info));
if (infopolicy_from_jsobject(cmd->policy, info[2]->ToObject(), log) != AS_NODE_PARAM_OK ) {
if (infopolicy_from_jsobject(cmd->policy, info[2].As<Object>(), log) != AS_NODE_PARAM_OK ) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Policy parameter is invalid");
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/commands/info_foreach.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ prepare(const Nan::FunctionCallbackInfo<Value> &info)

if (info[0]->IsString()) {
cmd->request = (char*) malloc(INFO_REQUEST_LEN);
if (as_strlcpy(cmd->request, *Nan::Utf8String(info[0]->ToString()), INFO_REQUEST_LEN) > INFO_REQUEST_LEN) {
if (as_strlcpy(cmd->request, *Nan::Utf8String(info[0].As<String>()), INFO_REQUEST_LEN) > INFO_REQUEST_LEN) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Info request exceeds max. length (%d)", INFO_REQUEST_LEN);
}
} else {
Expand All @@ -104,7 +104,7 @@ prepare(const Nan::FunctionCallbackInfo<Value> &info)

if (info[1]->IsObject()) {
cmd->policy = (as_policy_info*) cf_malloc(sizeof(as_policy_info));
if (infopolicy_from_jsobject(cmd->policy, info[1]->ToObject(), log) != AS_NODE_PARAM_OK ) {
if (infopolicy_from_jsobject(cmd->policy, info[1].As<Object>(), log) != AS_NODE_PARAM_OK ) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Policy parameter is invalid");
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/commands/job_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ prepare(const Nan::FunctionCallbackInfo<Value> &info)
JobInfoCommand* cmd = new JobInfoCommand(client, info[3].As<Function>());
LogInfo* log = client->log;

cmd->job_id = info[0]->ToInteger()->Value();
cmd->module = strdup(*Nan::Utf8String(info[1]->ToString()));
cmd->job_id = Nan::To<int64_t>(info[0]).FromJust();
cmd->module = strdup(*Nan::Utf8String(info[1].As<String>()));

if (info[2]->IsObject()) {
cmd->policy = (as_policy_info*) cf_malloc(sizeof(as_policy_info));
if (infopolicy_from_jsobject(cmd->policy, info[2]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (infopolicy_from_jsobject(cmd->policy, info[2].As<Object>(), log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Policy parameter is invalid");
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/commands/operate_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NAN_METHOD(AerospikeClient::OperateAsync)
as_policy_operate* p_policy = NULL;
as_status status;

if (key_from_jsobject(&key, info[0]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (key_from_jsobject(&key, info[0].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Key object invalid");
goto Cleanup;
}
Expand All @@ -57,13 +57,13 @@ NAN_METHOD(AerospikeClient::OperateAsync)
operations_initalized = true;

if (info[2]->IsObject()) {
Local<Object> metadata = info[2]->ToObject();
Local<Object> metadata = info[2].As<Object>();
setTTL(metadata, &operations.ttl, log);
setGeneration(metadata, &operations.gen, log);
}

if (info[3]->IsObject()) {
if (operatepolicy_from_jsobject(&policy, info[3]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (operatepolicy_from_jsobject(&policy, info[3].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid");
goto Cleanup;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/commands/put_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,27 @@ NAN_METHOD(AerospikeClient::PutAsync)
as_policy_write* p_policy = NULL;
as_status status;

if (key_from_jsobject(&key, info[0]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (key_from_jsobject(&key, info[0].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Key object invalid");
goto Cleanup;
}
key_initalized = true;

if (recordbins_from_jsobject(&record, info[1]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (recordbins_from_jsobject(&record, info[1].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Record object invalid");
goto Cleanup;
}
record_initalized = true;

if (info[2]->IsObject()) {
if (recordmeta_from_jsobject(&record, info[2]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (recordmeta_from_jsobject(&record, info[2].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Meta object invalid");
goto Cleanup;
}
}

if (info[3]->IsObject()) {
if (writepolicy_from_jsobject(&policy, info[3]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (writepolicy_from_jsobject(&policy, info[3].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid");
goto Cleanup;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/commands/query_apply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ prepare(const Nan::FunctionCallbackInfo<v8::Value> &info)

if (info[3]->IsObject()) {
cmd->policy = (as_policy_query*) cf_malloc(sizeof(as_policy_query));
if (querypolicy_from_jsobject(cmd->policy, info[3]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (querypolicy_from_jsobject(cmd->policy, info[3].As<Object>(), log) != AS_NODE_PARAM_OK) {
return CmdSetError(cmd, AEROSPIKE_ERR_PARAM, "Policy parameter is invalid");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/commands/query_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ NAN_METHOD(AerospikeClient::QueryAsync)
setup_query(&query, info[0], info[1], info[2], log);

if (info[3]->IsObject()) {
if (querypolicy_from_jsobject(&policy, info[3]->ToObject(), log) != AS_NODE_PARAM_OK) {
if (querypolicy_from_jsobject(&policy, info[3].As<Object>(), log) != AS_NODE_PARAM_OK) {
CmdErrorCallback(cmd, AEROSPIKE_ERR_PARAM, "Policy object invalid");
goto Cleanup;
}
Expand Down
Loading

0 comments on commit 608829b

Please sign in to comment.