Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "Max Brunsfeld",
"license": "MIT",
"dependencies": {
"nan": "^2.10.0"
"nan": "^2.12.1"
},
"devDependencies": {
"mocha": "^6.0.1",
Expand Down
7 changes: 4 additions & 3 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Worker : public Nan::AsyncWorker {

void HandleOKCallback() {
Local<Value> argv[] = {Nan::New<Integer>(exit_code)};
callback->Call(1, argv);
callback->Call(1, argv, async_resource);
}
};

Expand All @@ -43,7 +43,8 @@ void SpawnAsAdmin(const Nan::FunctionCallbackInfo<Value>& info) {
return;
}

std::string command(*String::Utf8Value(info[0]));
Nan::Utf8String commandNan(info[0]);
std::string command(*commandNan, commandNan.length());

if (!info[1]->IsArray()) {
Nan::ThrowTypeError("Arguments must be an array");
Expand All @@ -60,7 +61,7 @@ void SpawnAsAdmin(const Nan::FunctionCallbackInfo<Value>& info) {
return;
}

args.push_back(std::string(*String::Utf8Value(js_arg)));
args.push_back(*Nan::Utf8String(js_arg));
}

bool test_mode = false;
Expand Down