Closed Bug 700421 Opened 8 years ago Closed Last year
Syntax errors in xpcom components aren't reported
A syntax error in the JS file of an xpcom component causes it to fail to load, but there's no error message related to the actual error (neither in the error console, nor in the terminal on debug builds). The only visible error (Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]) doesn't help at all. This bug is causing significant (and recurrent) wastes of time for several developers (I had the confirmation on IRC while asking for a workaround that at least 2 other people had already painfully become aware of this bug in past experiences). Notes: - Reference errors from code executed during the initialization of the service were correctly reported during my testing. The bug seems only on syntax errors. - I observed this on a Mac debug build based on Mozilla 7. - For the readers looking for a workaround rather than willing to fix the bug, here is how I finally found my syntax error (after wasting over an hour and a half looking for the error / a way to locate it) : ./xpcshell component/<component-name>.js That gave me a very clear "SyntaxError: missing ) after argument list" error message with location information.
Would be great to have exacts steps to reproduce (with some example component).
Could bug 708215 have fixed this?
jdm's been doing work on this kind of stuff over in bug 463122. Maybe he might be interested in taking a crack at this one too? :-)
Comment on attachment 582116 [details] [diff] [review] testcase You're missing broken.js from the patch, right?
(In reply to Josh Matthews [:jdm] from comment #5) > Comment on attachment 582116 [details] [diff] [review] > testcase > > You're missing broken.js from the patch, right? yes, forgot to hg add, sorry about that :(. The content of that file isn't very important, I first tested with a file containing only one ) character and it gave the same result. I later changed the content to something more likely to be a valid component with a syntax error, so that the xpcshell error looked like a real error.
Attachment #582116 - Attachment is obsolete: true
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.