fix(40150): use parameter name for a Promise callback function (#40191)

This commit is contained in:
Alex T
2020-09-08 23:44:38 +03:00
committed by GitHub
parent 15084465b7
commit 6101fbca39
3 changed files with 41 additions and 1 deletions

View File

@@ -1441,5 +1441,19 @@ function [#|get|]() {
function [#|f|]() {
return Promise.resolve().then(undefined, undefined, () => 1);
}`);
_testConvertToAsyncFunction("convertToAsyncFunction_callbackArgument", `
function foo(props: any): void {
return props;
}
const fn = (): Promise<(message: string) => void> =>
new Promise(resolve => resolve((message: string) => foo(message)));
function [#|f|]() {
return fn().then(res => res("test"));
}
`);
});
}