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

js-beautify produces invalid code for variables with Unicode escape sequences #1211

Closed
CapacitorSet opened this issue Jul 4, 2017 · 1 comment

Comments

@CapacitorSet
Copy link

js-beautify produces invalid code when beautifying code that has Unicode escape sequences in identifiers. "In the wild", I found it to break on code containing the following statement: var \u0053\u0074\u0072\u0069\u006e\u0067\u0033\u0034\u0035\u0036={...}.

A minimal test case is var \u0053, which should be left untouched but is instead transformed to var\ u0053.

@bitwiseman
Copy link
Member

@CapacitorSet
Thanks for the bug report.
This bug is here: https://github.com/beautify-web/js-beautify/blob/2009d250914ba865e81b20b264aa40736e38bf86/js/src/javascript/tokenizer.js#L239
The beautifier assumes unicode characters for identifiers, not escape sequences.

@bitwiseman bitwiseman modified the milestones: v1.9.x, v1.9.0 Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants