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

lib: fix misleading argument of validateUint32 #53307

Merged
Merged
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
4 changes: 2 additions & 2 deletions lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function testMatchesPattern(test, patterns) {

class TestPlan {
constructor(count) {
validateUint32(count, 'count', 0);
validateUint32(count, 'count');
this.expected = count;
this.actual = 0;
}
Expand Down Expand Up @@ -428,7 +428,7 @@ class Test extends AsyncResource {

switch (typeof concurrency) {
case 'number':
validateUint32(concurrency, 'options.concurrency', 1);
validateUint32(concurrency, 'options.concurrency', true);
this.concurrency = concurrency;
break;

Expand Down
2 changes: 1 addition & 1 deletion lib/internal/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const validateInt32 = hideStackFrames(
* @callback validateUint32
* @param {*} value
* @param {string} name
* @param {number|boolean} [positive=false]
* @param {boolean} [positive=false]
* @returns {asserts value is number}
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/v8.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function getHeapCodeStatistics() {

let heapSnapshotNearHeapLimitCallbackAdded = false;
function setHeapSnapshotNearHeapLimit(limit) {
validateUint32(limit, 'limit', 1);
validateUint32(limit, 'limit', true);
if (heapSnapshotNearHeapLimitCallbackAdded ||
getOptionValue('--heapsnapshot-near-heap-limit') > 0
) {
Expand Down
Loading