diff --git a/lib/internal/timers.js b/lib/internal/timers.js index dac5938eabd7df..94ef2c0cc7d02a 100644 --- a/lib/internal/timers.js +++ b/lib/internal/timers.js @@ -173,6 +173,9 @@ class Timeout { ' a 32-bit signed integer.' + '\nTimeout duration was set to 1.', 'TimeoutOverflowWarning'); + } else if (after < 0) { + process.emitWarning(`${after} is a negative number.` + + '\nTimeout duration was set to 1.'); } after = 1; // Schedule on next tick, follows browser behavior }