From 117ac0f5d60f0637f435d61e2bb4b0e5fd68d352 Mon Sep 17 00:00:00 2001 From: cacaodev Date: Sun, 27 Dec 2015 19:31:05 +0100 Subject: [PATCH] FIXED: replace js Array.map function with capp API Also fixed BlockExpression description to match a little more with cocoa impl. --- Foundation/CPPredicate/_CPBlockExpression.j | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Foundation/CPPredicate/_CPBlockExpression.j b/Foundation/CPPredicate/_CPBlockExpression.j index 4b1472e1a..10a007205 100644 --- a/Foundation/CPPredicate/_CPBlockExpression.j +++ b/Foundation/CPPredicate/_CPBlockExpression.j @@ -65,12 +65,10 @@ { var args = []; - if (_arguments !== nil) + [_arguments enumerateObjectsUsingBlock:function(exp, idx) { - args = _arguments.map(function(expression){ - return [expression expressionValueWithObject:object context:context]; - }); - } + [args addObject:[exp expressionValueWithObject:object context:context]]; + }]; return _block(object, args, context); } @@ -89,7 +87,7 @@ - (CPString)description { - return [CPString stringWithFormat:@"Block(0x%@)", [CPString stringWithHash:[self UID]]]; + return [CPString stringWithFormat:@"Block(function, %@)", [_arguments description]]; } @end \ No newline at end of file