Skip to content

Commit

Permalink
vm: refactor to use validateStringArray
Browse files Browse the repository at this point in the history
PR-URL: #46020
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
  • Loading branch information
deokjinkim authored Jan 1, 2023
1 parent 2582a0d commit 5e43f3d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/internal/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const {
validateFunction,
validateObject,
validateString,
validateStringArray,
validateUint32,
} = require('internal/validators');
const {
Expand All @@ -30,9 +31,7 @@ function isContext(object) {
function internalCompileFunction(code, params, options) {
validateString(code, 'code');
if (params !== undefined) {
validateArray(params, 'params');
ArrayPrototypeForEach(params,
(param, i) => validateString(param, `params[${i}]`));
validateStringArray(params, 'params');
}

const {
Expand Down

0 comments on commit 5e43f3d

Please sign in to comment.