Closed Bug 500128 Opened 11 years ago Closed 11 years ago

Long js files (longer than 65535 lines long ?) have incorrect line numbers

Categories

(Core :: JavaScript Engine, defect)

1.9.1 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta3-fixed

People

(Reporter: johnjbarton, Assigned: brendan)

References

()

Details

(Whiteboard: [firebug-p1] fixed-in-tracemonkey [waiting on tracemonkey merge][needs-approval-192][needs-checkin-192])

Attachments

(4 files, 1 obsolete file)

Originally reported at Firebug
http://code.google.com/p/fbug/issues/detail?id=1900
 
The test case is 70000 lines of comments and a function that has an error at line 70003. The error is reported at line 4467.  This is just one symptom. Breakpoints etc don't work. User thinks the lines wrap. 

This problem is going to be suddenly very big. Both dojo and ExtJS have now gone over  60kloc and devs have discovered that loading one be JS file is much faster than 30 smaller files. 

The test code should appear at
http://getfirebug.com/tests/issues/1900 whenever the server thinks its time.
Whiteboard: [firebug-p1]
This is fixed in 3.5, by the patch for bug 490818.

/be
Status: NEW → RESOLVED
Closed: 11 years ago
Depends on: 490818
Resolution: --- → FIXED
My tests on 
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090616 Firefox/3.5

Still gives line 4467 for its error message. The function that is created ('test') has a baseLineNumber of 1 and lineExtent of 4471.  The correct answer would be 70002 and 3 or so.

jjb
Attached file large js
Attached file testcase long.html.bz2
This isn't fixed.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Not fixed in Fx 3.5.2 and not fixed in Fx 3.6a1
Assignee: general → bruce
Attached patch proposed fix (obsolete) — Splinter Review
There's a whole bunch of casts to uint16 in jsscan.cpp and jsscan.h that probably need to be updated.  Can someone take a look at the attached patch?
Oh good grief! Ed, thanks for finding the bug. The patch can be simplified not to cast at all, though. The casts originally were to silence warnings and signal intent to chop to uint16, in the days of mythical <64Kline JS sources.

/be
Flags: wanted1.9.2?
Attached patch patch to commitSplinter Review
My fault, I'll get this revised version of Ed's patch, r=me, checked into the tracemonkey repo right away. Thanks again,

/be
Assignee: bruce → brendan
Attachment #404386 - Attachment is obsolete: true
Status: REOPENED → ASSIGNED
Attachment #404431 - Flags: review+
Fixed in tm:

http://hg.mozilla.org/tracemonkey/rev/deb19a62f1f9

JJB, anyone: please nominate for branches as appropriate. Thanks,

/be
OS: Windows XP → All
Hardware: x86 → All
Whiteboard: [firebug-p1] → [firebug-p1] fixed-in-tracemonkey
Flags: blocking1.9.2?
Whiteboard: [firebug-p1] fixed-in-tracemonkey → [firebug-p1] fixed-in-tracemonkey [waiting on tracemonkey merge]
http://hg.mozilla.org/mozilla-central/rev/deb19a62f1f9
Status: ASSIGNED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Whiteboard: [firebug-p1] fixed-in-tracemonkey [waiting on tracemonkey merge] → [firebug-p1] fixed-in-tracemonkey [waiting on tracemonkey merge][needs-approval-192][needs-checkin-192]
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/cbc59703cc4d
Flags: wanted1.9.2?
Flags: wanted1.9.2+
Flags: blocking1.9.2?
Flags: blocking1.9.2-
You need to log in before you can comment on or make changes to this bug.