Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsJSEnvironment.cpp File Reference
#include "nsJSEnvironment.h"
#include "nsIScriptContextOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIDOMChromeWindow.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDOMNode.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsIDOMText.h"
#include "nsIDOMAttr.h"
#include "nsIDOMNamedNodeMap.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMKeyEvent.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIScriptSecurityManager.h"
#include "nsDOMCID.h"
#include "nsIServiceManager.h"
#include "nsIXPConnect.h"
#include "nsIJSContextStack.h"
#include "nsIJSRuntimeService.h"
#include "nsCOMPtr.h"
#include "nsReadableUtils.h"
#include "nsJSUtils.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsPresContext.h"
#include "nsIConsoleService.h"
#include "nsIScriptError.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIPrompt.h"
#include "nsIObserverService.h"
#include "nsGUIEvent.h"
#include "nsScriptNameSpaceManager.h"
#include "nsIThread.h"
#include "nsITimer.h"
#include "nsDOMClassInfo.h"
#include "nsIAtom.h"
#include "nsContentUtils.h"
#include "jscntxt.h"
#include "jsdbgapi.h"
#include "nsIDOMGCParticipant.h"
#include "nsIDocument.h"
#include "nsIContent.h"
#include "plstr.h"
#include "nsIPlatformCharset.h"
#include "nsICharsetConverterManager.h"
#include "nsUnicharUtils.h"
#include "nsILocaleService.h"
#include "nsICollation.h"
#include "nsCollationCID.h"
#include "nsIStringBundle.h"
#include "prlog.h"
#include "prthread.h"

Go to the source code of this file.

Defines

#define NS_GC_DELAY   2000
#define NS_FIRST_GC_DELAY   10000
#define MAYBE_GC_BRANCH_COUNT_MASK   0x00000fff
#define INITIALIZE_TIME_BRANCH_COUNT_MASK   0x000000ff
#define JS_OPTIONS_DOT_STR   "javascript.options."

Functions

static NS_DEFINE_CID (kCollationFactoryCID, NS_COLLATIONFACTORY_CID)
void JS_DLL_CALLBACK NS_ScriptErrorReporter (JSContext *cx, const char *message, JSErrorReport *report)
 LocaleToUnicode (JSContext *cx, char *src, jsval *rval)
static JSBool ChangeCase (JSContext *cx, JSString *src, jsval *rval, void(*changeCaseFnc)(const nsAString &, nsAString &))
static JSBool JS_DLL_CALLBACK LocaleToUpperCase (JSContext *cx, JSString *src, jsval *rval)
static JSBool JS_DLL_CALLBACK LocaleToLowerCase (JSContext *cx, JSString *src, jsval *rval)
static JSBool JS_DLL_CALLBACK LocaleCompare (JSContext *cx, JSString *src1, JSString *src2, jsval *rval)
static nsresult JSValueToAString (JSContext *cx, jsval val, nsAString *result, PRBool *isUndefined)
static const char * AtomToEventHandlerName (nsIAtom *aName)
const JSClassNS_DOMClassInfo_GetXPCNativeWrapperClass ()
void NS_DOMClassInfo_SetXPCNativeWrapperClass (JSClass *aClass)
static JSBool JS_DLL_CALLBACK GetOptionsProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
static JSBool JS_DLL_CALLBACK SetOptionsProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
static JSBool JS_DLL_CALLBACK DOMGCCallback (JSContext *cx, JSGCStatus status)
 ObjectPrincipalFinder (JSContext *cx, JSObject *obj)
static int PR_CALLBACK MaxScriptRunTimePrefChangedCallback (const char *aPrefName, void *aClosure)
nsresult NS_CreateScriptContext (nsIScriptGlobalObject *aGlobal, nsIScriptContext **aContext)

Variables

