Skip to content

Commit

Permalink
call v8 function directly (fixes 2 of 3 failing tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Apr 1, 2016
1 parent b5f3392 commit 572fd27
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/handler.cpp
Expand Up @@ -159,15 +159,14 @@ namespace node_osmium {
return;
}
v8::Local<v8::Value> argv[1] = { new_external<TWrapped>(entity) };
Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(function), 1, argv);
Nan::New(function)->Call(Nan::GetCurrentContext()->Global(), 1, argv);
}

void call_callback(const Nan::Persistent<v8::Function>& function) {
if (function.IsEmpty()) {
return;
}

Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(function), 0, nullptr);
Nan::New(function)->Call(Nan::GetCurrentContext()->Global(), 0, nullptr);
}

void JSHandler::dispatch_entity(const osmium::OSMEntity& entity) const {
Expand Down

0 comments on commit 572fd27

Please sign in to comment.