mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Stop adding name of function being fixed and update baseline
This commit is contained in:
@@ -172,7 +172,7 @@ namespace ts.codefix {
|
||||
|
||||
// if the identifier refers to a function we want to add the new synthesized variable for the declaration (ex. blob in let blob = res(arg))
|
||||
// Note - the choice of the last call signature is arbitrary
|
||||
if (lastCallSignature && !synthNamesMap.has(symbolIdString)) {
|
||||
if (lastCallSignature && !isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) {
|
||||
const firstParameter = firstOrUndefined(lastCallSignature.parameters);
|
||||
const ident = firstParameter && isParameter(firstParameter.valueDeclaration) && tryCast(firstParameter.valueDeclaration.name, isIdentifier) || createOptimisticUniqueName("result");
|
||||
const synthName = getNewNameIfConflict(ident, collidingSymbolMap);
|
||||
|
||||
@@ -9,8 +9,8 @@ function res(){
|
||||
// ==ASYNC FUNCTION::Convert to async function==
|
||||
|
||||
async function f() {
|
||||
const result_1 = await fetch('https://typescriptlang.org');
|
||||
return res(result_1);
|
||||
const result = await fetch('https://typescriptlang.org');
|
||||
return res(result);
|
||||
}
|
||||
function res(){
|
||||
console.log("done");
|
||||
|
||||
@@ -9,8 +9,8 @@ function res(){
|
||||
// ==ASYNC FUNCTION::Convert to async function==
|
||||
|
||||
async function f() {
|
||||
const result_1 = await fetch('https://typescriptlang.org');
|
||||
return res(result_1);
|
||||
const result = await fetch('https://typescriptlang.org');
|
||||
return res(result);
|
||||
}
|
||||
function res(){
|
||||
console.log("done");
|
||||
|
||||
Reference in New Issue
Block a user