const size_t gStackSize = 8192
static nsITimersGCTimer
static PRBool sReadyForGC
nsScriptNameSpaceManagergNameSpaceManager
static nsIJSRuntimeServicesRuntimeService
static const char kJSRuntimeServiceContractID [] = "@mozilla.org/js/xpc/RuntimeService;1"
static const char kDOMStringBundleURL [] = "chrome://global/locale/dom/dom.properties"
static PRThreadgDOMThread
static JSGCCallback gOldJSGCCallback
static PRBool sIsInitialized
static PRBool sDidShutdown
static PRInt32 sContextCount
static PRTime sMaxScriptRunTime
static PRTime sMaxChromeScriptRunTime
static nsIScriptSecurityManagersSecurityManager
static nsICollationgCollation
static nsIUnicodeDecodergDecoder
static const char js_options_dot_str [] = JS_OPTIONS_DOT_STR
static const char js_strict_option_str [] = "strict"
static const char js_werror_option_str [] = "werror"
static JSPropertySpec OptionsProperties []
static JSClass OptionsClass

Define Documentation

Definition at line 493 of file nsJSEnvironment.cpp.

#define JS_OPTIONS_DOT_STR   "javascript.options."

Definition at line 672 of file nsJSEnvironment.cpp.

Definition at line 486 of file nsJSEnvironment.cpp.

Definition at line 130 of file nsJSEnvironment.cpp.

#define NS_GC_DELAY   2000

Definition at line 129 of file nsJSEnvironment.cpp.


Function Documentation

static const char* AtomToEventHandlerName ( nsIAtom aName) [inline, static]

Definition at line 1300 of file nsJSEnvironment.cpp.

{
  const char *name;

  aName->GetUTF8String(&name);

#ifdef DEBUG
  const char *cp;
  char c;
  for (cp = name; *cp != '\0'; ++cp)
  {
    c = *cp;
    NS_ASSERTION (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'),
                  "non-ASCII non-alphabetic event handler name");
  }
#endif

  return name;
}

Here is the caller graph for this function:

static JSBool ChangeCase ( JSContext cx,
JSString src,
jsval rval,
void(*)(const nsAString &, nsAString &)  changeCaseFnc 
) [static]

Definition at line 410 of file nsJSEnvironment.cpp.

