Repository navigation
Decode JavaScript Unicode code point escapes during extraction - #1394
Open
theman6660 wants to merge 1 commit into
Open
theman6660 wants to merge 1 commit into
theman6660 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
JavaScript gettext("Hello \u{1F600}") evaluates to "Hello 😀", but extraction currently produces the literal text "Hello u{1F600}". The resulting translation key does not match the runtime message.
Recognize lowercase-u braced hexadecimal escapes in unquote_string(), including supplementary code points and leading zeros. Preserve the existing fallback for malformed or out-of-range escapes and leave legacy hexadecimal/Unicode handling intact.
Add 29 cases across single/double quotes and template strings, including the public JavaScript extraction API, line numbers, NUL, BMP and maximum code points, adjacent/legacy escapes and malformed inputs. Before the fix, 23 failed and 6 passed. All 29 now pass; the focused lexer/extractor set has 49 passing tests. A separate Node.js runtime check agrees on 30 valid literal values. Full Babel suite with imported CLDR 48.2: 7860 passed, 7 skipped, 2 xfailed (one existing pytest deprecation warning). Project pre-commit hooks and git diff --check pass.
Prepared with OpenAI Codex assistance. No production usage, human review or upstream CI is claimed.