• Didier Spezia's avatar
    html/template: prevent panic when escaping actions involving chain nodes · f6853369
    Didier Spezia authored
    The current escape code panics when an action involves chain nodes.
    Such nodes can be seen in the following situation:
    
    {{ . | AAA.B }} - AAA being a registered function
    
    The above expression is actually valid, because AAA could return a
    map containing a B key. The tests in text/template explicitly
    demonstrate this case.
    
    Fix allIdents to cover also chain nodes.
    
    While I was investigating this issue, I realized that the tests
    introduced in similar CL 9621 were incorrect. Parse errors were
    caught as expected, but for the wrong reason. Fixed them as well.
    No changes in text/template code itself.
    
    Fixes #10801
    
    Change-Id: Ic9fe43b63669298ca52c3f499e2725dd2bb818a8
    Reviewed-on: https://go-review.googlesource.com/10340Reviewed-by: 's avatarRob Pike <r@golang.org>
    f6853369
Name
Last commit
Last update
..
attr.go Loading commit data...
clone_test.go Loading commit data...
content.go Loading commit data...
content_test.go Loading commit data...
context.go Loading commit data...
css.go Loading commit data...
css_test.go Loading commit data...
doc.go Loading commit data...
error.go Loading commit data...
escape.go Loading commit data...
escape_test.go Loading commit data...
html.go Loading commit data...
html_test.go Loading commit data...
js.go Loading commit data...
js_test.go Loading commit data...
template.go Loading commit data...
transition.go Loading commit data...
transition_test.go Loading commit data...
url.go Loading commit data...
url_test.go Loading commit data...