Allow to define valid static fields with names conflicting with builtin properties (#54198)

This commit is contained in:
Mateusz Burzyński
2023-05-23 01:44:24 +02:00
committed by GitHub
parent 0d262616f3
commit 1561701b9f
10 changed files with 1845 additions and 183 deletions

View File

@@ -38334,6 +38334,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
case "length":
case "caller":
case "arguments":
if (compilerOptions.useDefineForClassFields) {
break;
}
// fall through
case "prototype":
const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1;
const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node));