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

34 lines
2.4 KiB
Plaintext

tests/cases/conformance/node/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
tests/cases/conformance/node/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
tests/cases/conformance/node/subfolder/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ====
// cjs format file
const x = await 1;
~~~~~
!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
export {x};
for await (const y of []) {}
~~~~~
!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
==== tests/cases/conformance/node/index.ts (2 errors) ====
// esm format file
const x = await 1;
~~~~~
!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
export {x};
for await (const y of []) {}
~~~~~
!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.
==== tests/cases/conformance/node/package.json (0 errors) ====
{
"name": "package",
"private": true,
"type": "module"
}
==== tests/cases/conformance/node/subfolder/package.json (0 errors) ====
{
"type": "commonjs"
}