Skip to content

Commit

Permalink
process: replace validator
Browse files Browse the repository at this point in the history
Replace the `validateFunction()` validator with the
`validateCallback()` validator to validate callbacks and keep
consistency.
  • Loading branch information
VoltrexKeyva committed Jan 23, 2022
1 parent b09d1f4 commit 728965f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/internal/process/task_queues.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const FixedQueue = require('internal/fixed_queue');

const {
validateCallback,
validateFunction,
} = require('internal/validators');

const { AsyncResource } = require('async_hooks');
Expand Down Expand Up @@ -148,7 +147,7 @@ function runMicrotask() {
const defaultMicrotaskResourceOpts = { requireManualDestroy: true };

function queueMicrotask(callback) {
validateFunction(callback, 'callback');
validateCallback(callback);

const asyncResource = new AsyncResource(
'Microtask',
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-queue-microtask.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ assert.strictEqual(typeof queueMicrotask, 'function');
assert.throws(common.mustCall(() => {
queueMicrotask(t);
}), {
code: 'ERR_INVALID_ARG_TYPE',
code: 'ERR_INVALID_CALLBACK',
});
});

Expand Down

0 comments on commit 728965f

Please sign in to comment.