We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ada6a2 commit 0d1c971Copy full SHA for 0d1c971
packages/browser/src/helpers.ts
@@ -143,11 +143,14 @@ export function wrap(
143
144
// Restore original function name (not all browsers allow that)
145
try {
146
- Object.defineProperty(sentryWrapped, 'name', {
147
- get(): string {
148
- return fn.name;
149
- },
150
- });
+ const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;
+ if (descriptor.configurable) {
+ Object.defineProperty(sentryWrapped, 'name', {
+ get(): string {
+ return fn.name;
151
+ },
152
+ });
153
+ }
154
} catch (_oO) {
155
/*no-empty*/
156
}
0 commit comments