Skip to content

Commit

Permalink
Unified obtaining the function handle for 0.10 and 0.12.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndob committed Aug 28, 2015
1 parent e74cc6d commit 0e31a4a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/run_async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,9 @@ void callV8FunctionOnMainThread(uv_async_t* handle, int status)
Handle<Value> argv[1];
argv[0] = Nan::New(signalData->parameter).ToLocalChecked();

#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)
auto callbackHandle = Local<Function>::New(v8::Isolate::GetCurrent(), signalData->callback);
#else
auto callbackHandle = Nan::New(signalData->callback);
#endif

auto callbackHandle = Nan::New<Function>(signalData->callback);
auto retVal = callbackHandle->Call(Nan::GetCurrentContext()->Global(), 1, argv);

String::Utf8Value retString(retVal);
signalData->returnValue = std::string(*retString);

Expand Down

0 comments on commit 0e31a4a

Please sign in to comment.