1 | import { getOriginalFunction } from '@sentry/utils';
|
2 |
|
3 | let originalFunctionToString;
|
4 |
|
5 |
|
6 | class FunctionToString {constructor() { FunctionToString.prototype.__init.call(this); }
|
7 | |
8 |
|
9 |
|
10 | static __initStatic() {this.id = 'FunctionToString';}
|
11 |
|
12 | |
13 |
|
14 |
|
15 | __init() {this.name = FunctionToString.id;}
|
16 |
|
17 | |
18 |
|
19 |
|
20 | setupOnce() {
|
21 |
|
22 | originalFunctionToString = Function.prototype.toString;
|
23 |
|
24 |
|
25 | Function.prototype.toString = function ( ...args) {
|
26 | var context = getOriginalFunction(this) || this;
|
27 | return originalFunctionToString.apply(context, args);
|
28 | };
|
29 | }
|
30 | } FunctionToString.__initStatic();
|
31 |
|
32 | export { FunctionToString };
|
33 |
|