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: Unescape JSON5 identifier values #165

Merged
merged 1 commit into from
Dec 3, 2024
Merged

fix: Unescape JSON5 identifier values #165

merged 1 commit into from
Dec 3, 2024

Conversation

nzakas
Copy link
Collaborator

@nzakas nzakas commented Dec 3, 2024

This pull request includes enhancements to the parse function in js/src/parse.js and corresponding tests in js/tests/parse.test.js. The main changes involve adding a new function to handle Unicode escape sequences in JSON5 identifiers and updating the parse function to use this new normalization.

Enhancements to parse function:

  • js/src/parse.js: Added UNICODE_SEQUENCE regex and normalizeIdentifier function to convert Unicode escape sequences into their corresponding characters.
  • js/src/parse.js: Updated the parse function to use normalizeIdentifier for processing identifiers.

Corresponding tests:

  • js/tests/parse.test.js: Added a test case to ensure unquoted property names with Unicode escape sequences are correctly unescaped.

fixes #164

@nzakas nzakas merged commit 5633bc4 into main Dec 3, 2024
14 checks passed
@nzakas nzakas deleted the issue164 branch December 3, 2024 21:22
@github-actions github-actions bot mentioned this pull request Dec 3, 2024
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.

Unescape json5 keys that aren't in quotes
1 participant