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) {
340
340
info .wasmModule = parts [1 ]
341
341
info .wasmName = parts [2 ]
342
342
case "//go:wasmexport" :
343
+ if c .archFamily () != "wasm32" {
344
+ // go:wasmimport is ignored on non-wasm architectures
345
+ continue
346
+ }
343
347
if f .Blocks == nil {
344
348
c .addError (f .Pos (), "can only use //go:wasmexport on definitions" )
345
349
continue
@@ -357,9 +361,6 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
357
361
c .addError (f .Pos (), fmt .Sprintf ("//go:wasmexport does not allow main.main to be exported with -buildmode=%s" , c .BuildMode ))
358
362
continue
359
363
}
360
- if c .archFamily () != "wasm32" {
361
- c .addError (f .Pos (), "//go:wasmexport is only supported on wasm" )
362
- }
363
364
c .checkWasmImportExport (f , comment .Text )
364
365
info .wasmExport = name
365
366
info .wasmExportPos = comment .Slash
You can’t perform that action at this time.
0 commit comments