From: Adam Thompson <arthompson1990@gmail.com>
To: Chris Brannon <chris@the-brannons.com>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] error legs first step
Date: Mon, 10 Feb 2014 10:17:49 +0000 [thread overview]
Message-ID: <20140210101749.GK11542@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <87r47cdkhb.fsf@mushroom.PK5001Z>
On Sun, Feb 09, 2014 at 01:50:08PM -0800, Chris Brannon wrote:
> Karl Dahlke <eklhad@comcast.net> writes:
>
> > I think the first step in error legs is to allow for the possibility
> > of cw->jss = null.
> > It would become null if we encountered an error,
>
> This sounds good to me.
Same here. To be honest, I've half been thinking of making a macro to do
something like:
#define SWITCH_COMPARTMENT(retval) if ((cw->jss == NULL) || (cw->jss->jcx == NULL)) \
return (retval); \
JSAutoCompartment ac(cw->jss->jcx, cw->jss->jwin)
Usage would probably look like (for an eb_bool function):
SWITCH_COMPARTMENT(eb_false);
For a void function it would be:
SWITCH_COMPARTMENT(void);
This needs to be a macro for the return,
and of course assumes we never use ac as a var name for something else (could be made a parameter if we need).
Cheers,
Adam.
prev parent reply other threads:[~2014-02-10 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-09 21:02 Karl Dahlke
2014-02-09 21:50 ` Chris Brannon
2014-02-10 10:17 ` Adam Thompson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140210101749.GK11542@toaster.adamthompson.me.uk \
--to=arthompson1990@gmail.com \
--cc=Edbrowse-dev@lists.the-brannons.com \
--cc=chris@the-brannons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).