Skip to content

Commit

Permalink
lib: move deprecationWarned var
Browse files Browse the repository at this point in the history
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: #14769
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
danbev committed Aug 14, 2017
1 parent 95c8df1 commit 170ff0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/process/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -73,7 +75,7 @@ function setupPromises(scheduleMicrotasks) {
'DeprecationWarning', 'DEP0018');
}
}
var deprecationWarned = false;

function emitPendingUnhandledRejections() {
let hadListeners = false;
while (pendingUnhandledRejections.length > 0) {
Expand Down

0 comments on commit 170ff0e

Please sign in to comment.