TypeScript/tests/baselines/reference/topLevelAwaitNonModule(module=es2022).errors.txt
Kagami Sascha Rosylight 2161e1852f
Add module: es2022 (#44656)
Closes #44653
2021-09-29 17:44:57 -07:00

20 lines
1.4 KiB
Plaintext

tests/cases/conformance/externalModules/topLevelAwaitNonModule.ts(1,1): error TS1375: 'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
tests/cases/conformance/externalModules/topLevelAwaitNonModule.ts(1,7): error TS2304: Cannot find name 'x'.
tests/cases/conformance/externalModules/topLevelAwaitNonModule.ts(5,5): error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
==== tests/cases/conformance/externalModules/topLevelAwaitNonModule.ts (3 errors) ====
await x;
~~~~~
!!! error TS1375: 'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
~
!!! error TS2304: Cannot find name 'x'.
const arr = [Promise.resolve()];
for await (const item of arr) {
~~~~~
!!! error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.
item;
}