@@ -31437,7 +31437,7 @@ namespace ts {
31437
31437
*/
31438
31438
function checkClassNameCollisionWithObject(name: Identifier): void {
31439
31439
if (languageVersion === ScriptTarget.ES5 && name.escapedText === "Object"
31440
- && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
31440
+ && moduleKind < ModuleKind.ES2015) {
31441
31441
error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
31442
31442
}
31443
31443
}
@@ -32597,7 +32597,7 @@ namespace ts {
32597
32597
error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
32598
32598
}
32599
32599
32600
- if (moduleKind !== ModuleKind.System && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
32600
+ if (moduleKind !== ModuleKind.System && moduleKind < ModuleKind.ES2015) {
32601
32601
checkExternalEmitHelpers(node, ExternalEmitHelpers.ExportStar);
32602
32602
}
32603
32603
}
@@ -35805,7 +35805,9 @@ namespace ts {
35805
35805
return grammarErrorOnNode(node.exclamationToken, Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation);
35806
35806
}
35807
35807
35808
- if (compilerOptions.module !== ModuleKind.ES2015 && compilerOptions.module !== ModuleKind.ESNext && compilerOptions.module !== ModuleKind.System && !compilerOptions.noEmit &&
35808
+ const moduleKind = getEmitModuleKind(compilerOptions);
35809
+
35810
+ if (moduleKind < ModuleKind.ES2015 && moduleKind !== ModuleKind.System && !compilerOptions.noEmit &&
35809
35811
!(node.parent.parent.flags & NodeFlags.Ambient) && hasModifier(node.parent.parent, ModifierFlags.Export)) {
35810
35812
checkESModuleMarker(node.name);
35811
35813
}
@@ -36151,7 +36153,7 @@ namespace ts {
36151
36153
36152
36154
function checkGrammarImportCallExpression(node: ImportCall): boolean {
36153
36155
if (moduleKind === ModuleKind.ES2015) {
36154
- return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_commonjs_amd_system_or_umd );
36156
+ return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd );
36155
36157
}
36156
36158
36157
36159
if (node.typeArguments) {
0 commit comments