Obj-C Exceptions In Gecko: Difference between revisions

no edit summary
No edit summary
Line 52: Line 52:
** <code>NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;</code>
** <code>NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;</code>
** <code>NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;</code>
** <code>NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;</code>
* Used to wrap an entire method, returns the argument given to the END macro
** <code>NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;</code>
** <code>NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(_rv);</code>


We will probably add another block type that returns nsnull, for use with methods that return xpcom objects, we might add others as the need arises. For any other place where you would like to wrap an entire method, you'll have to use the first basic block macros and refactor code to correctly to place the return statement after the end macro. This means you'll also have to scope any variables used in the return statement correctly.
We will probably add another block type that returns nsnull, for use with methods that return xpcom objects, we might add others as the need arises. For any other place where you would like to wrap an entire method, you'll have to use the first basic block macros and refactor code to correctly to place the return statement after the end macro. This means you'll also have to scope any variables used in the return statement correctly.
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits