Conversation
1. Assignment declaration -- an assignment that is treated like a declaration. Previously called [JS] special (assignment|declaration), among other things. 2. Expando -- a value that can be used as a target in assignment declarations. Currently, a class, function or empty object literal. Functions are allowed in Typescript, too. Previously called a JS container, JS initializer or expando object. 3. JavaScript -> Javascript. This is annoying to type, and looks like 'Java Script' in a camelCase world. Everything is a pure rename as far as I know. The only test change is the API baselines, which reflect the rename from SymbolFlags.JSContainer to SymbolFlags.Assignment.
| Optional = 1 << 24, // Optional property | ||
| Transient = 1 << 25, // Transient symbol (created during type check) | ||
| JSContainer = 1 << 26, // Contains Javascript special declarations | ||
| Assignment = 1 << 26, // Assignment treated as declaration (eg `this.prop = 1`) |
There was a problem hiding this comment.
The comments make it sound like the meaning changed -- previously this would be the symbol for the thing you're assigning to properties of, now it sounds like the symbol for a particular assignment?
There was a problem hiding this comment.
Yes, I just merged #26690, which puts this flag on all assignment declarations, not just ones that are themselves containers. I decided to put all the renames in this PR, though.
|
|
|
By the way, be sure to make a note in API breaking changes for any public names changed. |
Note that this introduces a variable name collision in a couple of places, which I resolved like this: ```ts const isInJavascript = isInJSFile(node); ```
|
@sandersn 👍 from me |
|
I really would prefer we stay consistent about spelling the names with the appropriate capitalization. We already had "TypeScript" and "JavaScript" as names in the compiler. |
|
@DanielRosenwasser I hope to switch entirely to TS or JS. Any opinions on Ts vs TS? |
Everything is a pure rename as far as I know. The only test change is the API baselines, which reflect the rename from SymbolFlags.JSContainer to SymbolFlags.Assignment.
If you have better ideas for names, please mention them. @RyanCavanaugh and I agree that the best technical term for expando is "Assignment declaration target", but I think this is unwieldy for use in function names.