MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / _failPending

Method _failPending

javascript/selenium-webdriver/bidi/index.js:133–150  ·  view source on GitHub ↗

* Reject any in-flight sends and mark the connection failed. Idempotent so * that close() and the underlying 'close'/'error' events do not double-reject. * @param {Error} error * @private

(error)

Source from the content-addressed store, hash-verified

131 * @private
132 */
133 _failPending(error) {
134 if (this._closed) {
135 return
136 }
137 this._closed = true
138 this.connected = false
139 for (const { reject, timeoutId } of this._pending.values()) {
140 clearTimeout(timeoutId)
141 reject(error)
142 }
143 this._pending.clear()
144 // Reject any callers parked in waitForConnection() so close() (or an
145 // unexpected disconnect) cannot leave them hanging forever.
146 for (const { reject } of this._connectWaiters) {
147 reject(error)
148 }
149 this._connectWaiters.clear()
150 }
151
152 /**
153 * @returns {WebSocket}

Callers 2

constructorMethod · 0.95
closeMethod · 0.95

Calls 3

rejectFunction · 0.85
valuesMethod · 0.80
clearMethod · 0.65

Tested by

no test coverage detected