Skip to content

Commit

Permalink
Merge pull request #360 from regseb/promise
Browse files Browse the repository at this point in the history
fix: Replace nextTick by setImmediate.
  • Loading branch information
tschaub authored Oct 11, 2024
2 parents 848d4eb + 5ea44f0 commit c83e33e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function maybeCallback(callback, ctx, thisArg, func) {
err = e;
}
return new Promise(function (resolve, reject) {
process.nextTick(function () {
setImmediate(function () {
if (err) {
reject(err);
} else {
Expand All @@ -66,7 +66,7 @@ function maybeCallback(callback, ctx, thisArg, func) {
} catch (e) {
err = e;
}
process.nextTick(function () {
setImmediate(function () {
if (val === undefined) {
callback(err);
} else {
Expand Down

0 comments on commit c83e33e

Please sign in to comment.