Browse Source

lib: move deprecationWarned var

The variable deprecationWarned currently looks a little misplaced. It is
used in emitWarning but declared after it. This commit suggest moving
the var to the beginning of the function.

PR-URL: https://github.com/nodejs/node/pull/14769
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Daniel Bevenius 7 years ago
parent
commit
170ff0e4bb
  1. 4
      lib/internal/process/promises.js

4
lib/internal/process/promises.js

@ -14,6 +14,8 @@ function getAsynchronousRejectionWarningObject(uid) {
}
function setupPromises(scheduleMicrotasks) {
let deprecationWarned = false;
process._setupPromises(function(event, promise, reason) {
if (event === promiseRejectEvent.unhandled)
unhandledRejection(promise, reason);
@ -73,7 +75,7 @@ function setupPromises(scheduleMicrotasks) {
'DeprecationWarning', 'DEP0018');
}
}
var deprecationWarned = false;
function emitPendingUnhandledRejections() {
let hadListeners = false;
while (pendingUnhandledRejections.length > 0) {

Loading…
Cancel
Save