feat: top-level-for-await (#3212)

This commit is contained in:
Andy Hayden 2019-10-27 06:04:42 -07:00 committed by Ry Dahl
parent 51dd91a3cc
commit aec5a646c9
18 changed files with 257 additions and 263 deletions

View file

@ -616,6 +616,9 @@ window.compilerMain = function compilerMain(): void {
diagnostics = ts.getPreEmitDiagnostics(program).filter(
({ code }): boolean => {
// TS1103: 'for-await-of' statement is only allowed within an async
// function or async generator.
if (code === 1103) return false;
// TS1308: 'await' expression is only allowed within an async
// function.
if (code === 1308) return false;