fix(page): page.close() assert that connection is not closed (#1038)

This commit is contained in:
Christian Davis 2017-10-17 21:24:34 -05:00 committed by Andrey Lushnikov
parent e943efe1e3
commit b3857bd690

View File

@ -201,6 +201,7 @@ class Session extends EventEmitter {
}
async dispose() {
console.assert(!!this._connection, 'Protocol error: Connection closed. Most likely the page has been closed.');
await this._connection.send('Target.closeTarget', {targetId: this._targetId});
}