Skip to content

Add support for node@12 #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist: trusty
sudo: true

os:
Expand All @@ -10,6 +11,7 @@ node_js:
- 6
- 8
- 10
- 12

env:
global:
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ environment:
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"
- nodejs_version: "12"

branches:
only:
Expand Down
10 changes: 6 additions & 4 deletions src/NSFW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ NAN_MODULE_INIT(NSFW::Init) {
SetPrototypeMethod(tpl, "start", Start);
SetPrototypeMethod(tpl, "stop", Stop);

constructor.Reset(tpl->GetFunction());
Set(target, New<v8::String>("NSFW").ToLocalChecked(), tpl->GetFunction());
v8::Local<v8::Context> context = Nan::GetCurrentContext();
constructor.Reset(tpl->GetFunction(context).ToLocalChecked());
Set(target, New<v8::String>("NSFW").ToLocalChecked(), tpl->GetFunction(context).ToLocalChecked());
}

NAN_METHOD(NSFW::JSNew) {
Expand All @@ -174,8 +175,9 @@ NAN_METHOD(NSFW::JSNew) {
return ThrowError("Fourth argument of constructor must be a callback.");
}

uint32_t debounceMS = info[0]->Uint32Value();
v8::String::Utf8Value utf8Value(info[1]->ToString());
v8::Local<v8::Context> context = Nan::GetCurrentContext();
uint32_t debounceMS = info[0]->Uint32Value(context).FromJust();
Nan::Utf8String utf8Value(Nan::To<v8::String>(info[1]).ToLocalChecked());
std::string path = std::string(*utf8Value);
Callback *eventCallback = new Callback(info[2].As<v8::Function>());
Callback *errorCallback = new Callback(info[3].As<v8::Function>());
Expand Down
Loading