I encountered JS parse errors while looking at javadocs. Turns out they use XML comments inside script tags something like this:
<script type="text/javascript"><!--
console.log("Test");
//-->
var activeTableTab = "activeTableTab";
</script>
gngr parses this correctly as per XHTML and HTML4. But other browsers are lenient in handling the comment, and the lenient behaviour seems to be codified now in HTML5.
Good discussion on this SO thread