On Tue, May 09, 2017 at 12:50:26PM +, Nicolas B. Pierron wrote:
On 05/07/2017 07:34 PM, Kris Maglione wrote:
static inline Result
WrapNSResult(PRStatus aRv)
{
if (aRv != PR_SUCCESS) {
return Err(NS_ERROR_FAILURE);
}
return Ok();
}
static inline Result
WrapNSRes
On 05/07/2017 07:34 PM, Kris Maglione wrote:
static inline Result
WrapNSResult(PRStatus aRv)
{
if (aRv != PR_SUCCESS) {
return Err(NS_ERROR_FAILURE);
}
return Ok();
}
static inline Result
WrapNSResult(nsresult aRv)
{
if (NS_FAILED(aRv)) {
I also don't like the NS_TRY name, it seems too close to MOZ_TRY. I would
prefer to avoid names which are identical except s/NS/MOZ/.
Perhaps NSRESULT_TRY would be a better name? It makes it clear that it is
performing the try against the nsresult type.
On Mon, May 8, 2017 at 10:17 AM, Ehsan Akhg
I think these seem like valuable additions to nscore.h. It would be
helpful to extend these facilities that would allow more code to use the
Result-based programming model.
(I'm not too much of a fan of the NS_TRY name, but can't think of a
better name myself... :/ )
On 05/07/2017 03:34 PM
I've been trying to write most of my new code to use Result.h as
much as possible. When I have to mix Result-based code with
nsresult-based code, though, things tend to get ugly, and I wind
up writing helpers. At this point I've wound up writing the same
helpers in 3 or 4 different places, so i
5 matches
Mail list logo