Skip to content

Commit

Permalink
vm: use missing validator
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
VoltrexKeyva authored and richardlau committed Jul 20, 2021
1 parent fc2b1ec commit dd00547
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,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);
}

Expand Down

0 comments on commit dd00547

Please sign in to comment.