@@ -13,17 +13,18 @@ const _wasmIntegration = (() => {
13
13
patchWebAssembly ( ) ;
14
14
} ,
15
15
processEvent ( event : Event ) : Event {
16
- let haveWasm = false ;
16
+ let hasAtLeastOneWasmFrameWithImage = false ;
17
17
18
18
if ( event . exception && event . exception . values ) {
19
19
event . exception . values . forEach ( exception => {
20
20
if ( exception . stacktrace && exception . stacktrace . frames ) {
21
- haveWasm = haveWasm || patchFrames ( exception . stacktrace . frames ) ;
21
+ hasAtLeastOneWasmFrameWithImage =
22
+ hasAtLeastOneWasmFrameWithImage || patchFrames ( exception . stacktrace . frames ) ;
22
23
}
23
24
} ) ;
24
25
}
25
26
26
- if ( haveWasm ) {
27
+ if ( hasAtLeastOneWasmFrameWithImage ) {
27
28
event . debug_meta = event . debug_meta || { } ;
28
29
event . debug_meta . images = [ ...( event . debug_meta . images || [ ] ) , ...getImages ( ) ] ;
29
30
}
@@ -37,10 +38,11 @@ export const wasmIntegration = defineIntegration(_wasmIntegration);
37
38
38
39
/**
39
40
* Patches a list of stackframes with wasm data needed for server-side symbolication
40
- * if applicable. Returns true if any frames were patched.
41
+ * if applicable. Returns true if the provided list of stack frames had at least one
42
+ * matching registered image.
41
43
*/
42
44
function patchFrames ( frames : Array < StackFrame > ) : boolean {
43
- let haveWasm = false ;
45
+ let hasAtLeastOneWasmFrameWithImage = false ;
44
46
frames . forEach ( frame => {
45
47
if ( ! frame . filename ) {
46
48
return ;
@@ -50,14 +52,15 @@ function patchFrames(frames: Array<StackFrame>): boolean {
50
52
| [ string , string , string ] ;
51
53
if ( match ) {
52
54
const index = getImage ( match [ 1 ] ) ;
55
+ frame . instruction_addr = match [ 2 ] ;
56
+ frame . filename = match [ 1 ] ;
57
+ frame . platform = 'native' ;
58
+
53
59
if ( index >= 0 ) {
54
- frame . instruction_addr = match [ 2 ] ;
55
60
frame . addr_mode = `rel:${ index } ` ;
56
- frame . filename = match [ 1 ] ;
57
- frame . platform = 'native' ;
58
- haveWasm = true ;
61
+ hasAtLeastOneWasmFrameWithImage = true ;
59
62
}
60
63
}
61
64
} ) ;
62
- return haveWasm ;
65
+ return hasAtLeastOneWasmFrameWithImage ;
63
66
}
0 commit comments