From f135a8972ab134796536d9b59c32246b26e5d066 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Sat, 24 Oct 2015 23:56:49 -0200 Subject: [PATCH 1/3] doc: add note about timeout delay > TIMEOUT_MAX When setTimeout() and setInterval() are called with `delay` greater than TIMEOUT_MAX (2147483647), the supplied value is ignored and 1 is used instead. This adds a note about this in the timers docs. --- doc/api/timers.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown index ed7da5076a791f..c7ed6d2bdbaa26 100644 --- a/doc/api/timers.markdown +++ b/doc/api/timers.markdown @@ -16,6 +16,8 @@ It is important to note that your callback will probably not be called in exactl the callback will fire, nor of the ordering things will fire in. The callback will be called as close as possible to the time specified. +To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days), the timeout is executed immediately, as if the `delay` was set to 1. + ## clearTimeout(timeoutObject) Prevents a timeout from triggering. @@ -26,6 +28,8 @@ To schedule the repeated execution of `callback` every `delay` milliseconds. Returns a `intervalObject` for possible use with `clearInterval()`. Optionally you can also pass arguments to the callback. +To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days), Node.js will use 1 as the `delay`. + ## clearInterval(intervalObject) Stops an interval from triggering. From b46fe3c35404f6c3b0f05fb25d1e891ff00befae Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Sun, 25 Oct 2015 01:22:24 -0200 Subject: [PATCH 2/3] doc: add note about timeout delay < 1 --- doc/api/timers.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown index c7ed6d2bdbaa26..c3023ee3de7fb7 100644 --- a/doc/api/timers.markdown +++ b/doc/api/timers.markdown @@ -16,7 +16,7 @@ It is important to note that your callback will probably not be called in exactl the callback will fire, nor of the ordering things will fire in. The callback will be called as close as possible to the time specified. -To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days), the timeout is executed immediately, as if the `delay` was set to 1. +To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days) or less than 1, the timeout is executed immediately, as if the `delay` was set to 1. ## clearTimeout(timeoutObject) @@ -28,7 +28,7 @@ To schedule the repeated execution of `callback` every `delay` milliseconds. Returns a `intervalObject` for possible use with `clearInterval()`. Optionally you can also pass arguments to the callback. -To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days), Node.js will use 1 as the `delay`. +To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the `delay`. ## clearInterval(intervalObject) From ed67c974407a86ff7a656e8ba3f82dde8e160cdc Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Tue, 27 Oct 2015 16:21:54 -0200 Subject: [PATCH 3/3] Wrap at 80 chars --- doc/api/timers.markdown | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown index c3023ee3de7fb7..1dc456aaad925f 100644 --- a/doc/api/timers.markdown +++ b/doc/api/timers.markdown @@ -16,7 +16,9 @@ It is important to note that your callback will probably not be called in exactl the callback will fire, nor of the ordering things will fire in. The callback will be called as close as possible to the time specified. -To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days) or less than 1, the timeout is executed immediately, as if the `delay` was set to 1. +To follow browser behavior, when using delays larger than 2147483647 +milliseconds (approximately 25 days) or less than 1, the timeout is executed +immediately, as if the `delay` was set to 1. ## clearTimeout(timeoutObject) @@ -28,7 +30,9 @@ To schedule the repeated execution of `callback` every `delay` milliseconds. Returns a `intervalObject` for possible use with `clearInterval()`. Optionally you can also pass arguments to the callback. -To follow browser behavior, when using delays larger than 2147483647 milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the `delay`. +To follow browser behavior, when using delays larger than 2147483647 +milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the +`delay`. ## clearInterval(intervalObject)