On Sun, Feb 09, 2014 at 01:50:08PM -0800, Chris Brannon wrote: > Karl Dahlke <[email protected]> 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. _______________________________________________ Edbrowse-dev mailing list [email protected] http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev
