-
Notifications
You must be signed in to change notification settings - Fork 10
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
Handle special characters in property name #297
Comments
Purely out of curiosity, what kind of property would have a '?' in its name? As for checking if a property name should be quoted: the rules for a valid (non-quoted) identifier are well-defined. It should indeed be trivial to check if an identifier is valid without quotes using a regex like this one. |
We can't be 100% sure about that ;)
Yep, that's a good idea
Actually, it will hurt, |
Our
formatPropertyName()
function doesn't handle?
in property name, which may result inOriginally posted by @Maxim-Mazurok in #208 (comment)
This probably should be handled using regular expressions. Check if a property name contains any non-letter characters and surround it with quotes in that case. Perhaps, quotes also should be handled somehow. And, perhaps, not all non-letter characters should be treated as "quotable".
The text was updated successfully, but these errors were encountered: