-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
lib: fix misleading argument of validateUint32 #53307
Merged
nodejs-github-bot
merged 1 commit into
nodejs:main
from
tniessen:lib-validateuint32-positive
Jun 5, 2024
Merged
lib: fix misleading argument of validateUint32 #53307
nodejs-github-bot
merged 1 commit into
nodejs:main
from
tniessen:lib-validateuint32-positive
Jun 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The type of the argument `positive` was declared as `boolean|number`, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either `0` or `1`, which happen to work as expected because they are interpreted as `false` and `true`, respectively. However, passing `2` would silently lead to unexpected behavior. Thus, strictly make the argument a boolean.
tniessen
added
the
lib / src
Issues and PRs related to general changes in the lib or src directory.
label
Jun 3, 2024
Review requested:
|
nodejs-github-bot
added
needs-ci
PRs that need a full CI run.
test_runner
Issues and PRs related to the test runner subsystem.
labels
Jun 3, 2024
tniessen
removed
the
test_runner
Issues and PRs related to the test runner subsystem.
label
Jun 3, 2024
lpinca
approved these changes
Jun 3, 2024
anonrig
approved these changes
Jun 3, 2024
tniessen
added
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
request-ci
Add this label to start a Jenkins CI on a PR.
labels
Jun 3, 2024
github-actions
bot
removed
the
request-ci
Add this label to start a Jenkins CI on a PR.
label
Jun 3, 2024
himself65
approved these changes
Jun 3, 2024
VoltrexKeyva
approved these changes
Jun 3, 2024
aduh95
approved these changes
Jun 3, 2024
H4ad
added
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Jun 5, 2024
nodejs-github-bot
removed
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Jun 5, 2024
Landed in 5469d04 |
RafaelGSS
pushed a commit
that referenced
this pull request
Jun 7, 2024
The type of the argument `positive` was declared as `boolean|number`, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either `0` or `1`, which happen to work as expected because they are interpreted as `false` and `true`, respectively. However, passing `2` would silently lead to unexpected behavior. Thus, strictly make the argument a boolean. PR-URL: #53307 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Merged
eliphazbouye
pushed a commit
to eliphazbouye/node
that referenced
this pull request
Jun 20, 2024
The type of the argument `positive` was declared as `boolean|number`, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either `0` or `1`, which happen to work as expected because they are interpreted as `false` and `true`, respectively. However, passing `2` would silently lead to unexpected behavior. Thus, strictly make the argument a boolean. PR-URL: nodejs#53307 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
bmeck
pushed a commit
to bmeck/node
that referenced
this pull request
Jun 22, 2024
The type of the argument `positive` was declared as `boolean|number`, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either `0` or `1`, which happen to work as expected because they are interpreted as `false` and `true`, respectively. However, passing `2` would silently lead to unexpected behavior. Thus, strictly make the argument a boolean. PR-URL: nodejs#53307 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
marco-ippolito
pushed a commit
that referenced
this pull request
Jul 19, 2024
The type of the argument `positive` was declared as `boolean|number`, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either `0` or `1`, which happen to work as expected because they are interpreted as `false` and `true`, respectively. However, passing `2` would silently lead to unexpected behavior. Thus, strictly make the argument a boolean. PR-URL: #53307 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
marco-ippolito
pushed a commit
that referenced
this pull request
Jul 19, 2024
The type of the argument `positive` was declared as `boolean|number`, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either `0` or `1`, which happen to work as expected because they are interpreted as `false` and `true`, respectively. However, passing `2` would silently lead to unexpected behavior. Thus, strictly make the argument a boolean. PR-URL: #53307 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
lib / src
Issues and PRs related to general changes in the lib or src directory.
needs-ci
PRs that need a full CI run.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The type of the argument
positive
was declared asboolean|number
, which is misleading because the function treats it as a boolean only. Some call sites even passed numbers, specifically, either0
or1
, which happen to work as expected because they are interpreted asfalse
andtrue
, respectively. However, passing2
would silently lead to unexpected behavior. Thus, strictly make the argument a boolean.