diff --git a/compiler/systems/t_wasi.pas b/compiler/systems/t_wasi.pas
index 21de88526a..875caf44ee 100644
--- a/compiler/systems/t_wasi.pas
+++ b/compiler/systems/t_wasi.pas
@@ -251,12 +251,7 @@ var
 begin
   pd:=tcpuprocdef(tprocsym(hp.sym).ProcdefList[0]);
   if eo_promising_first in hp.options then
-    begin
-      if (pd.synthetickind<>tsk_none) and (pd.synthetickind<>tsk_wasm_promising) then
-        internalerror(2023061301);
-      pd.synthetickind:=tsk_wasm_promising;
-      pd.promising_export_name:=hp.name^;
-    end
+    pd.add_promising_export(hp.name^,false)
   else
     begin
       nm := pd.mangledname;
diff --git a/compiler/wasm32/symcpu.pas b/compiler/wasm32/symcpu.pas
index 14d7875724..61fb5a6171 100644
--- a/compiler/wasm32/symcpu.pas
+++ b/compiler/wasm32/symcpu.pas
@@ -123,6 +123,7 @@ type
     function is_pushleftright: boolean; override;
     function suspending_wrapper_name: ansistring;
     function promising_wrapper_name: ansistring;
+    procedure add_promising_export(aextname: ansistring;last:boolean);
   end;
   tcpuprocdefclass = class of tcpuprocdef;
 
@@ -387,6 +388,15 @@ implementation
     end;
 
 
+  procedure tcpuprocdef.add_promising_export(aextname: ansistring; last: boolean);
+    begin
+      if (synthetickind<>tsk_none) and (synthetickind<>tsk_wasm_promising) then
+        internalerror(2023061301);
+      synthetickind:=tsk_wasm_promising;
+      promising_export_name:=aextname;
+    end;
+
+
 {****************************************************************************
                              tcpuprocvardef
 ****************************************************************************}