Skip to content

Commit dd00547

Browse files
VoltrexKeyvarichardlau
authored andcommitted
vm: use missing validator
The `vm` lib module's `isContext()` function should use a validator. PR-URL: #38935 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent fc2b1ec commit dd00547

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
@@ -211,9 +211,8 @@ function getContextOptions(options) {
211211
}
212212

213213
function isContext(object) {
214-
if (typeof object !== 'object' || object === null) {
215-
throw new ERR_INVALID_ARG_TYPE('object', 'Object', object);
216-
}
214+
validateObject(object, 'object', { allowArray: true });
215+
217216
return _isContext(object);
218217
}
219218

0 commit comments

Comments
 (0)