if (!callerdata) return;
if (creating) { jsdIScriptHook *hook = 0;  gJsds->GetScriptHook (&hook); if (!hook) return;  nsCOMPtr<jsdIContext> cx = getter_AddRefs(jsdContext::FromPtr(jsdc)); nsCOMPtr<jsdIScript> script = getter_AddRefs(jsdScript::FromPtr(jsdc, jsdscript)); hook->OnScriptCreated (cx, script); } else { #ifdef DEBUG_verbose printf ("script deleted.\n"); #endif jsdIScript *jsdis = jsdScript::FromPtr(jsdc, jsdscript);  jsdis->Invalidate();  if (gGCStatus == JSGC_END) {  nsCOMPtr<jsdIScriptHook> hook = 0; gJsds->GetScriptHook (getter_AddRefs(hook)); if (hook) { #ifdef DEBUG_verbose printf ("calling script delete hook immediatly.\n"); #endif hook->OnScriptDestroyed (jsdContext::FromPtr(jsdc), jsdis); } } else {  DeadScript *ds = PR_NEW(DeadScript); if (!ds) { NS_RELEASE(jsdis); return;  }  ds->jsdc = jsdc; ds->script = jsdis;  if (gDeadScripts)  PR_APPEND_LINK(&ds->links, &gDeadScripts->links); else {  PR_INIT_CLIST(&ds->links); gDeadScripts = ds; } } }
jsds_ScriptHookProc (JSDContext* jsdc, JSDScript* jsdscript, JSBool creating,                     void* callerdata){    if (!callerdata)        return;        jsdIScriptHook *hook = NS_STATIC_CAST(jsdIScriptHook *, callerdata);    if (creating)        hook->OnScriptLoaded (jsdContext::FromPtr(jsdc),                              jsdScript::FromPtr(jsdc, jsdscript),                              creating ? PR_TRUE : PR_FALSE);}