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

Function thenFinally

javascript/selenium-webdriver/lib/promise.js:98–106  ·  view source on GitHub ↗

* Registers a listener to invoke when a promise is resolved, regardless * of whether the promise's value was successfully computed. This function * is synonymous with the finally clause in a synchronous API: * * // Synchronous API: * try { * doSynchronousWork(); * }

(promise, callback)

Source from the content-addressed store, hash-verified

96 * @template R
97 */
98async function thenFinally(promise, callback) {
99 try {
100 await Promise.resolve(promise)
101 return callback()
102 } catch (e) {
103 await callback()
104 throw e
105 }
106}
107
108/**
109 * Calls a function for each element in an array and inserts the result into a

Callers

nothing calls this directly

Calls 2

callbackFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected