Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVoltrex <62040526+VoltrexMaster@users.noreply.github.com>2021-06-04 21:41:25 +0300
committerJames M Snell <jasnell@gmail.com>2021-06-07 17:31:34 +0300
commit826566e78a4f6248254b7dd6fb85f37ea3978530 (patch)
tree767f9779b4f83e06e7ea4b293b6587c6573a700d /lib
parente0238c435251f46032ce038f33907bfb0e65fa3d (diff)
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/vm.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/vm.js b/lib/vm.js
index 0b643110ae9..d8e3d658603 100644
--- a/lib/vm.js
+++ b/lib/vm.js
@@ -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);
}