-
Notifications
You must be signed in to change notification settings - Fork 8
New built-in steps #36
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,20 @@ | |
return '{"result" : "__CUKE_ERROR__"}'; | ||
} | ||
|
||
@end | ||
- (CPString)delegatePropertyIsEqual:(CPArray)params | ||
{ | ||
var property = params[0]; | ||
|
||
if (property == nil) | ||
return '{"error" : "The property ' + property +' was not found"}'; | ||
|
||
var expected_value = params[1], | ||
current_value = [[[CPApplication sharedApplication] delegate] valueForKey:property]; | ||
|
||
if (current_value != expected_value) | ||
return '{"error" : "The value should be ' + expected_value +' but was '+ [current_value description] + '"}'; | ||
|
||
return '{"error" : "__NO_ERROR__"}'; | ||
} | ||
|
||
@end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the way errors are reported here, following the pattern i'm used to in obj-c: if there is no error (NO_ERROR) then it is a success. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There isn't any convention or something, we are used to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, no custom error explaining the failure reason ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could have something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call the method
check_application_delegate_property
?