mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
vm: refactor to use validateStringArray
PR-URL: https://github.com/nodejs/node/pull/46020 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
1 parent
54b748acc0
commit
389cc3e1d6
1 file changed
+2
-3
+2
-3
@@ -15,6 +15,7 @@ const {
|
||||
validateFunction,
|
||||
validateObject,
|
||||
validateString,
|
||||
validateStringArray,
|
||||
validateUint32,
|
||||
} = require('internal/validators');
|
||||
const {
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user