Closed Bug 98255 Opened 24 years ago Closed 7 years ago

Line numbers are wrong for scripts compiled in XUL files

Categories

(Other Applications Graveyard :: Venkman JS Debugger, defect, P2)

x86
All
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE
Future

People

(Reporter: rginda, Assigned: rginda)

Details

(Whiteboard: [native])

The line numbers passed to the JS engine when compiling a script declared in a XUL file are incorrect. From what I can tell, the offset is not constant, but has always been negative (ie, the script that starts on line 10 is reported as starting on line 7.) For the record, when the numbers are correct, __toplevel__ scripts should be reported as starting on the same line as the <script> tag, and functions should be reported as starting on the line with the open brace for that function. (If the top level is correct, the js engine should sort out the rest.) To reproduce, build venkman, start mozilla with the -venkman command line option, and launch mailnews from the venkman tasks menu. Once mailnews loads... Locate the "contentAreaContextOverlay.xul" entry in the file tree (left, middle outliner). open the tree item and click on the "__toplevel__" entry. In my build, this navigates me to line 29 of the file, but the acutal script starts on line 32, with the <script> tag that encloses the |var gContextMenu = null| code, an offset of -3. It seems most of the other XUL files in this test are off by -1.
OS: Linux → All
Another example: 1. Load http://michael-nuhn.de/ 2. In the mid-left pane of venkman, expand the parent http node 3. Highlight the function name "showtip2" 4. The corresponding code is now shaded in the upper-right pane 5. But the shading is off-kilter by a few lines. For example, now I see the shading begin on line 151, but the function declaration for showtip2() begins on line 154... Furthermore, this translates all the breakpoint icons by the same amount. It's now confusing where to click to set a breakpoint on a desired line - i.e. "Should I click three lines higher than the line...or three lower?" , etc. It gets even more confusing if the opening brace of the function declaration is not on the same line as the function name... as in function showtip2() { etc. Should be able to click right on a desired line to set a breakpoint on it!
Line numbers are off in HTML files too. Waterson, what's the dillio? Should I file a new bug for the HTML problem against someone else?
This bug is probably in the content sink, so yeah, HTML would be a different bug, because it has a differeent content sink.
Reassigning to harishd, see also bug 111576, for the same problem in HTML.
Assignee: waterson → harishd
Priority: -- → P1
Whiteboard: [native]
QA Contact: rginda → caillon
Status: NEW → ASSIGNED
Priority: P1 → P2
Target Milestone: --- → mozilla0.9.9
Target Milestone: mozilla0.9.9 → mozilla1.0
Moving Netscape owned 0.9.9 and 1.0 bugs that don't have an nsbeta1, nsbeta1+, topembed, topembed+, Mozilla0.9.9+ or Mozilla1.0+ keyword. Please send any questions or feedback about this to adt@netscape.com. You can search for "Moving bugs not scheduled for a project" to quickly delete this bugmail.
Target Milestone: mozilla1.0 → mozilla1.2
Target Milestone: mozilla1.2 → mozilla1.0
Important for JS debugger. Nominating for nsbeta1
Keywords: nsbeta1
Rob and I talked about this and he knows how to fix it. Giving back to rginda :)
Assignee: harishd → rginda
Status: ASSIGNED → NEW
not going to make 1.0
Target Milestone: mozilla1.0 → Future
adt: nsbeta1-
Keywords: nsbeta1nsbeta1-
Is this still broken? /be
Product: Core → Other Applications
It's broken with Firefox 1.5 [[Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5]] and Venkman 0.9.85.jw2 (unsupported port to FF 1.5). Although I observed this bug with script embedded in HTML, it might be the same. Run venkman on http://www.feertech.com/jsfractals.html Set a breakpoint at line 60 of jsfractals.html and press the "Draw It!" button. The call stack reports the current frame is at line 60, but the parent frame is at line 1 instead of line 186 of jsfractals.html. Here's the source: <input TYPE="Button" VALUE="Draw It!" onClick="drawFractal()"> &nbsp;Draw with these co-ordinates. When I look at the info that is coming through the jsds.scriptHook.onScriptCreated, I can see that the script that contains the onClick handler is given line 1-2 instead of lines 186-187.
Comment 11 has nothing to do with this bug. It describes a different (known) bug in attribute event handlers.
Which bug is it?
Looks like bug 240421
QA Contact: caillon → venkman
Still valid, although __toplevel__ seems to be correct now. All other functions of a .xul file are off by -1.
Component is obsolete so resolving bugs as INCOMPLETE
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.