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)
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.
Assignee | ||
Updated•24 years ago
|
OS: Linux → All
Comment 1•24 years ago
|
||
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!
Assignee | ||
Comment 2•24 years ago
|
||
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?
Comment 3•24 years ago
|
||
This bug is probably in the content sink, so yeah, HTML would be a different
bug, because it has a differeent content sink.
Assignee | ||
Comment 4•24 years ago
|
||
Reassigning to harishd, see also bug 111576, for the same problem in HTML.
Assignee: waterson → harishd
Assignee | ||
Updated•24 years ago
|
Priority: -- → P1
Assignee | ||
Updated•24 years ago
|
Whiteboard: [native]
Updated•24 years ago
|
QA Contact: rginda → caillon
Status: NEW → ASSIGNED
Priority: P1 → P2
Target Milestone: --- → mozilla0.9.9
Comment 5•24 years ago
|
||
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
Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla1.2 → mozilla1.0
Rob and I talked about this and he knows how to fix it. Giving back to rginda :)
Assignee: harishd → rginda
Status: ASSIGNED → NEW
Comment 10•21 years ago
|
||
Is this still broken?
/be
Updated•21 years ago
|
Product: Core → Other Applications
Comment 11•20 years ago
|
||
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()"> 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 12•20 years ago
|
||
Comment 11 has nothing to do with this bug. It describes a different (known) bug in attribute event handlers.
Comment 13•20 years ago
|
||
Which bug is it?
Comment 14•20 years ago
|
||
Looks like bug 240421
Comment 15•15 years ago
|
||
Still valid, although __toplevel__ seems to be correct now.
All other functions of a .xul file are off by -1.
Comment 16•7 years ago
|
||
Component is obsolete so resolving bugs as INCOMPLETE
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
Updated•7 years ago
|
Product: Other Applications → Other Applications Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•