Background
We have a web application in which several developers have written several .js files that manipulate the DOM and the problem of duplicate function names has crept into our application.
Question
Can anyone recommend a tool that will warn us when we accidentally write a web page with two javascript functions with the same name?
Example
HTML page
<script language="JavaScript" src="test.js" type="text/javascript"></script>
<script>function foo() {alert('bar');}</script>
test.js
function foo() {alert('foo');}
Since foo() is declared twice in the page, apparently only the one that takes precedence is loaded.
The tools I've used seem to ignore this. Firebug only shows the loaded function. Netbeans will show both functions in navigator (without a warning), but only looks at one file at a time (ie, I can't point it at the HTML file and see it and the .js at the same time.) and web developer extensions allows me to look at everything at once, but no errors or warnings. Firefox's error console also throws no warning or error. Neither does IE.
Thanks!