gopherjs/gopherwasm

Update API

hajimehoshi opened this issue · 4 comments

https://tip.golang.org/pkg/syscall/js/?GOOS=js&GOARCH=wasm

  • Now Global, Null and Undefined are functions.
  • Add InstanceOf function.

As Global or other things would be breaking change, my plan is:

  1. Make GopherWasm enable to compile with GOARCH=wasm without changing the API first
  2. Change the API to be same as syscall/js later

The problem is when to do 2. Whenever I do this, I need to provide advance warning.

The GopherJS version is around 1Mb smaller if "fmt" is not included, but reflect used instead:

		panic(`fmt.Sprintf("invalid arg: %T", x) ` + reflect.TypeOf(x).String())

Maybe your point is not related to this issue? But sounds reasonable. I'd be happy if you could send a PR :-)

Fixed.