0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
nodejs/doc
Anna Henningsen ac153bd2a6 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.

PR-URL: https://github.com/nodejs/node/pull/4362
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2016-01-04 14:56:19 +11:00
..
api timers: fail early when callback is not a function 2016-01-04 14:56:19 +11:00
api_assets doc: fix color of linked code blocks 2015-11-30 18:56:36 +01:00
ctc-meetings doc: add CTC meeting minutes 2015-10-28 2015-12-14 14:42:19 -08:00
tsc-meetings doc: add TSC meeting minutes 2015-10-21 2015-10-26 09:36:42 -07:00
full-white-stripe.jpg installer: fix installers for node.js rename 2015-08-23 17:59:43 -04:00
node.1 doc: update irc channels: #node.js and #node-dev 2015-12-14 19:14:20 -05:00
osx_installer_logo.png installer: fix installers for node.js rename 2015-08-23 17:59:43 -04:00
releases.md doc: copyedit releases.md 2015-12-23 20:26:47 -08:00
template.html node: rename from io.js to node 2015-08-23 17:59:43 -04:00
thin-white-stripe.jpg installer: fix installers for node.js rename 2015-08-23 17:59:43 -04:00