Skip to content
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

Fix converting long Text to JS string #15

Merged
merged 1 commit into from
Dec 30, 2014
Merged

Fix converting long Text to JS string #15

merged 1 commit into from
Dec 30, 2014

Conversation

mtolly
Copy link
Contributor

@mtolly mtolly commented Dec 28, 2014

In (at least) iOS Safari, converting a long Text (over 65536 chars) to a JS string fails due to applying a large array as function arguments to String.fromCharCode; see https://bugs.webkit.org/show_bug.cgi?id=80797.
This breaks the array up into chunks that fit under this limit, concatenating the strings as it goes.
A quick search says there might be a few more String.fromCharCode.apply calls nearby with the same issue, but this patch successfully fixed the conversion for me.

mtolly referenced this pull request in mtolly/hs-cordova Dec 28, 2014
will probably switch to lazy text.
funnily enough this breaks the DataURL camera test,
whereas it worked with String.
@luite
Copy link
Member

luite commented Dec 30, 2014

Thanks. This is a known issue, #10 , you've probably fixed the most important one. I'll keep #10 open until i've checked the rest of the code for similar situations.

luite added a commit that referenced this pull request Dec 30, 2014
Fix converting long Text to JS string
@luite luite merged commit 651eae4 into ghcjs:master Dec 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants