Skip to content

Commit

Permalink
fix existing tests to accept new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
uhyo committed May 1, 2019
1 parent 246b66c commit 8e9556a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/baselines/reference/awaitLiteralValues.errors.txt
Expand Up @@ -11,35 +11,41 @@ tests/cases/compiler/awaitLiteralValues.ts(22,5): error TS1308: 'await' expressi
await 'literal';
~~~~~
!!! error TS1308: 'await' expression is only allowed within an async function.
!!! related TS1356 tests/cases/compiler/awaitLiteralValues.ts:1:10: Did you mean to mark this function as 'async'?
}

function awaitNumber() {
await 1;
~~~~~
!!! error TS1308: 'await' expression is only allowed within an async function.
!!! related TS1356 tests/cases/compiler/awaitLiteralValues.ts:5:10: Did you mean to mark this function as 'async'?
}

function awaitTrue() {
await true;
~~~~~
!!! error TS1308: 'await' expression is only allowed within an async function.
!!! related TS1356 tests/cases/compiler/awaitLiteralValues.ts:9:10: Did you mean to mark this function as 'async'?
}

function awaitFalse() {
await false;
~~~~~
!!! error TS1308: 'await' expression is only allowed within an async function.
!!! related TS1356 tests/cases/compiler/awaitLiteralValues.ts:13:10: Did you mean to mark this function as 'async'?
}

function awaitNull() {
await null;
~~~~~
!!! error TS1308: 'await' expression is only allowed within an async function.
!!! related TS1356 tests/cases/compiler/awaitLiteralValues.ts:17:10: Did you mean to mark this function as 'async'?
}

function awaitUndefined() {
await undefined;
~~~~~
!!! error TS1308: 'await' expression is only allowed within an async function.
!!! related TS1356 tests/cases/compiler/awaitLiteralValues.ts:21:10: Did you mean to mark this function as 'async'?
}

4 changes: 4 additions & 0 deletions tests/baselines/reference/parser.forAwait.es2018.errors.txt
Expand Up @@ -52,6 +52,7 @@ tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.t
for await (const x of y) {
~~~~~
!!! error TS1103: A 'for-await-of' statement is only allowed within an async function or async generator.
!!! related TS1356 tests/cases/conformance/parser/ecmascript2018/forAwait/inFunctionDeclWithDeclIsError.ts:1:10: Did you mean to mark this function as 'async'?
}
}
==== tests/cases/conformance/parser/ecmascript2018/forAwait/inFunctionDeclWithExprIsError.ts (1 errors) ====
Expand All @@ -60,6 +61,7 @@ tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.t
for await (x of y) {
~~~~~
!!! error TS1103: A 'for-await-of' statement is only allowed within an async function or async generator.
!!! related TS1356 tests/cases/conformance/parser/ecmascript2018/forAwait/inFunctionDeclWithExprIsError.ts:1:10: Did you mean to mark this function as 'async'?
}
}
==== tests/cases/conformance/parser/ecmascript2018/forAwait/inAsyncFunctionWithDeclIsOk.ts (0 errors) ====
Expand Down Expand Up @@ -92,6 +94,7 @@ tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.t
for await (const x of y) {
~~~~~
!!! error TS1103: A 'for-await-of' statement is only allowed within an async function or async generator.
!!! related TS1356 tests/cases/conformance/parser/ecmascript2018/forAwait/inGeneratorWithDeclIsError.ts:1:11: Did you mean to mark this function as 'async'?
}
}
==== tests/cases/conformance/parser/ecmascript2018/forAwait/inGeneratorWithExprIsError.ts (1 errors) ====
Expand All @@ -100,6 +103,7 @@ tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.t
for await (x of y) {
~~~~~
!!! error TS1103: A 'for-await-of' statement is only allowed within an async function or async generator.
!!! related TS1356 tests/cases/conformance/parser/ecmascript2018/forAwait/inGeneratorWithExprIsError.ts:1:11: Did you mean to mark this function as 'async'?
}
}

0 comments on commit 8e9556a

Please sign in to comment.