mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
fix: diagnostic message for class name 'Object' when targeting different ECMAScript versions (#61850)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user