diff options
author | cjihrig <cjihrig@gmail.com> | 2018-12-14 22:12:37 -0500 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-12-16 20:14:56 -0800 |
commit | 52ee55a06b9c8842045d6fb3b95f06939cc79078 (patch) | |
tree | cd126fc6e21b7f843fc21056f0d5b6c302e5d4ef /lib/vm.js | |
parent | 8dfd7573372ba49f87f0838191b83ea4c8bd509a (diff) | |
download | android-node-v8-52ee55a06b9c8842045d6fb3b95f06939cc79078.tar.gz android-node-v8-52ee55a06b9c8842045d6fb3b95f06939cc79078.tar.bz2 android-node-v8-52ee55a06b9c8842045d6fb3b95f06939cc79078.zip |
vm: simplify Script constructor options validation
This commit combines two related if statements into an
if-else statement.
PR-URL: https://github.com/nodejs/node/pull/25054
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/vm.js')
-rw-r--r-- | lib/vm.js | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -44,8 +44,7 @@ class Script extends ContextifyScript { code = `${code}`; if (typeof options === 'string') { options = { filename: options }; - } - if (typeof options !== 'object' || options === null) { + } else if (typeof options !== 'object' || options === null) { throw new ERR_INVALID_ARG_TYPE('options', 'Object', options); } |