summaryrefslogtreecommitdiff
path: root/lib/inspector.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-06-20 14:37:00 -0700
committerRich Trott <rtrott@gmail.com>2017-06-23 14:43:20 -0700
commit095c0de94d818088cacf2c33ad4913768c15024a (patch)
tree77eb0aaffa2aa80ba1240280a716eb64c4a7ff1d /lib/inspector.js
parente3ea0fc97bf3a911463275446024b50e8bae865f (diff)
downloadandroid-node-v8-095c0de94d818088cacf2c33ad4913768c15024a.tar.gz
android-node-v8-095c0de94d818088cacf2c33ad4913768c15024a.tar.bz2
android-node-v8-095c0de94d818088cacf2c33ad4913768c15024a.zip
benchmark,lib,test: use braces for multiline block
For if/else and loops where the bodies span more than one line, use curly braces. PR-URL: https://github.com/nodejs/node/pull/13828 Ref: https://github.com/nodejs/node/pull/13623#discussion_r123048602 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/inspector.js')
-rw-r--r--lib/inspector.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/inspector.js b/lib/inspector.js
index e4c401a995..d73d8a2349 100644
--- a/lib/inspector.js
+++ b/lib/inspector.js
@@ -41,22 +41,26 @@ class Session extends EventEmitter {
}
post(method, params, callback) {
- if (typeof method !== 'string')
+ if (typeof method !== 'string') {
throw new TypeError(
`"method" must be a string, got ${typeof method} instead`);
+ }
if (!callback && util.isFunction(params)) {
callback = params;
params = null;
}
- if (params && typeof params !== 'object')
+ if (params && typeof params !== 'object') {
throw new TypeError(
`"params" must be an object, got ${typeof params} instead`);
- if (callback && typeof callback !== 'function')
+ }
+ if (callback && typeof callback !== 'function') {
throw new TypeError(
`"callback" must be a function, got ${typeof callback} instead`);
+ }
- if (!this[connectionSymbol])
+ if (!this[connectionSymbol]) {
throw new Error('Session is not connected');
+ }
const id = this[nextIdSymbol]++;
const message = {id, method};
if (params) {