Closed
Bug 276289
Opened 20 years ago
Closed 20 years ago
Better error for extremely long array initialiser
Categories
(Core :: JavaScript Engine, defect, P2)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla1.8beta2
People
(Reporter: firefox_bugzilla, Assigned: brendan)
References
()
Details
(Keywords: js1.5)
Attachments
(2 files)
When loading a page with a JS-array on one line containing about 10MB of data, I
get an error that the array is not "closed" there is a missing "]".
This is not the case, as the screenshot of the error indicates. It seems that
the buffer reading lines from the document is simply not big enough, thus the
array seems unfinished.
I have "shortened" the array in an other file, and then no error occurs.
Reporter | ||
Comment 1•20 years ago
|
||
Updated•20 years ago
|
OS: Linux → All
Product: Firefox → Core
Hardware: PC → All
Updated•20 years ago
|
Component: JavaScript Console → JavaScript Engine
Updated•20 years ago
|
Assignee: bugs → general
QA Contact: firefox.js-console → pschwartau
Comment 2•20 years ago
|
||
Well, at least using eval() the limit is a lot lower than 10 MB, the script
fails at 196613 characters (6 more than IE6 ;-)).
Warning: the testcase sometimes crashes Firefox/20041229 Win32 for me if the
JavaScript Console is open while it's running. Sorry, no talkback ID, the
talkback agent still can't be installed with this build.
Comment 3•20 years ago
|
||
Doh, there is a 64K limit in place here and each of the elements in my testcase
takes 3 characters, that's why I get 196613 (3*65536+5) as the limit.
Comment 4•20 years ago
|
||
Confirming with current trunk.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 5•20 years ago
|
||
IE fails with out of memory on Erik's test case. Brendan, what say you? Thumbs
down-> wontfix?
QA Contact: pschwartau → moz
Assignee | ||
Comment 6•20 years ago
|
||
I'd like to diagnose this first.
Crazy amounts of data are flowing as/in JS, these days ("Ajax", donchaknow). If
we can fix this easily, and you have a lot of RAM, why not?
/be
Assignee: general → brendan
Assignee | ||
Comment 7•20 years ago
|
||
This is because of the 16 bit immediate literal index limit, which I've lifted
with the checkin for bug 155081 to a 24 bit (effectively, 23 bits because of
source note representation) limit. That ought to be enough!
This bug should be morphed, no matter the limit, to ask for a clear diagnostic
that says what the problem is, instead of making a bogus syntax error out of an
array literal too long to fit in the engine's current bytecode representation.
/be
Status: NEW → ASSIGNED
Keywords: js1.5
Priority: -- → P2
Summary: JS-error on long lines (10MB of data in an array) → Better error for extremely long array initialiser
Target Milestone: --- → mozilla1.8beta2
Version: 1.0 Branch → Trunk
Assignee | ||
Comment 8•20 years ago
|
||
Fixed; it was obvious and safe for 1.8b2.
/be
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•