mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user