The following js method does not return, yet firebug reports no exception:
function test_contains_doesNotBailWithoutException() {
$.contains(document.getElementById('navlinks', undefined));
// This line should be reached, or you should get an exception message in Firebug.
return true;
}
where navlinks is something that exists on the page, and $ is from jquery 1.5.1. The method exits (throws, I assume) while calling the contains method, in line 4639 of jquery1.5.1:
return !!(a.compareDocumentPosition(b) & 16);
where a is the navlinks div and b is undefined. Shouldn’t firebug report an exception in the console?
To be sure, running the following in the firebug console yields neither an error message nor a return result:
return document.getElementById('navlinks').compareDocumentPosition(undefined);
EDIT: I’m using Firefox 4.0.1 and Firebug 1.7.1.
Yes, there should be an exception; I certainly get one with either the JavaScript version:
or the same thing from the jQuery version (which has a bracket in the wrong place in your example… not that it matters since the missing argument will naturally get filled in with
undefinedanyway):