mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
e0238c4352
commit
826566e78a
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user