diff --git a/compiler/GHC/Tc/Gen/Foreign.hs b/compiler/GHC/Tc/Gen/Foreign.hs
index 229dbe82193530814e4b8db309ea680a3828855f..84b48b4d2d7ccabcb76a18960b5b04e66d032d66 100644
--- a/compiler/GHC/Tc/Gen/Foreign.hs
+++ b/compiler/GHC/Tc/Gen/Foreign.hs
@@ -555,7 +555,7 @@ checkCConv decl PrimCallConv = do
   return PrimCallConv
 checkCConv decl JavaScriptCallConv = do
   dflags <- getDynFlags
-  if platformArch (targetPlatform dflags) == ArchJavaScript
+  if platformArch (targetPlatform dflags) `elem` [ ArchJavaScript, ArchWasm32 ]
       then return JavaScriptCallConv
       else do
         addErrTc $ TcRnUnsupportedCallConv decl JavaScriptCallConvUnsupported
diff --git a/compiler/GHC/Types/ForeignCall.hs b/compiler/GHC/Types/ForeignCall.hs
index a7a34776738d4de948ded827825c02d9d95cc5e4..8cfa4805ac2a3c425553cb2c6bf24fe45fa5ba37 100644
--- a/compiler/GHC/Types/ForeignCall.hs
+++ b/compiler/GHC/Types/ForeignCall.hs
@@ -189,7 +189,7 @@ ccallConvAttribute StdCallConv       = text "__attribute__((__stdcall__))"
 ccallConvAttribute CCallConv         = empty
 ccallConvAttribute CApiConv          = empty
 ccallConvAttribute (PrimCallConv {}) = panic "ccallConvAttribute PrimCallConv"
-ccallConvAttribute JavaScriptCallConv = panic "ccallConvAttribute JavaScriptCallConv"
+ccallConvAttribute JavaScriptCallConv = empty
 
 type CLabelString = FastString          -- A C label, completely unencoded