Closed Bug 179068 Opened 22 years ago Closed 22 years ago

String literals in Rhino are limited to 64K

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: user, Assigned: norrisboyd)

Details

Attachments

(2 files)

Currently Rhino does not support long string literals with more then 64K of characters, which can be a problem to run it against automatically generated scripts.
Attached file Test case
Test that the interpreter can handle string literals exceeding 64K limit. For that the script passes to eval "str ='LONG_STRING_LITERAL';" where LONG_STRING_LITERAL is a string with 200K chars.
The current 64K limit comes from omj/Parser.java where it constructs the internal script presentation for future decompilation. The patch extends this form to allow string sequences with more then 64K characters and modifes decompilation code in omj/NativeFunction.java accordingly.
Note that the above patch does not extend support for extremely long strings to the compiler mode due to 64K limit on string in Java classfile format, but at least with interpreter mode a Java-based browser can support a generate HTML containing <script> ... document.write('HTML CODE WITH MORE THEN 64K CHARACTERS'); ... </script>
Testcase added to JS testsuite: mozilla/js/tests/js1_5/String/regress-179068.js
I commited the fix
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Marking Verified FIXED. The above testcase used to fail in Rhino; now it passes in both compiled and interpreted mode on WinNT -
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R4
Target Milestone: --- → 1.5R4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: