Skip to content

Instantly share code, notes, and snippets.

@dnwe
Created April 20, 2016 22:03
Show Gist options
  • Save dnwe/129b20c14ee1e02a616e3ef131f8d1fe to your computer and use it in GitHub Desktop.
Save dnwe/129b20c14ee1e02a616e3ef131f8d1fe to your computer and use it in GitHub Desktop.
diff --git a/src/node.js b/src/node.js
index c194c23..afc8e23 100644
--- a/src/node.js
+++ b/src/node.js
@@ -473,25 +473,26 @@
function nextTick(callback) {
// on the way out, don't bother. it won't get fired anyway.
if (process._exiting)
return;
var args;
if (arguments.length > 1) {
args = [];
for (var i = 1; i < arguments.length; i++)
args.push(arguments[i]);
}
- nextTickQueue.push(new TickObject(callback, args));
+ const tickObj = new TickObject(callback, args)
+ nextTickQueue.push(tickObj);
tickInfo[kLength]++;
}
function emitPendingUnhandledRejections() {
var hadListeners = false;
while (pendingUnhandledRejections.length > 0) {
var promise = pendingUnhandledRejections.shift();
var reason = pendingUnhandledRejections.shift();
if (hasBeenNotifiedProperty.get(promise) === false) {
hasBeenNotifiedProperty.set(promise, true);
if (!process.emit('unhandledRejection', reason, promise)) {
// Nobody is listening.
@aceway
Copy link

aceway commented Mar 10, 2017

hi, @dnwe
I apply this patch to node-v4.8.0(on Debian8), but it does not work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment