While testing JavaScript code in Firefox 3.5 I sometimes get the following error:
Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER)
<
I just had the error by mistakenly trying to append an element to itself: elem.appendChild(elem);
Without knowing specifically what you are calling, the error generally means you've passed something null to something that does not expect a null value.
I had this error too using Coffeescript when my Callback functions were defined after my main function. I just had to re order my functions to make it work. Hope it helps.