Closed as not planned
Description
The following highlights a problem when $internalize ing a pointer type. It only will internalize if the pointer is a struct; otherwise it will fallthrough into internalizing as a slice.
Suspect code: https://github.com/gopherjs/gopherjs/blob/master/compiler/prelude/jsmapping.js#L329-L334
//go:build js
package test
import (
"fmt"
"github.com/gopherjs/gopherjs/js"
"testing"
)
type Bar struct {
*js.Object
V *string `js:"V"`
}
func makeJsObject() *js.Object {
if js.Global != nil {
return js.Global.Get("Object").New()
}
return nil
}
func TestExposeBug(t *testing.T) {
b := Bar{Object: makeJsObject()}
b.V = nil
elem := b.V
fmt.Println(elem)
}