mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-02 14:48:32 -05:00
fix(40150): use parameter name for a Promise callback function (#40191)
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
`);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user