Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
vm: refactor to use validateStringArray
PR-URL: #46020
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
  • Loading branch information
deokjinkim authored and juanarbol committed Jan 31, 2023
1 parent 4ee3238 commit 96f1b2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/internal/vm.js
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 96f1b2e

Please sign in to comment.