* A polyfill to set `__name` to the global scope which is needed for WebdriverIO to properly
* execute custom (preload) scripts. When using `tsx` Esbuild runs some optimizations which
* assume that the file contains these global variables. This is a workaround until this issue
* is fixed.
*
* @see https://github.com/evanw/esbuild/issues/2605
*/
export const polyfillFn = function webdriverioPolyfill() {
var __defProp = Object.defineProperty
var __name = function (target: unknown, _value: unknown) {
return __defProp(target, 'name', { value: _value, configurable: true })
}
var __globalThis = (typeof globalThis === 'object' && globalThis) || (typeof window === 'object' && window) as any
__globalThis.__name = __name
}