File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,10 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
340340 info .wasmModule = parts [1 ]
341341 info .wasmName = parts [2 ]
342342 case "//go:wasmexport" :
343+ if c .archFamily () != "wasm32" {
344+ // go:wasmimport is ignored on non-wasm architectures
345+ continue
346+ }
343347 if f .Blocks == nil {
344348 c .addError (f .Pos (), "can only use //go:wasmexport on definitions" )
345349 continue
@@ -357,9 +361,6 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
357361 c .addError (f .Pos (), fmt .Sprintf ("//go:wasmexport does not allow main.main to be exported with -buildmode=%s" , c .BuildMode ))
358362 continue
359363 }
360- if c .archFamily () != "wasm32" {
361- c .addError (f .Pos (), "//go:wasmexport is only supported on wasm" )
362- }
363364 c .checkWasmImportExport (f , comment .Text )
364365 info .wasmExport = name
365366 info .wasmExportPos = comment .Slash
You can’t perform that action at this time.
0 commit comments