@@ -31598,7 +31598,7 @@ namespace ts {
31598
31598
*/
31599
31599
function checkClassNameCollisionWithObject(name: Identifier): void {
31600
31600
if (languageVersion === ScriptTarget.ES5 && name.escapedText === "Object"
31601
- && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
31601
+ && moduleKind < ModuleKind.ES2015) {
31602
31602
error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
31603
31603
}
31604
31604
}
@@ -32763,7 +32763,7 @@ namespace ts {
32763
32763
error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
32764
32764
}
32765
32765
32766
- if (moduleKind !== ModuleKind.System && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
32766
+ if (moduleKind !== ModuleKind.System && moduleKind < ModuleKind.ES2015) {
32767
32767
checkExternalEmitHelpers(node, ExternalEmitHelpers.ExportStar);
32768
32768
}
32769
32769
}
@@ -35977,7 +35977,9 @@ namespace ts {
35977
35977
return grammarErrorOnNode(node.exclamationToken, Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation);
35978
35978
}
35979
35979
35980
- if (compilerOptions.module !== ModuleKind.ES2015 && compilerOptions.module !== ModuleKind.ESNext && compilerOptions.module !== ModuleKind.System && !compilerOptions.noEmit &&
35980
+ const moduleKind = getEmitModuleKind(compilerOptions);
35981
+
35982
+ if (moduleKind < ModuleKind.ES2015 && moduleKind !== ModuleKind.System && !compilerOptions.noEmit &&
35981
35983
!(node.parent.parent.flags & NodeFlags.Ambient) && hasModifier(node.parent.parent, ModifierFlags.Export)) {
35982
35984
checkESModuleMarker(node.name);
35983
35985
}
@@ -36323,7 +36325,7 @@ namespace ts {
36323
36325
36324
36326
function checkGrammarImportCallExpression(node: ImportCall): boolean {
36325
36327
if (moduleKind === ModuleKind.ES2015) {
36326
- return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_commonjs_amd_system_or_umd );
36328
+ return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd );
36327
36329
}
36328
36330
36329
36331
if (node.typeArguments) {
0 commit comments