Use WTF-8 as string encoding in binjs file and escape lone surrogate while processing (fixes #190)#193
Merged
Merged
Conversation
Collaborator
Author
|
patch for SpiderMonkey side https://bugzilla.mozilla.org/show_bug.cgi?id=1501155 |
Collaborator
|
@SimonSapin has agreed to review this patch. Let's see how I can add him to the mix. |
SimonSapin
approved these changes
Nov 8, 2018
Collaborator
SimonSapin
left a comment
There was a problem hiding this comment.
Looks good to me! I didn’t find any bug. I left inline comments about small nits that could make the code a bit more idiomatic or a bit more efficient (though maybe that’s premature optimization). Feel free to ignore any or all of them.
…while processing (fixes binast#190)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applied the following changes:
escaped_wtf8module, which converts between WTF-8 and UTF-8 + escape sequence (\x7F+XXXX)shift.rs(we could output WTF-8 from Node side and decode/escape WTF-8 in Rust side, but I didn't want to add more module dependency in node side)(but of course no effect if the input has no lone surrogate)
escaped_wtf8::for_print) forbinjs_dumpand used there, in order to see the escaped string in (incorrect but) more similar-to-usual way