Closed
Bug 462704
Opened 16 years ago
Closed 15 years ago
[jsd] incorrect lineExtent when a while loop ends a method
Categories
(Core :: JavaScript Engine, defect, P2)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla1.9.1
People
(Reporter: johnjbarton, Assigned: brendan)
References
Details
(Keywords: fixed1.9.1, Whiteboard: [firebug-p2] fixed-in-tracemonkey)
Attachments
(3 files)
When a function ends with a while loop, jsd gives a lineExtent value that makes the last line appear to be on the while keyword. This makes the line table incorrect and these Javascript functions cannot be breakpointed or single step.
For example, this method will have the wrong line extent unless the comment is removed.
function inner() {
console.log("prompt returned: ",x);
while (x) { // bug not occurring if s/while/if/;
var msg = 'this code is reached'; // I want a breakpoint here
alert(msg);
break;
}
// If this line is not commented, the lineExtent is correct
// console.log("prompt returned: ",x);
}
Reporter | ||
Comment 1•16 years ago
|
||
A complete test case:
http://fbug.googlecode.com/svn/chromebug/tests/jsdTests@johnjbarton.com/content/jsd/jsdIScript/bugzilla-462704.js
The firefox extension:
http://fbug.googlecode.com/svn/chromebug/tests/jsdTests@johnjbarton.com
starts jsd and runs the test case. Tools -> Test Now or run firefox from the command line with -chrome chrome://jsdtest/content/testWebPage.html.
Updated•16 years ago
|
Assignee: nobody → rginda
Component: General → JavaScript Debugger
Product: Firefox → Other Applications
QA Contact: general → venkman
Version: 3.0 Branch → 1.9.0 Branch
Reporter | ||
Comment 2•16 years ago
|
||
For reference,the original bug report:
http://code.google.com/p/fbug/issues/detail?id=1239
Reporter | ||
Updated•16 years ago
|
Whiteboard: [firebug-p2]
so... a xpcshell testcase is slightly easier for people to deal w/
from xpcshell:
load("shell0.js")
load("shell1.js") /* this is the testcase Test462704 */
test();
Assignee | ||
Updated•16 years ago
|
Assignee: rginda → general
Blocks: 371802
Component: JavaScript Debugger → JavaScript Engine
OS: Windows XP → All
Priority: -- → P2
Product: Other Applications → Core
QA Contact: venkman → general
Hardware: PC → All
Target Milestone: --- → mozilla1.9.1b2
Version: 1.9.0 Branch → Trunk
Assignee | ||
Updated•16 years ago
|
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #347488 -
Attachment mime type: application/x-javascript → text/plain
Updated•16 years ago
|
Flags: wanted1.9.1+
Assignee | ||
Updated•15 years ago
|
Target Milestone: mozilla1.9.1b2 → mozilla1.9.1
Assignee | ||
Comment 5•15 years ago
|
||
Codegen changed for loops, which made this ancient bug bite harder. We sometimes need a line number note before JSOP_STOP. This patch emits one when js_EmitTree unwinds to top level and is about to return, which for top level of global and eval code (not function code) happens after each t.l. statement or declaration, but it can't hurt -- CG_CURRENT_LINE(cg) is updated to avoid redundant notes.
/be
Attachment #378763 -
Flags: review?(mrbkap)
Comment 6•15 years ago
|
||
Comment on attachment 378763 [details] [diff] [review]
fix
Looks good to me, as far as I understand what's going on.
Attachment #378763 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 7•15 years ago
|
||
Whiteboard: [firebug-p2] → [firebug-p2] fixed-in-tracemonkey
Updated•15 years ago
|
Attachment #378763 -
Flags: review+
Comment 8•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 9•15 years ago
|
||
Keywords: fixed1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•