Skip to content

Commit f40725f

Browse files
VoltrexKeyvatargos
authored andcommitted
vm: use missing validator
The `vm` lib module's `isContext()` function should use a validator. PR-URL: #38935 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent e87cd45 commit f40725f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/vm.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ function getContextOptions(options) {
206206
}
207207

208208
function isContext(object) {
209-
if (typeof object !== 'object' || object === null) {
210-
throw new ERR_INVALID_ARG_TYPE('object', 'Object', object);
211-
}
209+
validateObject(object, 'object', { allowArray: true });
210+
212211
return _isContext(object);
213212
}
214213

0 commit comments

Comments
 (0)