void jsd_RefreshValue(JSDContext* jsdc, JSDValue* jsdval) { JSContext* cx = jsdc->dumbContext; JSCrossCompartmentCall *call = NULL; if(jsdval->string) { /* if the jsval is a string, then we didn't need to root the string */ if(!JSVAL_IS_STRING(jsdval->val)) { JS_BeginRequest(cx); call = JS_EnterCrossCompartmentCall(cx, jsdc->glob); if(!call) { JS_EndRequest(cx); return; } JS_RemoveStringRoot(cx, &jsdval->string); JS_LeaveCrossCompartmentCall(call); JS_EndRequest(cx); } jsdval->string = NULL; } jsdval->funName = NULL; jsdval->className = NULL; DROP_CLEAR_VALUE(jsdc, jsdval->proto); DROP_CLEAR_VALUE(jsdc, jsdval->parent); DROP_CLEAR_VALUE(jsdc, jsdval->ctor); _freeProps(jsdc, jsdval); jsdval->flags = 0; }
void jsd_RefreshValue(JSDContext* jsdc, JSDValue* jsdval) { JSContext* cx = jsdc->dumbContext; if(jsdval->string) { /* if the jsval is a string, then we didn't need to root the string */ if(!JSVAL_IS_STRING(jsdval->val)) { JS_BeginRequest(cx); JS_RemoveRoot(cx, &jsdval->string); JS_EndRequest(cx); } jsdval->string = NULL; } jsdval->funName = NULL; jsdval->className = NULL; DROP_CLEAR_VALUE(jsdc, jsdval->proto); DROP_CLEAR_VALUE(jsdc, jsdval->parent); DROP_CLEAR_VALUE(jsdc, jsdval->ctor); _freeProps(jsdc, jsdval); jsdval->flags = 0; }
void jsd_DropProperty(JSDContext* jsdc, JSDProperty* jsdprop) { JS_ASSERT(jsdprop->nref > 0); if(0 == --jsdprop->nref) { JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links)); DROP_CLEAR_VALUE(jsdc, jsdprop->val); DROP_CLEAR_VALUE(jsdc, jsdprop->name); DROP_CLEAR_VALUE(jsdc, jsdprop->alias); free(jsdprop); } }