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 targos committed Jun 11, 2021
1 parent e87cd45 commit f40725f
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 @@ -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);
}

Expand Down

0 comments on commit f40725f

Please sign in to comment.