Created attachment 8663302 [details] not_well_formed.tar.gz STR: Open attached not_well_formed.html. Observed: Web console says error "not well-formed not_well_formed.js:1:1". The file:line points to the first line of the .js file, which is a comment as follows: "// The Module object: Our interface to the outside world. We import" What is not well-formed? What does being well-formed mean? The line:column info regarding the first character on the first line does not have anything that looks not-well-formed. Expected: Browser should be able to point to the cause of the error more clearly, so that the developer is able to debug (and learn!) what causes the error.
(Fixing the not well-formed message on the page in question is being discussed elsewhere in bug https://github.com/kripken/emscripten/issues/3792 )
I didn't investigate any deeper but the message comes from https://dxr.mozilla.org/mozilla-central/source/dom/locales/en-US/chrome/layout/xmlparser.properties#9 (Tested by modifying the message.) So maybe a bug in the XML parser.
The test in question is doing this: var codeXHR = new XMLHttpRequest(); codeXHR.open('GET', 'not_well_formed.js', true); The error is being logged when it turns out that this .js file can't be parsed as XML, starting around here: https://dxr.mozilla.org/mozilla-central/source/parser/htmlparser/nsExpatDriver.cpp#893 So this seems to be a parser bug in the end. One idea for fixing it is bug 906239. We already arrange to attach stacks on the XHR *callbacks*, but if we captured the stack on the nsXMLHttpRequest itself, we could report it here somehow. Ideally we'd audit all the uses of the console service in platform and see what else needs to be fixed.
Whiteboard: [polish-backlog] → [polish-backlog][gaming-tools]
Created attachment 8734001 [details] threadprofiler.zip Another test case. Opening this by drag-n-drop (via file:// URL) causes a "syntax error" message, and behaves very similar to the above test case.
One idea would be to attach the async stack by making a synthetic frame for the error. The same idea came up in bug 1316067.
You need to log in before you can comment on or make changes to this bug.