feat: proper handling for bindings with converters that were undefined (#9813)

This commit is contained in:
Dimitris - Rafail Katsampas
2022-03-08 17:36:58 +02:00
committed by GitHub
parent ac2e944fd3
commit a1772c0005

View File

@@ -91,7 +91,17 @@ const expressionParsers = {
if (expression.operator == '|') {
if (converterExpression.nsRequiresConverter) {
return expression.right.nsIsCallable ? right : right?.(left);
if (expression.right.nsIsCallable) {
return right;
}
if (isFunction(right)) {
return right(left);
}
if (isNullOrUndefined(right)) {
throw new Error('Cannot perform a call using a null or undefined property');
}
}
throw new Error('Invalid converter syntax');
}