Allow moduleSymbolToValidIdentifier to be uppercase for JSX tags (#47625)

* Allow moduleSymbolToValidIdentifier to be uppercase for JSX tags

* Cleaner way of getting the uppercase name when needed

* Fix build errors, get rid of basically unnecessary ScriptTarget

* More accurate name for parameter

* Rename other parameter too

* Fix failing test
This commit is contained in:
Andrew Branch
2022-01-26 16:12:40 -08:00
committed by GitHub
parent 0d3ff0cce8
commit 5813a3541c
7 changed files with 105 additions and 26 deletions

View File

@@ -87,8 +87,8 @@ namespace ts.projectSystem {
// transient symbols are recreated with every new checker.
const programBefore = project.getCurrentProgram()!;
let sigintPropBefore: readonly SymbolExportInfo[] | undefined;
exportMapCache.forEach(bTs.path as Path, (info, name) => {
if (name === "SIGINT") sigintPropBefore = info;
exportMapCache.forEach(bTs.path as Path, (info, getSymbolName) => {
if (getSymbolName() === "SIGINT") sigintPropBefore = info;
});
assert.ok(sigintPropBefore);
assert.ok(sigintPropBefore![0].symbol.flags & SymbolFlags.Transient);
@@ -113,8 +113,8 @@ namespace ts.projectSystem {
// Get same info from cache again
let sigintPropAfter: readonly SymbolExportInfo[] | undefined;
exportMapCache.forEach(bTs.path as Path, (info, name) => {
if (name === "SIGINT") sigintPropAfter = info;
exportMapCache.forEach(bTs.path as Path, (info, getSymbolName) => {
if (getSymbolName() === "SIGINT") sigintPropAfter = info;
});
assert.ok(sigintPropAfter);
assert.notEqual(symbolIdBefore, getSymbolId(sigintPropAfter![0].symbol));