summaryrefslogtreecommitdiff
path: root/lib/inspector.js
diff options
context:
space:
mode:
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) {