Skip to content

Can not externalise pointer fields #1231

Open
@naorzr

Description

@naorzr

trying to do something like this

package main

import (
	"github.com/gopherjs/gopherjs/js"
)


func exampleFunc(p *string) *string {
	return p
}
func main() {
	js.Global.Set("exampleFunc", exampleFunc)
}

results in an error when trying to run the function with any field

VM129:1968 Uncaught TypeError: v.$get is not a function
    at $externalize (eval at $b (playground.js:107:11697), <anonymous>:1968:27)
    at v.$externalizeWrapper (eval at $b (playground.js:107:11697), <anonymous>:2064:16)
    at <anonymous>:1:1

here a link to a reproduction

https://gopherjs.github.io/playground/#/wunE-xEePF

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions