diff --git a/lib/internal/timers.js b/lib/internal/timers.js index dac5938eabd7df..a0df42ab79658c 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 }