nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID()));  if (xpc) { nsCOMPtr<nsIXPCNativeCallContext> nccx; xpc->GetCurrentNativeCallContext(getter_AddRefs(nccx)); if (nccx) { nccx->SetExceptionWasThrown(PR_TRUE); }
nsCOMPtr<nsIXPCNativeCallContext> nccx; nsContentUtils::XPConnect()-> GetCurrentNativeCallContext(getter_AddRefs(nccx)); if (nccx) { nccx->SetExceptionWasThrown(PR_TRUE);
NotifyXPCIfExceptionPending(JSContext *cx){  if (!::JS_IsExceptionPending(cx)) {    return;  }  nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID()));  if (xpc) {    nsCOMPtr<nsIXPCNativeCallContext> nccx;    xpc->GetCurrentNativeCallContext(getter_AddRefs(nccx));    if (nccx) {      nccx->SetExceptionWasThrown(PR_TRUE);    }  }}