Fix let/const selection for binding patterns
This commit is contained in:
parent
06c8506f96
commit
42c9b47add
3 changed files with 4 additions and 4 deletions
|
@ -196,8 +196,8 @@ namespace ts.codefix {
|
|||
allVarNames.push({ identifier: synthName.identifier, symbol });
|
||||
addNameToFrequencyMap(collidingSymbolMap, ident.text, symbol);
|
||||
}
|
||||
// we only care about identifiers that are parameters and declarations (don't care about other uses)
|
||||
else if (node.parent && (isParameter(node.parent) || isVariableDeclaration(node.parent))) {
|
||||
// we only care about identifiers that are parameters, declarations, or binding elements (don't care about other uses)
|
||||
else if (node.parent && (isParameter(node.parent) || isVariableDeclaration(node.parent) || isBindingElement(node.parent))) {
|
||||
const originalName = node.text;
|
||||
const collidingSymbols = collidingSymbolMap.get(originalName);
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ function /*[#|*/f/*|]*/(): Promise<void>{
|
|||
// ==ASYNC FUNCTION::Convert to async function==
|
||||
|
||||
async function f(): Promise<void>{
|
||||
let [result] = await fetch('https://typescriptlang.org');
|
||||
const [result] = await fetch('https://typescriptlang.org');
|
||||
console.log(result);
|
||||
}
|
|
@ -6,6 +6,6 @@ function /*[#|*/f/*|]*/(): Promise<void>{
|
|||
// ==ASYNC FUNCTION::Convert to async function==
|
||||
|
||||
async function f(): Promise<void>{
|
||||
let { result } = await fetch('https://typescriptlang.org');
|
||||
const { result } = await fetch('https://typescriptlang.org');
|
||||
console.log(result);
|
||||
}
|
Loading…
Reference in a new issue