{
  nsAutoString result;
  changeCaseFnc(nsDependentJSString(src), result);

  JSString *ucstr = JS_NewUCStringCopyN(cx, (jschar*)result.get(), result.Length());
  if (!ucstr) {
    return JS_FALSE;
  }

  *rval = STRING_TO_JSVAL(ucstr);

  return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool JS_DLL_CALLBACK DOMGCCallback ( JSContext cx,
JSGCStatus  status 
) [static]

Definition at line 2275 of file nsJSEnvironment.cpp.

{
  JSBool result = gOldJSGCCallback ? gOldJSGCCallback(cx, status) : JS_TRUE;

  if (status == JSGC_BEGIN && PR_GetCurrentThread() != gDOMThread)
    return JS_FALSE;

  // XPCJSRuntime::GCCallback does marking from the JSGC_MARK_END callback.
  // we need to call EndGCMark *after* marking is finished.
  // XXX This relies on our callback being registered after
  // XPCJSRuntime's, although if they were registered the other way
  // around the ordering there would be correct.
  if (status == JSGC_MARK_END)
    nsDOMClassInfo::EndGCMark();

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool JS_DLL_CALLBACK GetOptionsProperty ( JSContext cx,
JSObject obj,
jsval  id,
jsval vp 
) [static]

Definition at line 1830 of file nsJSEnvironment.cpp.

{
  if (JSVAL_IS_INT(id)) {
    uint32 optbit = (uint32) JSVAL_TO_INT(id);
    if ((optbit & (optbit - 1)) == 0 && optbit <= JSOPTION_WERROR)
      *vp = (JS_GetOptions(cx) & optbit) ? JSVAL_TRUE : JSVAL_FALSE;
  }
  return JS_TRUE;
}

Here is the call graph for this function:

static nsresult JSValueToAString ( JSContext cx,
jsval  val,
nsAString *  result,
PRBool isUndefined 
) [static]

Definition at line 970 of file nsJSEnvironment.cpp.

{
  if (isUndefined) {
    *isUndefined = JSVAL_IS_VOID(val);
  }

  if (!result) {
    return NS_OK;
  }

  JSString* jsstring = ::JS_ValueToString(cx, val);
  if (jsstring) {
    result->Assign(NS_REINTERPRET_CAST(const PRUnichar*,
                                       ::JS_GetStringChars(jsstring)),
                   ::JS_GetStringLength(jsstring));
  } else {
    result->Truncate();

    // We failed to convert val to a string. We're either OOM, or the
    // security manager denied access to .toString(), or somesuch, on
    // an object. Treat this case as if the result were undefined.

    if (isUndefined) {
      *isUndefined = PR_TRUE;
    }

    if (!::JS_IsExceptionPending(cx)) {
      // JS_ValueToString() returned null w/o an exception
      // pending. That means we're OOM.

      return NS_ERROR_OUT_OF_MEMORY;
    }

    // Tell XPConnect about any pending exceptions. This is needed to
    // avoid dropping JS exceptions in case we got here through nested
    // calls through XPConnect.

    nsContentUtils::NotifyXPCIfExceptionPending(cx);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool JS_DLL_CALLBACK LocaleCompare ( JSContext cx,
JSString src1,
JSString src2,
jsval rval 
) [static]

Definition at line 439 of file nsJSEnvironment.cpp.

{
  nsresult rv;

  if (!gCollation) {
    nsCOMPtr<nsILocaleService> localeService =
      do_GetService(NS_LOCALESERVICE_CONTRACTID, &rv);

    if (NS_SUCCEEDED(rv)) {
      nsCOMPtr<nsILocale> locale;
      rv = localeService->GetApplicationLocale(getter_AddRefs(locale));

      if (NS_SUCCEEDED(rv)) {
        nsCOMPtr<nsICollationFactory> colFactory =
          do_CreateInstance(kCollationFactoryCID, &rv);

        if (NS_SUCCEEDED(rv)) {
          rv = colFactory->CreateCollation(locale, &gCollation);
        }
      }
    }

    if (NS_FAILED(rv)) {
      nsDOMClassInfo::ThrowJSException(cx, rv);

      return JS_FALSE;
    }
  }

  PRInt32 result;
  rv = gCollation->CompareString(nsICollation::kCollationStrengthDefault,
                                 nsDependentJSString(src1),
                                 nsDependentJSString(src2),
                                 &result);

  if (NS_FAILED(rv)) {
    nsDOMClassInfo::ThrowJSException(cx, rv);

    return JS_FALSE;
  }

  *rval = INT_TO_JSVAL(result);

  return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool JS_DLL_CALLBACK LocaleToLowerCase ( JSContext cx,
JSString src,
jsval rval 
) [static]

Definition at line 433 of file nsJSEnvironment.cpp.

{
  return ChangeCase(cx, src, rval, ToLowerCase);
}

Here is the call graph for this function:

Here is the caller graph for this function:

LocaleToUnicode ( JSContext cx,
char *  src,
jsval rval 
)

Definition at line 336 of file nsJSEnvironment.cpp.

{
  nsresult rv;

  if (!gDecoder) {
    // use app default locale
    nsCOMPtr<nsILocaleService> localeService = 
      do_GetService(NS_LOCALESERVICE_CONTRACTID, &rv);
    if (NS_SUCCEEDED(rv)) {
      nsCOMPtr<nsILocale> appLocale;
      rv = localeService->GetApplicationLocale(getter_AddRefs(appLocale));
      if (NS_SUCCEEDED(rv)) {
        nsAutoString localeStr;
        rv = appLocale->
          GetCategory(NS_LITERAL_STRING(NSILOCALE_TIME), localeStr);
        NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get app locale info");

        nsCOMPtr<nsIPlatformCharset> platformCharset =
          do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);

        if (NS_SUCCEEDED(rv)) {
          nsCAutoString charset;
          rv = platformCharset->GetDefaultCharsetForLocale(localeStr, charset);
          if (NS_SUCCEEDED(rv)) {
            // get/create unicode decoder for charset
            nsCOMPtr<nsICharsetConverterManager> ccm =
              do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
            if (NS_SUCCEEDED(rv))
              ccm->GetUnicodeDecoder(charset.get(), &gDecoder);
          }
        }
      }
    }
  }

  JSString *str = nsnull;
  PRInt32 srcLength = PL_strlen(src);

  if (gDecoder) {
    PRInt32 unicharLength = srcLength;
    PRUnichar *unichars = (PRUnichar *)malloc((srcLength + 1) * sizeof(PRUnichar));
    if (unichars) {
      rv = gDecoder->Convert(src, &srcLength, unichars, &unicharLength);
      if (NS_SUCCEEDED(rv)) {
        // terminate the returned string
        unichars[unicharLength] = 0;

        // nsIUnicodeDecoder::Convert may use fewer than srcLength PRUnichars
        if (unicharLength + 1 < srcLength + 1) {
          PRUnichar *shrunkUnichars =
            (PRUnichar *)realloc(unichars, (unicharLength + 1) * sizeof(PRUnichar));
          if (shrunkUnichars)
            unichars = shrunkUnichars;
        }
        str = JS_NewUCString(cx,
                             NS_REINTERPRET_CAST(jschar*, unichars),
                             unicharLength);
      }
      if (!str)
        free(unichars);
    }
  }

  if (!str) {
    nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_OUT_OF_MEMORY);
    return JS_FALSE;
  }

  *rval = STRING_TO_JSVAL(str);
  return JS_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool JS_DLL_CALLBACK LocaleToUpperCase ( JSContext cx,
JSString src,
jsval rval 
) [static]

Definition at line 427 of file nsJSEnvironment.cpp.

{
  return ChangeCase(cx, src, rval, ToUpperCase);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int PR_CALLBACK MaxScriptRunTimePrefChangedCallback ( const char *  aPrefName,
void aClosure 
) [static]

Definition at line 2340 of file nsJSEnvironment.cpp.

{
  // Default limit on script run time to 10 seconds. 0 means let
  // scripts run forever.
  PRBool isChromePref =
    strcmp(aPrefName, "dom.max_chrome_script_run_time") == 0;
  PRInt32 time = nsContentUtils::GetIntPref(aPrefName, isChromePref ? 20 : 10);

  PRTime t;
  if (time <= 0) {
    // Let scripts run for a really, really long time.
    t = LL_INIT(0x40000000, 0);
  } else {
    t = time * PR_USEC_PER_SEC;
  }

  if (isChromePref) {
    sMaxChromeScriptRunTime = t;
  } else {
    sMaxScriptRunTime = t;
  }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2494 of file nsJSEnvironment.cpp.

{
  nsresult rv = nsJSEnvironment::Init();
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIScriptContext> scriptContext;
  rv = nsJSEnvironment::CreateNewContext(getter_AddRefs(scriptContext));
  NS_ENSURE_SUCCESS(rv, rv);

  scriptContext->WillInitializeContext();

  // Bind the script context and the global object
  rv = scriptContext->InitContext(aGlobal);
  NS_ENSURE_SUCCESS(rv, rv);

  scriptContext->DidInitializeContext();

  if (aGlobal) {
    aGlobal->SetContext(scriptContext);
  }

  *aContext = scriptContext;

  NS_ADDREF(*aContext);

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kCollationFactoryCID  ,
NS_COLLATIONFACTORY_CID   
) [static]

Definition at line 1211 of file nsDOMClassInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1217 of file nsDOMClassInfo.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void JS_DLL_CALLBACK NS_ScriptErrorReporter ( JSContext cx,
const char *  message,
JSErrorReport report 
)

Definition at line 167 of file nsJSEnvironment.cpp.

{
  // XXX this means we are not going to get error reports on non DOM contexts
  nsIScriptContext *context = nsJSUtils::GetDynamicScriptContext(cx);

  nsEventStatus status = nsEventStatus_eIgnore;

  if (context) {
    nsIScriptGlobalObject *globalObject = context->GetGlobalObject();

    if (globalObject) {
      nsAutoString fileName, msg;

      if (report) {
        fileName.AssignWithConversion(report->filename);

        const PRUnichar *m = NS_REINTERPRET_CAST(const PRUnichar*,
                                                 report->ucmessage);

        if (m) {
          msg.Assign(m);
        }
      }

      if (msg.IsEmpty() && message) {
        msg.AssignWithConversion(message);
      }

      // First, notify the DOM that we have a script error.
      /* We do not try to report Out Of Memory via a dom
       * event because the dom event handler would encounter
       * an OOM exception trying to process the event, and
       * then we'd need to generate a new OOM event for that
       * new OOM instance -- this isn't pretty.
       */
      nsIDocShell *docShell = globalObject->GetDocShell();
      if (docShell &&
          (!report ||
           (report->errorNumber != JSMSG_OUT_OF_MEMORY &&
            !JSREPORT_IS_WARNING(report->flags)))) {
        static PRInt32 errorDepth; // Recursion prevention
        ++errorDepth;

        nsCOMPtr<nsPresContext> presContext;
        docShell->GetPresContext(getter_AddRefs(presContext));

        if (presContext && errorDepth < 2) {
          nsScriptErrorEvent errorevent(PR_TRUE, NS_SCRIPT_ERROR);

          errorevent.fileName = fileName.get();
          errorevent.errorMsg = msg.get();
          errorevent.lineNr = report ? report->lineno : 0;

          // HandleDOMEvent() must be synchronous for the recursion block
          // (errorDepth) to work.
          globalObject->HandleDOMEvent(presContext, &errorevent, nsnull,
                                       NS_EVENT_FLAG_INIT, &status);
        }

        --errorDepth;
      }

      if (status != nsEventStatus_eConsumeNoDefault) {
        // Make an nsIScriptError and populate it with information from
        // this error.
        nsCOMPtr<nsIScriptError> errorObject =
          do_CreateInstance("@mozilla.org/scripterror;1");

        if (errorObject != nsnull) {
          nsresult rv;

          const char *category = nsnull;
          // Set category to XUL or content, if possible.
          if (docShell) {
            nsCOMPtr<nsIDocShellTreeItem> docShellTI(do_QueryInterface(docShell, &rv));
            if (NS_SUCCEEDED(rv) && docShellTI) {
              PRInt32 docShellType;
              rv = docShellTI->GetItemType(&docShellType);
              if (NS_SUCCEEDED(rv)) {
                category = docShellType == nsIDocShellTreeItem::typeChrome
                  ? "chrome javascript"
                  : "content javascript";
              }
            }
          }

          if (report) {
            PRUint32 column = report->uctokenptr - report->uclinebuf;

            rv = errorObject->Init(msg.get(), fileName.get(),
                                   NS_REINTERPRET_CAST(const PRUnichar*,
                                                       report->uclinebuf),
                                   report->lineno, column, report->flags,
                                   category);
          } else if (message) {
            rv = errorObject->Init(msg.get(), nsnull, nsnull, 0, 0, 0,
                                   category);
          }

          if (NS_SUCCEEDED(rv)) {
            nsCOMPtr<nsIConsoleService> consoleService =
              do_GetService(NS_CONSOLESERVICE_CONTRACTID, &rv);
            if (NS_SUCCEEDED(rv)) {
              consoleService->LogMessage(errorObject);
            }
          }
        }
      }
    }
  }

#ifdef DEBUG
  // Print it to stderr as well, for the benefit of those invoking
  // mozilla with -console.
  nsCAutoString error;
  error.Assign("JavaScript ");
  if (!report) {
    error.Append("[no report]: ");
    error.Append(message);
  } else {
    if (JSREPORT_IS_STRICT(report->flags))
      error.Append("strict ");
    if (JSREPORT_IS_WARNING(report->flags))
      error.Append("warning: ");
    else
      error.Append("error: ");
    error.Append(report->filename);
    error.Append(", line ");
    error.AppendInt(report->lineno, 10);
    error.Append(": ");
    if (report->ucmessage) {
      AppendUTF16toUTF8(NS_REINTERPRET_CAST(const PRUnichar*, report->ucmessage),
                        error);
    } else {
      error.Append(message);
    }
    if (status != nsEventStatus_eIgnore && !JSREPORT_IS_WARNING(report->flags))
      error.Append(" Error was suppressed by event handler\n");
  }
  fprintf(stderr, "%s\n", error.get());
  fflush(stderr);
#endif

#ifdef PR_LOGGING
  if (report) {
    if (!gJSDiagnostics)
      gJSDiagnostics = PR_NewLogModule("JSDiagnostics");

    if (gJSDiagnostics) {
      PR_LOG(gJSDiagnostics,
             JSREPORT_IS_WARNING(report->flags) ? PR_LOG_WARNING : PR_LOG_ERROR,
             ("file %s, line %u: %s\n%s%s",
              report->filename, report->lineno, message,
              report->linebuf ? report->linebuf : "",
              (report->linebuf &&
               report->linebuf[strlen(report->linebuf)-1] != '\n')
              ? "\n"
              : ""));
    }
  }
#endif

  // XXX do we really want to be doing this?
  ::JS_ClearPendingException(cx);
}

Here is the call graph for this function:

Here is the caller graph for this function:

ObjectPrincipalFinder ( JSContext cx,
JSObject obj 
)

Definition at line 2313 of file nsJSEnvironment.cpp.

{
  if (!sSecurityManager)
    return nsnull;

  nsCOMPtr<nsIPrincipal> principal;
  nsresult rv =
    sSecurityManager->GetObjectPrincipal(cx, obj,
                                         getter_AddRefs(principal));

  if (NS_FAILED(rv) || !principal) {
    return nsnull;
  }

  JSPrincipals *jsPrincipals = nsnull;
  principal->GetJSPrincipals(cx, &jsPrincipals);

  // nsIPrincipal::GetJSPrincipals() returns a strong reference to the
  // JS principals, but the caller of this function expects a weak
  // reference. So we need to release here.

  JSPRINCIPALS_DROP(cx, jsPrincipals);

  return jsPrincipals;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static JSBool JS_DLL_CALLBACK SetOptionsProperty ( JSContext cx,
JSObject obj,
jsval  id,
jsval vp 
) [static]

Definition at line 1841 of file nsJSEnvironment.cpp.

{
  if (JSVAL_IS_INT(id)) {
    uint32 optbit = (uint32) JSVAL_TO_INT(id);

    // Don't let options other than strict and werror be set -- it would be
    // bad if web page script could clear JSOPTION_PRIVATE_IS_NSISUPPORTS!
    if ((optbit & (optbit - 1)) == 0 && optbit <= JSOPTION_WERROR) {
      JSBool optval;
      if (! ::JS_ValueToBoolean(cx, *vp, &optval))
        return JS_FALSE;

      uint32 optset = ::JS_GetOptions(cx);
      if (optval)
        optset |= optbit;
      else
        optset &= ~optbit;
      ::JS_SetOptions(cx, optset);
    }
  }
  return JS_TRUE;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 162 of file nsJSEnvironment.cpp.

Definition at line 164 of file nsJSEnvironment.cpp.

PRThread* gDOMThread [static]

Definition at line 148 of file nsJSEnvironment.cpp.

Definition at line 137 of file nsJSEnvironment.cpp.

JSGCCallback gOldJSGCCallback [static]

Definition at line 150 of file nsJSEnvironment.cpp.

const size_t gStackSize = 8192

Definition at line 116 of file nsJSEnvironment.cpp.

Definition at line 674 of file nsJSEnvironment.cpp.

const char js_strict_option_str[] = "strict" [static]

Definition at line 675 of file nsJSEnvironment.cpp.

const char js_werror_option_str[] = "werror" [static]

Definition at line 676 of file nsJSEnvironment.cpp.

const char kDOMStringBundleURL[] = "chrome://global/locale/dom/dom.properties" [static]

Definition at line 145 of file nsJSEnvironment.cpp.

const char kJSRuntimeServiceContractID[] = "@mozilla.org/js/xpc/RuntimeService;1" [static]

Definition at line 142 of file nsJSEnvironment.cpp.

Initial value:

Definition at line 1823 of file nsJSEnvironment.cpp.

Definition at line 155 of file nsJSEnvironment.cpp.

PRBool sDidShutdown [static]

Definition at line 153 of file nsJSEnvironment.cpp.

nsITimer* sGCTimer [static]

Definition at line 134 of file nsJSEnvironment.cpp.

Definition at line 152 of file nsJSEnvironment.cpp.

Definition at line 158 of file nsJSEnvironment.cpp.

Definition at line 157 of file nsJSEnvironment.cpp.

PRBool sReadyForGC [static]

Definition at line 135 of file nsJSEnvironment.cpp.

Definition at line 139 of file nsJSEnvironment.cpp.

Definition at line 160 of file nsJSEnvironment.cpp.