Skip to content

Commit c83e33e

Browse files
authored
Merge pull request #360 from regseb/promise
fix: Replace nextTick by setImmediate.
2 parents 848d4eb + 5ea44f0 commit c83e33e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/binding.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function maybeCallback(callback, ctx, thisArg, func) {
5252
err = e;
5353
}
5454
return new Promise(function (resolve, reject) {
55-
process.nextTick(function () {
55+
setImmediate(function () {
5656
if (err) {
5757
reject(err);
5858
} else {
@@ -66,7 +66,7 @@ function maybeCallback(callback, ctx, thisArg, func) {
6666
} catch (e) {
6767
err = e;
6868
}
69-
process.nextTick(function () {
69+
setImmediate(function () {
7070
if (val === undefined) {
7171
callback(err);
7272
} else {

0 commit comments

Comments
 (0)