Skip to content

Commit

Permalink
Throw an error on any ko end comment that is a firstChild
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Sep 30, 2017
1 parent 37a6cde commit b670e94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/virtualElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@

firstChild: function(node) {
if (!isStartComment(node)) {
if (node.firstChild && isUnmatchedEndComment(node.firstChild)) {
throw new Error("Found end comment without opening comment, as first child of " + node);
if (node.firstChild && isEndComment(node.firstChild)) {
throw new Error("Found invalid end comment, as the first child of " + node);
}
return node.firstChild;
} else if (!node.nextSibling || isEndComment(node.nextSibling)) {
Expand Down

0 comments on commit b670e94

Please sign in to comment.