Created
August 15, 2020 10:14
-
-
Save deepal/7eb115375caece69988319aea437d785 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Timeout(callback, after, args, isRepeat, isRefed) { | |
after *= 1; // Coalesce to number or NaN | |
if (!(after >= 1 && after <= TIMEOUT_MAX)) { | |
if (after > TIMEOUT_MAX) { | |
process.emitWarning(`${after} does not fit into` + | |
' a 32-bit signed integer.' + | |
'\nTimeout duration was set to 1.', | |
'TimeoutOverflowWarning'); | |
} | |
after = 1; // Schedule on next tick, follows browser behavior | |
} | |
// ....redacted | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment