aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder
diff options
context:
space:
mode:
authorJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>2023-03-24 22:25:18 -0700
committerGopher Robot <gobot@golang.org>2023-03-30 18:50:54 +0000
commited9744dff5341ab692154eab1e6e0f1a3c138733 (patch)
tree7aa4dd286a8804bb55f69a096d86e0aa8c5a513d /src/cmd/compile/internal/noder
parent92261b38638af61a3aae2fdc48fd0b9f0cbff096 (diff)
downloadgo-ed9744dff5341ab692154eab1e6e0f1a3c138733.tar.xz
cmd/compile: allow go:wasmimport in syscall
The go:wasmimport compiler directive is used by the wasi port to access host APIs, some of need to implemented in the syscall package. Co-authored-by: Richard Musiol <neelance@gmail.com> Co-authored-by: Achille Roussel <achille.roussel@gmail.com> Co-authored-by: Julien Fabre <ju.pryz@gmail.com> Co-authored-by: Evan Phoenix <evan@phx.io> Change-Id: I3851e154c6989094effcd25bba5864faa133564e Reviewed-on: https://go-review.googlesource.com/c/go/+/479615 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/noder')
-rw-r--r--src/cmd/compile/internal/noder/noder.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/noder/noder.go b/src/cmd/compile/internal/noder/noder.go
index c846130976..483ff64686 100644
--- a/src/cmd/compile/internal/noder/noder.go
+++ b/src/cmd/compile/internal/noder/noder.go
@@ -237,7 +237,7 @@ func (p *noder) pragma(pos syntax.Pos, blankLine bool, text string, old syntax.P
p.error(syntax.Error{Pos: pos, Msg: "usage: //go:wasmimport importmodule importname"})
break
}
- if !base.Flag.CompilingRuntime && base.Ctxt.Pkgpath != "syscall/js" && base.Ctxt.Pkgpath != "syscall/js_test" {
+ if !base.Flag.CompilingRuntime && base.Ctxt.Pkgpath != "syscall/js" && base.Ctxt.Pkgpath != "syscall/js_test" && base.Ctxt.Pkgpath != "syscall" {
p.error(syntax.Error{Pos: pos, Msg: "//go:wasmimport directive cannot be used outside of runtime or syscall/js"})
break
}