| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dbf204c commit dc38a45
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ const { | |||
| 13 | 13 | const Buffer = require('buffer').Buffer; | |
| 14 | 14 | const crypto = require('crypto'); | |
| 15 | 15 | const { ERR_DEBUGGER_ERROR } = require('internal/errors').codes; | |
| 16 | - const { EventEmitter } = require('events'); | ||
| 16 | + const { EventEmitter, once } = require('events'); | ||
| 17 | 17 | const http = require('http'); | |
| 18 | 18 | const { URL } = require('internal/url'); | |
| 19 | 19 | ||
@@ -343,13 +343,10 @@ class Client extends EventEmitter { | |||
| 343 | 343 | this.emit('ready'); | |
| 344 | 344 | }; | |
| 345 | 345 | ||
| 346 | - return new Promise((resolve, reject) => { | ||
| 347 | - this.once('error', reject); | ||
| 348 | - this.once('ready', resolve); | ||
| 349 | - | ||
| 350 | - httpReq.on('upgrade', handshakeListener); | ||
| 351 | - httpReq.end(); | ||
| 352 | - }); | ||
| 346 | + const onReady = once(this, 'ready'); | ||
| 347 | + httpReq.on('upgrade', handshakeListener); | ||
| 348 | + httpReq.end(); | ||
| 349 | + return onReady; | ||
| 353 | 350 | } | |
| 354 | 351 | } | |
| 355 | 352 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -141,6 +141,10 @@ function startCLI(args, flags = [], spawnOpts = {}, opts = { randomPort: true }) | |||
| 141 | 141 | return getOutput(); | |
| 142 | 142 | }, | |
| 143 | 143 | ||
| 144 | + get stderrOutput() { | ||
| 145 | + return stderrOutput; | ||
| 146 | + }, | ||
| 147 | + | ||
| 144 | 148 | get rawOutput() { | |
| 145 | 149 | return outputBuffer.join('').toString(); | |
| 146 | 150 | }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,8 @@ const startCLI = require('../common/debugger'); | |||
| 31 | 31 | } finally { | |
| 32 | 32 | await cli.quit(); | |
| 33 | 33 | } | |
| 34 | + | ||
| 35 | + assert.doesNotMatch(cli.stderrOutput, /MaxListenersExceededWarning/); | ||
| 34 | 36 | } | |
| 35 | 37 | ||
| 36 | 38 | onWaitForInitialBreak(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments