Skip to content

Commit ac1b81a

Browse files
danbevaddaleax
authored andcommitted
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: #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]>
1 parent e4854fc commit ac1b81a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/process/promises.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ function getAsynchronousRejectionWarningObject(uid) {
1414
}
1515

1616
function setupPromises(scheduleMicrotasks) {
17+
let deprecationWarned = false;
18+
1719
process._setupPromises(function(event, promise, reason) {
1820
if (event === promiseRejectEvent.unhandled)
1921
unhandledRejection(promise, reason);
@@ -73,7 +75,7 @@ function setupPromises(scheduleMicrotasks) {
7375
'DeprecationWarning', 'DEP0018');
7476
}
7577
}
76-
var deprecationWarned = false;
78+
7779
function emitPendingUnhandledRejections() {
7880
let hadListeners = false;
7981
while (pendingUnhandledRejections.length > 0) {

0 commit comments

Comments
 (0)