vm: use missing validator

The `vm` lib module's `isContext()` function should use a validator.

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Voltrex 2021-06-04 23:11:25 +04:30 committed by James M Snell
parent e0238c4352
commit 826566e78a
No known key found for this signature in database
GPG Key ID: 7341B15C070877AC

View File

@ -206,9 +206,8 @@ function getContextOptions(options) {
}
function isContext(object) {
if (typeof object !== 'object' || object === null) {
throw new ERR_INVALID_ARG_TYPE('object', 'Object', object);
}
validateObject(object, 'object', { allowArray: true });
return _isContext(object);
}