Closed
Bug 412697
Opened 17 years ago
Closed 6 years ago
XML parse errors are reported at deltas to JavaScript source file line numbers
Categories
(Rhino Graveyard :: E4X, defect)
Rhino Graveyard
E4X
Tracking
(Not tracked)
RESOLVED
INACTIVE
People
(Reporter: dominicc, Unassigned)
Details
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/523.10.6 (KHTML, like Gecko) Version/3.0.4 Safari/523.10.6
Build Identifier:
When E4X encounters an error parsing XML it doesn't report the location of the error in the XML, and the line number it reports for the JavaScript source is wrong.
Reproducible: Always
Steps to Reproduce:
Run a Rhino JavaScript console:
js> var x = XML("<foo>\n\n<bar>\n\n</foo>")
Actual Results:
Output:
js: "<stdin>", line 6: uncaught JavaScript runtime exception: TypeError: The element type "bar" must be terminated by the matching end-tag "</bar>".
at <stdin>:2
"line 6" is wrong.
SAX reports the error on line "5" (the closing </foo> tag; SAX counts line numbers from one) of the XML input. The TypeError is ascribed to line 6 of the JavaScript source. Using at <stdin>:2 as the baseline, Rhino's E4X arrives at an error on line 6 via (line number of topmost stack frame) + (line number in XML reported by SAX via SAXParseException.getLineNumber() - 1).
Expected Results:
The error message should describe the location in the XML that is invalid. The source line in the JavaScript stack trace should be accurate.
org.mozilla.javascript.xmlimpl.XmlProcessor.RhinoSAXErrorHandler.throwError is calling ScriptRuntime.constructError(String, String, int)--that last int is a delta to the current frame; it is passing the zero-based line number of the error in the XML there. throwError should be updated to include the location in the text of the error and leave the line numbers of the JavaScript stack trace alone.
Comment 1•6 years ago
|
||
Closing. Bug management is now done here:
https://github.com/mozilla/rhino
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
You need to log in
before you can comment on or make changes to this bug.
Description
•