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

Use concat-stream for buffering stream contents #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jarofghosts
Copy link

We are running into an issue where occasionally a surrogate pair in our bundle is being split and the string concatenation method used here is causing the output to be invalid. This switches the buffering to be done with concat-stream so that it is operating on the raw buffers and only converted to a string once it is complete.

pirxpilot added a commit to pirxpilot/exorcist that referenced this pull request Jun 26, 2019
since every chunk was converted to string separately when chunk/buffer
boundary falls into multibyte character we end up with invalid sources

the fix relies on concatenating all the chunks into a single Buffer
before decoding the resulting buffer to String

see: thlorenz/mold-source-map#9
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.

None yet

1 participant