Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremiah Senkpiel <fishrock123@rocketmail.com>2018-12-04 04:41:58 +0300
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2019-01-29 03:25:07 +0300
commita7c66b6aaeb8132540abee12ffa9ac1c1fa2f373 (patch)
tree564283992698f1a73604169deb15d458041565d7 /doc/api/timers.md
parenta0419dd8ca66733e7a4592d98d4f4ebe2f2762e3 (diff)
timers: truncate decimal values
Reverts some timers behavior back to as it was before 2930bd1317d15d12738a4896c0a6c05700411b47 That commit introduced an unintended change which allowed non-integer timeouts to actually exist since the value is no longer converted to an integer via a TimeWrap handle directly. Even with the fix in e9de43549843da9f4f081cce917945878967df7 non-integer timeouts are still indeterministic, because libuv does not support them. This fixes the issue by emulating the old behavior: truncate the `_idleTimeout` before using it. See comments in https://github.com/nodejs/node/pull/24214 for more background on this. PR-URL: https://github.com/nodejs/node/pull/24819 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/timers.md')
-rw-r--r--doc/api/timers.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/timers.md b/doc/api/timers.md
index 4a903b5f5ee..9460028928b 100644
--- a/doc/api/timers.md
+++ b/doc/api/timers.md
@@ -186,7 +186,7 @@ added: v0.0.1
Schedules repeated execution of `callback` every `delay` milliseconds.
When `delay` is larger than `2147483647` or less than `1`, the `delay` will be
-set to `1`.
+set to `1`. Non-integer delays are truncated to an integer.
If `callback` is not a function, a [`TypeError`][] will be thrown.
@@ -209,7 +209,7 @@ nor of their ordering. The callback will be called as close as possible to the
time specified.
When `delay` is larger than `2147483647` or less than `1`, the `delay`
-will be set to `1`.
+will be set to `1`. Non-integer delays are truncated to an integer.
If `callback` is not a function, a [`TypeError`][] will be thrown.