()
| 15 | return { |
| 16 | name: INTEGRATION_NAME, |
| 17 | setupOnce() { |
| 18 | // eslint-disable-next-line @typescript-eslint/unbound-method |
| 19 | originalFunctionToString = Function.prototype.toString; |
| 20 | |
| 21 | // intrinsics (like Function.prototype) might be immutable in some environments |
| 22 | // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal) |
| 23 | try { |
| 24 | Function.prototype.toString = function (this: WrappedFunction, ...args: unknown[]): string { |
| 25 | const originalFunction = getOriginalFunction(this); |
| 26 | const context = |
| 27 | SETUP_CLIENTS.has(getClient() as Client) && originalFunction !== undefined ? originalFunction : this; |
| 28 | return originalFunctionToString.apply(context, args); |
| 29 | }; |
| 30 | } catch { |
| 31 | // ignore errors here, just don't patch this |
| 32 | } |
| 33 | }, |
| 34 | setup(client) { |
| 35 | SETUP_CLIENTS.set(client, true); |
| 36 | }, |
nothing calls this directly
no test coverage detected