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() {
2020 return cachedWasm ;
2121 }
2222
23- let currentCallback = null ;
23+ const callbackStack = [ ] ;
2424
2525 cachedWasm = readWasm ( ) . then ( buffer => {
2626 return WebAssembly . instantiate ( buffer , {
@@ -61,7 +61,7 @@ module.exports = function wasm() {
6161 }
6262 }
6363
64- currentCallback ( mapping ) ;
64+ callbackStack [ callbackStack . length - 1 ] ( mapping ) ;
6565 } ,
6666
6767 start_all_generated_locations_for : function ( ) { console . time ( "all_generated_locations_for" ) ; } ,
@@ -90,11 +90,11 @@ module.exports = function wasm() {
9090 return {
9191 exports : wasm . instance . exports ,
9292 withMappingCallback : ( mappingCallback , f ) => {
93- currentCallback = mappingCallback ;
93+ callbackStack . push ( mappingCallback )
9494 try {
9595 f ( ) ;
9696 } finally {
97- currentCallback = null ;
97+ callbackStack . pop ( )
9898 }
9999 }
100100 } ;
You can’t perform that action at this time.
0 commit comments