-
Notifications
You must be signed in to change notification settings - Fork 765
fix(2356): omit numeric separators when targeting es2020 #2358
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
Conversation
jakebailey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took me a bit to figure out what the Strada code did but, yeah:
const flags = (neverAsciiEscape ? GetLiteralTextFlags.NeverAsciiEscape : 0)
| (jsxAttributeEscape ? GetLiteralTextFlags.JsxAttributeEscape : 0)
| (printerOptions.terminateUnterminatedLiterals ? GetLiteralTextFlags.TerminateUnterminatedLiterals : 0)
| (printerOptions.target && printerOptions.target >= ScriptTarget.ES2021 ? GetLiteralTextFlags.AllowNumericSeparator : 0);
return getLiteralText(node, sourceFile, flags);Unbelievably, this is the only reason we pass the target into the printer.
(I do bet we have other things that are missing, though.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Er, actually, no, getLiteralTextOfNode is where this should live, which is where I pulled the above code from. There is a TODO there for this (and related code).
Fixes #2356