Fix various crashes I saw when running soyfmt in the wild.
1) HTML comments
2) Self closing tags (<img />)
3) attributes with no value
GITHUB_BREAKING_CHANGES=n/a
@@ -127,6 +127,8 @@ public abstract class AbstractReturningSoyNodeVisitor<R>
case CALL_PARAM_CONTENT_NODE:
return visitCallParamContentNode((CallParamContentNode) node);
+ case HTML_COMMENT_NODE:
+ return visitHtmlCommentNode((HtmlCommentNode) node);
case HTML_CLOSE_TAG_NODE:
return visitHtmlCloseTagNode((HtmlCloseTagNode) node);
case HTML_OPEN_TAG_NODE:
@@ -148,10 +150,8 @@ public abstract class AbstractReturningSoyNodeVisitor<R>
return visitLogNode((LogNode) node);
case DEBUGGER_NODE:
return visitDebuggerNode((DebuggerNode) node);
-
- default:
- return visitSoyNode(node);
}
+ return visitSoyNode(node);
}
// -----------------------------------------------------------------------------------------------
@@ -345,6 +345,10 @@ public abstract class AbstractReturningSoyNodeVisitor<R>
return visitSoyNode(node);
}
+ protected R visitHtmlCommentNode(HtmlCommentNode node) {
+ return visitSoyNode(node);
+ }
+
// -----------------------------------------------------------------------------------------------
// Fallback implementation.
