@@ -31598,7 +31598,7 @@ namespace ts {
3159831598 */
3159931599 function checkClassNameCollisionWithObject(name: Identifier): void {
3160031600 if (languageVersion === ScriptTarget.ES5 && name.escapedText === "Object"
31601- && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
31601+ && moduleKind < ModuleKind.ES2015) {
3160231602 error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
3160331603 }
3160431604 }
@@ -32763,7 +32763,7 @@ namespace ts {
3276332763 error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
3276432764 }
3276532765
32766- if (moduleKind !== ModuleKind.System && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext ) {
32766+ if (moduleKind !== ModuleKind.System && moduleKind < ModuleKind.ES2015) {
3276732767 checkExternalEmitHelpers(node, ExternalEmitHelpers.ExportStar);
3276832768 }
3276932769 }
@@ -35977,7 +35977,9 @@ namespace ts {
3597735977 return grammarErrorOnNode(node.exclamationToken, Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation);
3597835978 }
3597935979
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 &&
3598135983 !(node.parent.parent.flags & NodeFlags.Ambient) && hasModifier(node.parent.parent, ModifierFlags.Export)) {
3598235984 checkESModuleMarker(node.name);
3598335985 }
@@ -36323,7 +36325,7 @@ namespace ts {
3632336325
3632436326 function checkGrammarImportCallExpression(node: ImportCall): boolean {
3632536327 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 );
3632736329 }
3632836330
3632936331 if (node.typeArguments) {
0 commit comments