|
1 |
| -import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types'; |
| 1 | +import type { Event, Integration, StackFrame } from '@sentry/types'; |
2 | 2 |
|
3 | 3 | import { patchWebAssembly } from './patchWebAssembly';
|
4 | 4 | import { getImage, getImages } from './registry';
|
@@ -49,26 +49,27 @@ export class Wasm implements Integration {
|
49 | 49 | /**
|
50 | 50 | * @inheritDoc
|
51 | 51 | */
|
52 |
| - public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void { |
| 52 | + public setupOnce(_addGlobaleventProcessor: unknown, _getCurrentHub: unknown): void { |
53 | 53 | patchWebAssembly();
|
| 54 | + } |
54 | 55 |
|
55 |
| - addGlobalEventProcessor((event: Event) => { |
56 |
| - let haveWasm = false; |
| 56 | + /** @inheritDoc */ |
| 57 | + public processEvent(event: Event): Event { |
| 58 | + let haveWasm = false; |
57 | 59 |
|
58 |
| - if (event.exception && event.exception.values) { |
59 |
| - event.exception.values.forEach(exception => { |
60 |
| - if (exception?.stacktrace?.frames) { |
61 |
| - haveWasm = haveWasm || patchFrames(exception.stacktrace.frames); |
62 |
| - } |
63 |
| - }); |
64 |
| - } |
| 60 | + if (event.exception && event.exception.values) { |
| 61 | + event.exception.values.forEach(exception => { |
| 62 | + if (exception?.stacktrace?.frames) { |
| 63 | + haveWasm = haveWasm || patchFrames(exception.stacktrace.frames); |
| 64 | + } |
| 65 | + }); |
| 66 | + } |
65 | 67 |
|
66 |
| - if (haveWasm) { |
67 |
| - event.debug_meta = event.debug_meta || {}; |
68 |
| - event.debug_meta.images = [...(event.debug_meta.images || []), ...getImages()]; |
69 |
| - } |
| 68 | + if (haveWasm) { |
| 69 | + event.debug_meta = event.debug_meta || {}; |
| 70 | + event.debug_meta.images = [...(event.debug_meta.images || []), ...getImages()]; |
| 71 | + } |
70 | 72 |
|
71 |
| - return event; |
72 |
| - }); |
| 73 | + return event; |
73 | 74 | }
|
74 | 75 | }
|
0 commit comments