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 @@ -350,6 +350,10 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
350
350
info .wasmModule = parts [1 ]
351
351
info .wasmName = parts [2 ]
352
352
case "//go:wasmexport" :
353
+ if c .archFamily () != "wasm32" {
354
+ // go:wasmimport is ignored on non-wasm architectures
355
+ continue
356
+ }
353
357
if f .Blocks == nil {
354
358
c .addError (f .Pos (), "can only use //go:wasmexport on definitions" )
355
359
continue
@@ -367,9 +371,6 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
367
371
c .addError (f .Pos (), fmt .Sprintf ("//go:wasmexport does not allow main.main to be exported with -buildmode=%s" , c .BuildMode ))
368
372
continue
369
373
}
370
- if c .archFamily () != "wasm32" {
371
- c .addError (f .Pos (), "//go:wasmexport is only supported on wasm" )
372
- }
373
374
c .checkWasmImportExport (f , comment .Text )
374
375
info .wasmExport = name
375
376
info .wasmExportPos = comment .Slash
You can’t perform that action at this time.
0 commit comments