I totally liked Promise.defer, but this is not a feature of DOM promises, which will supersede Promise.jsm at some point and will be removed in bug 1034599. We need to replace them with DOM promises in calendar code or use PromiseUtils from bug 1093021.
Created attachment 8556857 [details] [diff] [review]
Here, I realized that implementation of new Promise() as deferred object would require a helper function first and so it's better to look out for places where new Promise can be implemented easily and I found it was in only test_deleted_items.js, every where else our beloved deferred object is used to resolve promise in different parts of code,so I implemented new Promise() here. Would request a review and help in case I have done something wrong.
Comment on attachment 8556857 [details] [diff] [review]
Review of attachment 8556857 [details] [diff] [review]:
You are right, we surprisingly don't use promises that much. Code looks great, thanks for the patch! Let me know if you need more issues to work on. r=philipp.
For checkin, could you change the patch message from "Remove Promise.defer" to something like "Bug 1095119 - Remove Promise.defer usage. r=philipp", upload that as a new attachment and set the checkin-needed keyword? You can directly set review+ on the new patch since I've already +'d this one.
Created attachment 8557016 [details] [diff] [review]
Thank you very much for the help,I never submitted a patch so quickly. If something is wrong with this one we will get back to it. Meanwhile which of these you think i should do next-
I think bug 472630 would be nice, if you want another simple one then bug 842383 is also a good candidate.
Created attachment 8557388 [details] [diff] [review]
fix test failure
The patch caused a failure in the test it is touching:
TEST-UNEXPECTED-FAIL | xpcshell-icaljs.ini:calendar/test/unit/test_deleted_items.js | xpcshell return code: 0
SyntaxError: expected expression, got ')' at /builds/slave/test/build/tests/xpcshell/tests/calendar/test/unit/test_deleted_items.js:31
ReferenceError: run_test is not defined at /builds/slave/test/build/tests/xpcshell/head.js:504
I try to fix the syntax error in this patch.
Aryx, please push to try server.
Pushed to Thunderbird-Try https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=805e9cd652fa
Created attachment 8557426 [details] [diff] [review]
fix test failure v2
Didn't work :)
Comment on attachment 8557016 [details] [diff] [review]
Pushed to comm-central changeset 12201ec2a310
Sorry about the missing push comment, my python script had an error. I'll update the other bugs in case they haven't already been.
Comment on attachment 8557426 [details] [diff] [review]
fix test failure v2
Oops I totally missed you already uploaded a patch, sorry about that. The patch I pushed does about the same thing and also fixes the order of setting the handleCompletion function and calling aFunc().