@@ -987,11 +987,7 @@ __wbg_set_wasm(wasm);"
987987 }
988988
989989 let js = match & self . config . mode {
990- OutputMode :: Emscripten => format ! (
991- "\
992- {imports_init}",
993- imports_init = imports_init
994- ) ,
990+ OutputMode :: Emscripten => imports_init. to_string ( ) ,
995991 _ => format ! (
996992 "\
997993 async function __wbg_load(module, imports) {{
@@ -2654,15 +2650,15 @@ __wbg_set_wasm(wasm);"
26542650 }
26552651 let table = self . export_function_table ( ) ?;
26562652 if matches ! ( self . config. mode, OutputMode :: Emscripten ) {
2657- self . emscripten_library . push_str ( & format ! (
2653+ self . emscripten_library . push_str (
26582654 "
26592655 $CLOSURE_DTORS: `(typeof FinalizationRegistry === 'undefined')
26602656 ? {{ register: () => {{}}, unregister: () => {{}} }}
26612657 : new FinalizationRegistry(state => {{
26622658 wasmExports.__indirect_function_table.get(state.dtor)(state.a, state.b)
26632659 }})`,\n
2664- "
2665- ) ) ;
2660+ " ,
2661+ ) ;
26662662 } else {
26672663 self . global ( & format ! (
26682664 "
@@ -3187,20 +3183,20 @@ __wbg_set_wasm(wasm);"
31873183 "function() {{ return logError(function {}, arguments) }}" ,
31883184 code
31893185 )
3190- } else {
3191- if !import_deps. is_empty ( ) {
3192- for dep in & import_deps {
3193- self . emscripten_deps . insert ( dep. clone ( ) ) ;
3194- }
3195- format ! (
3196- "function{},\n {}__deps: [{}]" ,
3197- code,
3198- self . module. imports. get( core) . name,
3199- import_deps. join( "," )
3200- )
3201- } else {
3202- format ! ( "function{}\n " , code)
3186+ } else if ( matches ! ( self . config. mode, OutputMode :: Emscripten )
3187+ && !import_deps. is_empty ( ) )
3188+ {
3189+ for dep in & import_deps {
3190+ self . emscripten_deps . insert ( dep. clone ( ) ) ;
32033191 }
3192+ format ! (
3193+ "function{},\n {}__deps: [{}]" ,
3194+ code,
3195+ self . module. imports. get( core) . name,
3196+ import_deps. join( "," )
3197+ )
3198+ } else {
3199+ format ! ( "function{}\n " , code)
32043200 } ;
32053201
32063202 self . wasm_import_definitions . insert ( core, code) ;
@@ -3210,7 +3206,7 @@ __wbg_set_wasm(wasm);"
32103206 assert ! ( !log_error) ;
32113207
32123208 if matches ! ( self . config. mode, OutputMode :: Emscripten ) {
3213- self . emscripten_library . push_str ( "$" ) ;
3209+ self . emscripten_library . push ( '$' ) ;
32143210 self . emscripten_library . push_str ( & self . adapter_name ( id) ) ;
32153211 self . emscripten_library . push_str ( ": function" ) ;
32163212 self . emscripten_library
0 commit comments