(opts, callback)
| 10684 | throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); |
| 10685 | } |
| 10686 | super("UNDICI_UPGRADE"); |
| 10687 | this.responseHeaders = responseHeaders || null; |
| 10688 | this.opaque = opaque || null; |
| 10689 | this.callback = callback; |
| 10690 | this.abort = null; |
| 10691 | this.context = null; |
| 10692 | addSignal(this, signal); |
| 10693 | } |
| 10694 | onConnect(abort, context) { |
| 10695 | if (this.reason) { |
| 10696 | abort(this.reason); |
| 10697 | return; |
| 10698 | } |
| 10699 | assert(this.callback); |
| 10700 | this.abort = abort; |
| 10701 | this.context = null; |
| 10702 | } |
| 10703 | onHeaders() { |
| 10704 | throw new SocketError("bad upgrade", null); |
| 10705 | } |
| 10706 | onUpgrade(statusCode, rawHeaders, socket) { |
| 10707 | assert(statusCode === 101); |
| 10708 | const { callback, opaque, context } = this; |
| 10709 | removeSignal(this); |
| 10710 | this.callback = null; |
nothing calls this directly
no test coverage detected