Allow target-only ES decorators (#57768)

This commit is contained in:
Ron Buckton
2024-03-14 14:44:40 -04:00
committed by GitHub
parent 1c5706092e
commit d64646b3fd
3 changed files with 4 additions and 14 deletions
+2 -1
View File
@@ -34454,7 +34454,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function getDecoratorArgumentCount(node: Decorator, signature: Signature) {
return compilerOptions.experimentalDecorators ?
getLegacyDecoratorArgumentCount(node, signature) :
2;
// Allow the runtime to oversupply arguments to an ES decorator as long as there's at least one parameter.
Math.min(Math.max(getParameterCount(signature), 1), 2);
}
/**