gopherjs / gopherwasm

This package is deprecated. Use syscall/js of GopherJS instead.
BSD 2-Clause "Simplified" License
79 stars 5 forks source link

Apply Go 1.12 change #21

Closed hajimehoshi closed 5 years ago

hajimehoshi commented 5 years ago

https://tip.golang.org/doc/go1.12#syscall/js

The Callback type and NewCallback function have been renamed; they are now called Func and FuncOf, respectively. This is a breaking change, but WebAssembly support is still experimental and not yet subject to the Go 1 compatibility promise. Any code using the old names will need to be updated.

If a type implements the new Wrapper interface, ValueOf will use it to return the JavaScript value for that type.

The meaning of the zero Value has changed. It now represents the JavaScript undefined value instead of the number zero. This is a breaking change, but WebAssembly support is still experimental and not yet subject to the Go 1 compatibility promise. Any code relying on the zero Value to mean the number zero will need to be updated.

The new Value.Truthy method reports the JavaScript "truthiness" of a given value.

hajimehoshi commented 5 years ago

Another point is:

https://tip.golang.org/doc/go1.12#fmt

Maps are now printed in key-sorted order to ease testing.

and we will be able to have better tests :-)