Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timers: Fail early when callback is not a function #4362

Closed
wants to merge 1 commit into from

Commits on Dec 25, 2015

  1. timers: Fail early when callback is not a function

    `setTimeout()`, `setInterval()` and `setIntermediate` currently
    throw errors when receiving non-function objects as their first
    argument, but only do so when trying to execute the callback,
    i.e. after the waited time has passed. This may complicate
    debugging when a lot of calls to `setTimeout()`/etc. are involved,
    so failing as early as possible seems like a good idea.
    
    `setTimeout()` historically ignored an falsy first
    argument, while the other functions do not and throw instead.
    This patch changes this behaviour to make all three match and
    adds remarks in the corresponding documentation.
    addaleax committed Dec 25, 2015
    Configuration menu
    Copy the full SHA
    8b52afd View commit details
    Browse the repository at this point in the history