-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StringBuilder/Buffer support in scripting broken #496
Comments
I can understand this this changed things. However that particular change was merged in 2011 and it'd probably make things worse in different ways to change it now. As I recall the Nashorn Engine in Java 8 and 9 does the same thing, and in fact that bit of it was written by the same developer. ConsString does include a toString() method which flattens the string if it needs flattening... |
See renewed discussion here |
Convert non-String, non-ConsString objects to a string when creating a ConsString so that StringBuilders and other CharSequence objects can be used natively more easily. Fixes #1206 and #496 Co-authored-by: Edward Jensen <[email protected]>
…ozilla#1210) Convert non-String, non-ConsString objects to a string when creating a ConsString so that StringBuilders and other CharSequence objects can be used natively more easily. Fixes mozilla#1206 and mozilla#496 Co-authored-by: Edward Jensen <[email protected]>
I think due to 141dc4f#diff-8f122a374db26c040ca0460f9c5b4541L1015 it is no longer possible to utilize StringBuffer/Builder in JavaScript, as all instances of CharSequence become ConString instances or something.
While I understand that the ConString optimization alleviates the need to use StringBuffer/Builder, it breaks existing code and makes inline Java code clumsy, for example the implementation of the characters method of org.xml.sax.helpers.DefaultHandler now looks something like
cellValue += new java.lang.String["(char[])"](chars.slice(start, start + length))
, whereas before it looked likecellValue.append(chars, start, length)
The text was updated successfully, but these errors were encountered: