Skip to content

Commit e7fa4e6

Browse files
authored
Merge pull request #3 from gowasm/norunners
Fixed createTextNode by correcting the text type to a pointer in the wrapNode function.
2 parents c48e3c8 + c50976c commit e7fa4e6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

dom_wasm.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func wrapNode(o js.Value) Node {
146146
switch elementConstructor(o) {
147147
// TODO all the non-element cases
148148
case js.Global().Get("Text"):
149-
return Text{&BasicNode{o}}
149+
return &Text{&BasicNode{o}}
150150
default:
151151
return wrapElement(o)
152152
}
@@ -706,8 +706,7 @@ func (d document) CreateElementNS(ns string, name string) Element {
706706
}
707707

708708
func (d document) CreateTextNode(s string) *Text {
709-
n :=wrapNode(d.Object.Call("createTextNode", s)).(Text)
710-
return &n
709+
return wrapNode(d.Object.Call("createTextNode", s)).(*Text)
711710
}
712711

713712
func (d document) ElementFromPoint(x, y int) Element {

0 commit comments

Comments
 (0)