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

doc: deprecate NaN or negative number as delay to setTimeout and setInterval #53005

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,21 @@ For ciphers in GCM mode, the [`decipher.setAuthTag()`][] function accepts
authentication tags of any valid length (see [DEP0090](#DEP0090)). This behavior
is deprecated to better align with recommendations per [NIST SP 800-38D][].

### DEP0183: Passing `NaN` or a negative number as `delay` in `node:timers` functions

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/53005
description: Documentation-only deprecation.
-->

Type: Documentation-only

Calling `setTimeout` or `setInterval` with `NaN` or a negative number will
result the process emitting a warning, the warning will only be emitted once per
process.

[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
[RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4
Expand Down
6 changes: 6 additions & 0 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ This method has a custom variant for promises that is available using
<!-- YAML
added: v0.0.1
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/53005
description: Passing `NaN` or a negative number as `delay` is deprecated.
- version: v18.0.0
pr-url: https://github.com/nodejs/node/pull/41678
description: Passing an invalid callback to the `callback` argument
Expand Down Expand Up @@ -252,6 +255,9 @@ This method has a custom variant for promises that is available using
<!-- YAML
added: v0.0.1
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/53005
description: Passing `NaN` or a negative number as `delay` is deprecated.
- version: v18.0.0
pr-url: https://github.com/nodejs/node/pull/41678
description: Passing an invalid callback to the `callback` argument
Expand Down