Closed thegrumpylion closed 4 years ago
Functions that get a pointer to a string/int/bool should dereference the pointers before passing them to any js functions
For example
// SetTextContent setting attribute 'textContent' with // type string (idl: DOMString). func (_this *Node) SetTextContent(value *string) { input := value _this.Value_JS.Set("textContent", input) }
could be
// SetTextContent setting attribute 'textContent' with // type string (idl: DOMString). func (_this *Node) SetTextContent(value *string) { if value != nil { input := *value _this.Value_JS.Set("textContent", input) } }
otherwise it panics panic: ValueOf: invalid value
panic: ValueOf: invalid value
Similar,
func (_this *Node) CloneNode(deep *bool) (_result *Node) { var ( _args [1]interface{} _end int ) if deep != nil { _p0 := deep _args[0] = _p0 _end++ } _returned := _this.Value_JS.Call("cloneNode", _args[0:_end]...) var ( _converted *Node // javascript: Node _what_return_name ) _converted = NodeFromJS(_returned) _result = _converted return }
func (_this *Node) CloneNode(deep *bool) (_result *Node) { var ( _args [1]interface{} _end int ) if deep != nil { _p0 := *deep _args[0] = _p0 _end++ } _returned := _this.Value_JS.Call("cloneNode", _args[0:_end]...) var ( _converted *Node // javascript: Node _what_return_name ) _converted = NodeFromJS(_returned) _result = _converted return }
I think this issue is now fixed. Thank for the feedback!
Functions that get a pointer to a string/int/bool should dereference the pointers before passing them to any js functions
For example
could be
otherwise it panics
panic: ValueOf: invalid value
Similar,
could be