Skip to content

Commit

Permalink
Add syscall/js (#908)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hajimehoshi committed Apr 30, 2019
1 parent bd77b11 commit de1776f
Show file tree
Hide file tree
Showing 5 changed files with 703 additions and 7 deletions.
3 changes: 3 additions & 0 deletions build/build.go
Expand Up @@ -139,6 +139,9 @@ func importWithSrcDir(bctx build.Context, path string, srcDir string, mode build
if installSuffix != "" { if installSuffix != "" {
bctx.InstallSuffix += "_" + installSuffix bctx.InstallSuffix += "_" + installSuffix
} }
case "syscall/js":
// There are no buildable files in this package, but we need to use files in the virtual directory.
mode |= build.FindOnly
case "math/big": case "math/big":
// Use pure Go version of math/big; we don't want non-Go assembly versions. // Use pure Go version of math/big; we don't want non-Go assembly versions.
bctx.BuildTags = append(bctx.BuildTags, "math_big_pure_go") bctx.BuildTags = append(bctx.BuildTags, "math_big_pure_go")
Expand Down
2 changes: 1 addition & 1 deletion compiler/gopherjspkg/fs_vfsdata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions compiler/natives/fs_vfsdata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de1776f

Please sign in to comment.