Closed Bug 9710 Opened 25 years ago Closed 25 years ago

JS errors reported with wrong filename and line number

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
All
defect

Tracking

()

VERIFIED DUPLICATE of bug 8045

People

(Reporter: jband_mozilla, Assigned: vidur)

Details

given two files: 'a.html' with the three lines: <html> <script src="a.js"></script> </html> 'a.js' with the single line a ==== 0; Apprunner reports the error: URL: file:///h|/temp/a.html Line text: 'a ==== 0;', Error text: '= 0;' There are two problems here: 1) the filename is wrong. The error is in the 'included' a.js not in a.html 2) the linenumber is wrong. In this case the linenumber is not printed at all. I see in NS_ScriptErrorReporter code that looks like: if(report->lineno) { printf("LineNo: %u", report->lineno); } The fact that the lineno is not printed implies that it is zero. Since the error is on the first line of the file this implies that the engine is getting told that the script source starts at line '0'. This is incorrect. We long ago established the convention that line numbers in JS source (.html or .js) start at line '1'. These would both be good problems to fix since so much of the browser itself is now written in JavaScript.
I think this is a dup of bug 8045.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
*** This bug has been marked as a duplicate of 8045 ***
Status: RESOLVED → VERIFIED
Dup of 8045.
You need to log in before you can comment on or make changes to this bug.