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.
Created attachment 169765 [details] Contains screenshot of error, and two html-files one with the error one without
OS: Linux → All
Product: Firefox → Core
Hardware: PC → All
Assignee: bugs → general
QA Contact: firefox.js-console → pschwartau
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.
Confirming with current trunk.
Status: UNCONFIRMED → NEW
Ever confirmed: true
IE fails with out of memory on Erik's test case. Brendan, what say you? Thumbs down-> wontfix?
QA Contact: pschwartau → moz
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
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
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
Fixed; it was obvious and safe for 1.8b2. /be
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.