File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ module.exports = function wasm() {
20
20
return cachedWasm ;
21
21
}
22
22
23
- let currentCallback = null ;
23
+ const callbackStack = [ ] ;
24
24
25
25
cachedWasm = readWasm ( ) . then ( buffer => {
26
26
return WebAssembly . instantiate ( buffer , {
@@ -61,7 +61,7 @@ module.exports = function wasm() {
61
61
}
62
62
}
63
63
64
- currentCallback ( mapping ) ;
64
+ callbackStack [ callbackStack . length - 1 ] ( mapping ) ;
65
65
} ,
66
66
67
67
start_all_generated_locations_for : function ( ) { console . time ( "all_generated_locations_for" ) ; } ,
@@ -90,11 +90,11 @@ module.exports = function wasm() {
90
90
return {
91
91
exports : wasm . instance . exports ,
92
92
withMappingCallback : ( mappingCallback , f ) => {
93
- currentCallback = mappingCallback ;
93
+ callbackStack . push ( mappingCallback )
94
94
try {
95
95
f ( ) ;
96
96
} finally {
97
- currentCallback = null ;
97
+ callbackStack . pop ( )
98
98
}
99
99
}
100
100
} ;
You can’t perform that action at this time.
0 commit comments