fix(43939): forbid converting getters to async/await (#43944)

This commit is contained in:
Oleksandr T
2021-05-06 01:48:54 -07:00
committed by GitHub
parent 97f5c62956
commit e0d7703cf3
3 changed files with 22 additions and 2 deletions
@@ -1698,6 +1698,14 @@ function [#|f|](x?: number): Promise<void> | number {
if (x) return x;
return fetch('').then(() => {});
}
`);
_testConvertToAsyncFunctionFailed("convertToAsyncFunction__NoSuggestionInGetters", `
class Foo {
get [#|m|](): Promise<number> {
return Promise.resolve(1).then(n => n);
}
}
`);
});