Skip to content

Commit

Permalink
Step 3.16: Handle successful invokation
Browse files Browse the repository at this point in the history
  • Loading branch information
DAB0mB committed Aug 29, 2018
1 parent a812319 commit 5af7f59
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/distance.cc
Expand Up @@ -6,14 +6,18 @@
using Nan::AsyncQueueWorker;
using Nan::AsyncWorker;
using Nan::Callback;
using Nan::HandleScope;
using Nan::New;
using Nan::Null;
using Nan::To;
using std::pow;
using std::sqrt;
using v8::Function;
using v8::Local;
using v8::Number;
using v8::Object;
using v8::String;
using v8::Value;

struct Point {
double x;
Expand Down Expand Up @@ -44,7 +48,14 @@ class DistanceWorker : public AsyncWorker {
}

void HandleOKCallback () {
HandleScope scope;

Local<Value> argv[] = {
Null(),
New<Number>(distance)
};

callback->Call(2, argv);
}
};

Expand Down

0 comments on commit 5af7f59

Please sign in to comment.