aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/noder.go
diff options
context:
space:
mode:
authorJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>2023-04-26 08:18:10 -0700
committerJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>2023-05-11 15:21:09 +0000
commitaff2f4a7248a35cd16e24894d125faa2730247bd (patch)
treed1ef8338951104eb4b5a4f0019d7753bd09d4e85 /src/cmd/compile/internal/noder/noder.go
parentbc9e21351c2b9f0802304198860afbd4f1381e75 (diff)
downloadgo-aff2f4a7248a35cd16e24894d125faa2730247bd.tar.xz
cmd/compile: remove go:wasmimport restriction
Removes the package restriction on go:wasmimport, allowing the use of it globally and in user code. Fixes #59149 Change-Id: Ib26f628dc8dafb31388005b50449e91b47dab447 Reviewed-on: https://go-review.googlesource.com/c/go/+/489255 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Eli Bendersky <eliben@google.com> Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/noder/noder.go')
-rw-r--r--src/cmd/compile/internal/noder/noder.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/noder/noder.go b/src/cmd/compile/internal/noder/noder.go
index 483ff64686..25a6ba7c88 100644
--- a/src/cmd/compile/internal/noder/noder.go
+++ b/src/cmd/compile/internal/noder/noder.go
@@ -237,10 +237,6 @@ 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" && base.Ctxt.Pkgpath != "syscall" {
- p.error(syntax.Error{Pos: pos, Msg: "//go:wasmimport directive cannot be used outside of runtime or syscall/js"})
- break
- }
if buildcfg.GOARCH == "wasm" {
// Only actually use them if we're compiling to WASM though.