hookanswer = hook(jsdc, jsdthreadstate, type, hookData, rval); jsd_DestroyThreadState(jsdc, jsdthreadstate);
if ((type != JSD_HOOK_THROW && type != JSD_HOOK_INTERRUPTED) || jsdc->flags & JSD_MASK_TOP_FRAME_ONLY || !(jsdthreadstate->flags & TS_HAS_DISABLED_FRAME)) {  hookanswer = hook(jsdc, jsdthreadstate, type, hookData, rval); jsd_DestroyThreadState(jsdc, jsdthreadstate); }
jsd_CallExecutionHook(JSDContext* jsdc,                      JSContext *cx,                      uintN type,                      JSD_ExecutionHookProc hook,                      void* hookData,                      jsval* rval){    uintN hookanswer = JSD_HOOK_THROW == type ?                             JSD_HOOK_RETURN_CONTINUE_THROW :                            JSD_HOOK_RETURN_CONTINUE;    JSDThreadState* jsdthreadstate;    if(hook && NULL != (jsdthreadstate = jsd_NewThreadState(jsdc,cx)))    {        hookanswer = hook(jsdc, jsdthreadstate, type, hookData, rval);        jsd_DestroyThreadState(jsdc, jsdthreadstate);    }    switch(hookanswer)    {        case JSD_HOOK_RETURN_ABORT:        case JSD_HOOK_RETURN_HOOK_ERROR:            return JSTRAP_ERROR;        case JSD_HOOK_RETURN_RET_WITH_VAL:            return JSTRAP_RETURN;        case JSD_HOOK_RETURN_THROW_WITH_VAL:            return JSTRAP_THROW;        case JSD_HOOK_RETURN_CONTINUE:            break;        case JSD_HOOK_RETURN_CONTINUE_THROW:            /* only makes sense for jsd_ThrowHandler (which init'd rval) */            JS_ASSERT(JSD_HOOK_THROW == type);            return JSTRAP_THROW;        default:            JS_ASSERT(0);            break;    }    return JSTRAP_CONTINUE;}