Skip to content

Commit

Permalink
Update NAN 2.10 and change deprecated MakeCallback() method
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbj committed May 22, 2018
1 parent 3a8fcc4 commit 13680a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"url": "git://github.com/oracle/node-oracledb.git"
},
"dependencies": {
"nan": "~2.8.0"
"nan": "~2.10.0"
},
"devDependencies": {
"mocha": "^2.4.5",
Expand Down
7 changes: 5 additions & 2 deletions src/njsCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,11 @@ void njsBaton::AsyncAfterWorkCallback(uv_work_t *req, int status)
delete baton;

// make JS callback
Nan::MakeCallback(Nan::GetCurrentContext()->Global(), callback,
static_cast<int>(numCallbackArgs), callbackArgs);
Nan::AsyncResource *asyncResource =
new Nan::AsyncResource("node-oracledb");
asyncResource->runInAsyncScope(Nan::GetCurrentContext()->Global(),
callback, static_cast<int>(numCallbackArgs), callbackArgs);
delete asyncResource;

// we no longer need the callback args
delete [] callbackArgs;
Expand Down

0 comments on commit 13680a6

Please sign in to comment.