Open
Description
When calling MakeWrapper
on a struct containing embedded structs, only methods on the top-level struct are exposed in the resulting js.Object
Example
package main
import (
"fmt"
"github.com/gopherjs/gopherjs/js"
)
func main() {
js.Global.Set("Example", map[string]interface{}{
"New": New,
})
}
type A struct{}
func (a A) MethodA() {
fmt.Println("A")
}
type B struct {
A
}
func (b B) MethodB() {
fmt.Println("B")
}
func New() *js.Object {
return js.MakeWrapper(B{A{}})
}
In Go, it'd be fine to call B{A{}}}.MethodA()
, but the resulting js.Object
only has MethodB
.
I did some searching around, but couldn't find any other issues/references to why this is the case.