@@ -2375,8 +2375,8 @@ impl<'a> Context<'a> {
2375
2375
// be deallocated while we're invoking it.
2376
2376
js. push_str ( "state.cnt++;\n " ) ;
2377
2377
2378
- self . export_function_table ( ) ?;
2379
- let dtor = format ! ( "wasm.__wbg_function_table .get({})" , dtor) ;
2378
+ let table = self . export_function_table ( ) ?;
2379
+ let dtor = format ! ( "wasm.{} .get({})" , table , dtor) ;
2380
2380
let call = self . adapter_name ( * adapter) ;
2381
2381
2382
2382
if * mutable {
@@ -2682,8 +2682,8 @@ impl<'a> Context<'a> {
2682
2682
2683
2683
Intrinsic :: FunctionTable => {
2684
2684
assert_eq ! ( args. len( ) , 0 ) ;
2685
- self . export_function_table ( ) ?;
2686
- format ! ( "wasm.__wbg_function_table" )
2685
+ let name = self . export_function_table ( ) ?;
2686
+ format ! ( "wasm.{}" , name )
2687
2687
}
2688
2688
2689
2689
Intrinsic :: DebugString => {
@@ -2932,16 +2932,11 @@ impl<'a> Context<'a> {
2932
2932
) ;
2933
2933
}
2934
2934
2935
- fn export_function_table ( & mut self ) -> Result < ( ) , Error > {
2936
- if !self . should_write_global ( "wbg-function-table" ) {
2937
- return Ok ( ( ) ) ;
2938
- }
2939
- let id = match self . module . tables . main_function_table ( ) ? {
2940
- Some ( id) => id,
2935
+ fn export_function_table ( & mut self ) -> Result < String , Error > {
2936
+ match self . module . tables . main_function_table ( ) ? {
2937
+ Some ( id) => Ok ( self . export_name_of ( id) ) ,
2941
2938
None => bail ! ( "no function table found in module" ) ,
2942
- } ;
2943
- self . module . exports . add ( "__wbg_function_table" , id) ;
2944
- Ok ( ( ) )
2939
+ }
2945
2940
}
2946
2941
2947
2942
fn export_name_of ( & mut self , id : impl Into < walrus:: ExportItem > ) -> String {
0 commit comments