You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+4
Original file line number
Diff line number
Diff line change
@@ -1059,6 +1059,10 @@
1059
1059
"category": "Error",
1060
1060
"code": 1360
1061
1061
},
1062
+
"'await' outside of an async function is only allowed at the top level of a module when '--module' is 'esnext' or 'system' and '--target' is 'es2017' or higher.": {
1063
+
"category": "Error",
1064
+
"code": 1361
1065
+
},
1062
1066
1063
1067
"The types of '{0}' are incompatible between these types.": {
tests/cases/compiler/awaitInNonAsyncFunction.ts(34,7): error TS1103: A 'for-await-of' statement is only allowed within an async function or async generator.
14
14
tests/cases/compiler/awaitInNonAsyncFunction.ts(35,5): error TS1308: 'await' expression is only allowed within an async function.
15
15
tests/cases/compiler/awaitInNonAsyncFunction.ts(39,5): error TS1103: A 'for-await-of' statement is only allowed within an async function or async generator.
16
-
tests/cases/compiler/awaitInNonAsyncFunction.ts(40,1): error TS1308: 'await' expression is only allowed within an async function.
16
+
tests/cases/compiler/awaitInNonAsyncFunction.ts(40,1): error TS1361: 'await' outside of an async function is only allowed at the top level of a module when '--module' is 'esnext' or 'system' and '--target' is 'es2017' or higher.
!!! error TS1103: A 'for-await-of' statement is only allowed within an async function or async generator.
101
101
await null;
102
102
~~~~~
103
-
!!! error TS1308: 'await' expression is only allowed within an async function.
103
+
!!! error TS1361: 'await' outside of an async function is only allowed at the top level of a module when '--module' is 'esnext' or 'system' and '--target' is 'es2017' or higher.
0 commit comments