mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat: proper handling for bindings with converters that were undefined (#9813)
This commit is contained in:
committed by
GitHub
parent
ac2e944fd3
commit
a1772c0005
@@ -91,7 +91,17 @@ const expressionParsers = {
|
|||||||
|
|
||||||
if (expression.operator == '|') {
|
if (expression.operator == '|') {
|
||||||
if (converterExpression.nsRequiresConverter) {
|
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');
|
throw new Error('Invalid converter syntax');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user