Open
Description
This may or may not be a "bug" per se, but attempting to call a method on a nil interface results in a JS error, rather than a GopherJS runtime error. Example:
package main
func main() {
foo := GetFoo()
foo.Foo()
}
type Foo interface {
Foo()
}
func GetFoo() Foo {
return nil
}
Results in:
TypeError: foo.Foo is not a function
Or in Chrome:
main.js:146674 Uncaught TypeError: Cannot read property 'Foo' of undefined
This is only undesirable insofar as it tends to suggest a problem with a JS lib.
In Go the same error is reported as:
panic: runtime error: invalid memory address or nil pointer dereference
Something similar would be ideal, IMHO, in GopherJS.