Should reserved keywords and other unusable variable names be allowed in event extras?
Categories
(Data Platform and Tools :: Glean: SDK, task)
Tracking
(Not tracked)
People
(Reporter: brizental, Unassigned)
References
Details
Comment 1•2 years ago
|
||
This is especially fun given the lists of reserved words and variable names differ from language to language and platform to platform. For example, in C++, we can't use identifiers prefixed with two underscores, or a single underscore if in the global namespace.
Mitigations are also variable across languages and platforms. e.g. Swift (using backticks) and Rust (using a r#
prefix) each have raw identifiers. But e.g. Kotlin doesn't.
Comment 2•2 years ago
|
||
What names to allow would vary between target languages (or be the union of all) and we would have to maintain that list.
Or escape where we can (Rust is fine, Swift is annoying because then it throws warning you can't suppress).
Right now we effectively already "disallow" certain names depending on the target by the pure fact that it fail the build then. I'm ok keeping it that way for now.
Description
•