Skip to content

Commit de1776f

Browse files
authored
Add syscall/js (#908)
This PR adds a new package `syscall/js`. Originally `syscall/js` is for WebAssembly, but in GopherJS this package works as a wrapper of `github.com/gopherjs/gopherjs/js`. With this package, developers can use `syscall/js` both for GopherJS and WebAssembly. The implementation is basically same as `github.com/gohperjs/gopherwasm`. Fixes #899
1 parent bd77b11 commit de1776f

File tree

5 files changed

+703
-7
lines changed

5 files changed

+703
-7
lines changed

build/build.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ func importWithSrcDir(bctx build.Context, path string, srcDir string, mode build
139139
if installSuffix != "" {
140140
bctx.InstallSuffix += "_" + installSuffix
141141
}
142+
case "syscall/js":
143+
// There are no buildable files in this package, but we need to use files in the virtual directory.
144+
mode |= build.FindOnly
142145
case "math/big":
143146
// Use pure Go version of math/big; we don't want non-Go assembly versions.
144147
bctx.BuildTags = append(bctx.BuildTags, "math_big_pure_go")

compiler/gopherjspkg/fs_vfsdata.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/natives/fs_vfsdata.go

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)