@@ -31247,7 +31247,7 @@ namespace ts {
3124731247 */
3124831248 function checkClassNameCollisionWithObject(name: Identifier): void {
3124931249 if (languageVersion === ScriptTarget.ES5 && name.escapedText === "Object"
31250- && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
31250+ && moduleKind < ModuleKind.ES2015) {
3125131251 error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
3125231252 }
3125331253 }
@@ -32422,7 +32422,7 @@ namespace ts {
3242232422 error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
3242332423 }
3242432424
32425- if (moduleKind !== ModuleKind.System && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
32425+ if (moduleKind !== ModuleKind.System && moduleKind < ModuleKind.ES2015) {
3242632426 checkExternalEmitHelpers(node, ExternalEmitHelpers.ExportStar);
3242732427 }
3242832428 }
@@ -35630,7 +35630,9 @@ namespace ts {
3563035630 return grammarErrorOnNode(node.exclamationToken, Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation);
3563135631 }
3563235632
35633- if (compilerOptions.module !== ModuleKind.ES2015 && compilerOptions.module !== ModuleKind.ESNext && compilerOptions.module !== ModuleKind.System && !compilerOptions.noEmit &&
35633+ const moduleKind = getEmitModuleKind(compilerOptions);
35634+
35635+ if (moduleKind < ModuleKind.ES2015 && moduleKind !== ModuleKind.System && !compilerOptions.noEmit &&
3563435636 !(node.parent.parent.flags & NodeFlags.Ambient) && hasModifier(node.parent.parent, ModifierFlags.Export)) {
3563535637 checkESModuleMarker(node.name);
3563635638 }
@@ -35976,7 +35978,7 @@ namespace ts {
3597635978
3597735979 function checkGrammarImportCallExpression(node: ImportCall): boolean {
3597835980 if (moduleKind === ModuleKind.ES2015) {
35979- return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_commonjs_amd_system_or_umd );
35981+ return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd );
3598035982 }
3598135983
3598235984 if (node.typeArguments) {
0 commit comments