@@ -1919,19 +1919,19 @@ def phase_post_link(options, state, in_wasm, wasm_target, target, js_syms, base_
19191919 settings .TARGET_BASENAME = unsuffixed_basename (target )
19201920
19211921 if options .oformat in (OFormat .JS , OFormat .MJS ):
1922- state . js_target = target
1922+ js_target = target
19231923 else :
1924- state . js_target = get_secondary_target (target , '.js' )
1924+ js_target = get_secondary_target (target , '.js' )
19251925
1926- settings .TARGET_JS_NAME = os .path .basename (state . js_target )
1926+ settings .TARGET_JS_NAME = os .path .basename (js_target )
19271927
19281928 metadata = phase_emscript (in_wasm , wasm_target , js_syms , base_metadata )
19291929
19301930 if settings .EMBIND_AOT :
19311931 phase_embind_aot (wasm_target , js_syms , linker_inputs )
19321932
19331933 if options .emit_tsd :
1934- phase_emit_tsd (options , wasm_target , state . js_target , js_syms , metadata , linker_inputs )
1934+ phase_emit_tsd (options , wasm_target , js_target , js_syms , metadata , linker_inputs )
19351935
19361936 if options .js_transform :
19371937 phase_source_transforms (options )
@@ -1940,7 +1940,7 @@ def phase_post_link(options, state, in_wasm, wasm_target, target, js_syms, base_
19401940
19411941 # If we are not emitting any JS then we are all done now
19421942 if options .oformat != OFormat .WASM :
1943- phase_final_emitting (options , state , target , wasm_target )
1943+ phase_final_emitting (options , state , target , js_target , wasm_target )
19441944
19451945
19461946@ToolchainProfiler .profile_block ('emscript' )
@@ -2108,7 +2108,7 @@ def create_worker_file(input_file, target_dir, output_file, options):
21082108
21092109
21102110@ToolchainProfiler .profile_block ('final emitting' )
2111- def phase_final_emitting (options , state , target , wasm_target ):
2111+ def phase_final_emitting (options , state , target , js_target , wasm_target ):
21122112 global final_js
21132113
21142114 if shared .SKIP_SUBPROCS :
@@ -2164,8 +2164,6 @@ def phase_final_emitting(options, state, target, wasm_target):
21642164
21652165 js_manipulation .handle_license (final_js )
21662166
2167- js_target = state .js_target
2168-
21692167 # The JS is now final. Move it to its final location
21702168 move_file (final_js , js_target )
21712169
0 commit comments