diff --git a/lib/inspector.js b/lib/inspector.js index 33c48125bbd22e..4bec628b7d789e 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -37,12 +37,8 @@ class Session extends EventEmitter { connect() { if (this[connectionSymbol]) throw new ERR_INSPECTOR_ALREADY_CONNECTED('The inspector session'); - const connection = + this[connectionSymbol] = new Connection((message) => this[onMessageSymbol](message)); - if (connection.sessionAttached) { - throw new ERR_INSPECTOR_ALREADY_CONNECTED('Another inspector session'); - } - this[connectionSymbol] = connection; } [onMessageSymbol](message) {