[node] NodeRequest inherits from Nan::AsyncWorker

drop NodeRequest::Create, move MakeCallback to NodeRequest::Execute

rework Respond -> HandleCallback

modern NAN style updates
This commit is contained in:
Mike Morris
2016-07-12 18:37:28 -04:00
parent 480be63396
commit 7df0e459b6
7 changed files with 153 additions and 156 deletions

View File

@@ -42,7 +42,7 @@ NodeLogObserver::NodeLogObserver(v8::Local<v8::Object> target)
v8::Local<v8::Value> argv[] = { Nan::New("message").ToLocalChecked(), msg };
auto handle = Nan::New<v8::Object>(module);
auto emit = Nan::Get(handle, Nan::New("emit").ToLocalChecked()).ToLocalChecked()->ToObject();
auto emit = Nan::To<v8::Object>(Nan::Get(handle, Nan::New("emit").ToLocalChecked()).ToLocalChecked()).ToLocalChecked();
Nan::CallAsFunction(emit, handle, 2, argv);
})) {
Nan::HandleScope scope;