]> Cypherpunks repositories - gostls13.git/commit
text/template/parse, html/template: copy Tree.text during html template clone
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 17 Sep 2013 04:19:44 +0000 (14:19 +1000)
committerRob Pike <r@golang.org>
Tue, 17 Sep 2013 04:19:44 +0000 (14:19 +1000)
commiteeb758546e10b33be161e76b3c3290dbb7a70a87
treeec2aac03c9a40ab8fba44c693e3ca6d5e8b1d6a9
parent8d5ec52e6cf3a259b9054ee3c3621834f2491860
text/template/parse, html/template: copy Tree.text during html template clone

The root cause of the panic reported in https://code.google.com/p/go/issues/detail?id=5980
is that parse's Tree.Text wasn't being copied during the clone.

Fix this by adding and using a Copy method for parse.Tree.

Fixes #5980.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12420044
src/pkg/html/template/clone_test.go
src/pkg/html/template/template.go
src/pkg/text/template/parse/parse.go
src/pkg/text/template/parse/parse_test.go