fix: diagnostic message for class name 'Object' when targeting different ECMAScript versions (#61850)

This commit is contained in:
Idan Goshen
2025-07-01 01:46:33 +03:00
committed by GitHub
parent 666ef27201
commit 3ba257ffac
17 changed files with 32 additions and 32 deletions

View File

@@ -46645,7 +46645,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
languageVersion >= ScriptTarget.ES5 && name.escapedText === "Object"
&& host.getEmitModuleFormatOfFile(getSourceFileOfNode(name)) < ModuleKind.ES2015
) {
error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0, ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
}
}

View File

@@ -3423,7 +3423,7 @@
"category": "Error",
"code": 2724
},
"Class name cannot be 'Object' when targeting ES5 with module {0}.": {
"Class name cannot be 'Object' when targeting ES5 and above with module {0}.": {
"category": "Error",
"code": 2725
},