diff --git a/dom/base/nsIScriptContext.h b/dom/base/nsIScriptContext.h index 8f5a279215d..c9e44f6030b 100644 --- a/dom/base/nsIScriptContext.h +++ b/dom/base/nsIScriptContext.h @@ -74,8 +74,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContextPrincipal, NS_ISCRIPTCONTEXTPRINCIPAL_IID) #define NS_ISCRIPTCONTEXT_IID \ -{ 0x18b25592, 0xb1f3, 0x4e96, \ - { 0xab, 0x50, 0x3d, 0x91, 0xf4, 0xc8, 0x1d, 0xa1 } } +{ 0x39b3ea7c, 0xdc26, 0x4756, \ + { 0xa0, 0x3c, 0x13, 0xa0, 0x42, 0x03, 0x07, 0x6a } } /* This MUST match JSVERSION_DEFAULT. This version stuff if we don't know what language we have is a little silly... */ @@ -428,7 +428,7 @@ public: * call DidInitializeContext() when a context is fully * (successfully) initialized. */ - virtual nsresult InitClasses(void *aGlobalObj) = 0; + virtual nsresult InitClasses(JSObject* aGlobalObj) = 0; /** * Clear the scope object - may be called either as we are being torn down, diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index d3f43565a61..aa6b2029e09 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2959,13 +2959,9 @@ static JSFunctionSpec EthogramFunctions[] = { #endif nsresult -nsJSContext::InitClasses(void *aGlobalObj) +nsJSContext::InitClasses(JSObject* aGlobalObj) { - nsresult rv = NS_OK; - - JSObject *globalObj = static_cast(aGlobalObj); - - rv = InitializeExternalClasses(); + nsresult rv = InitializeExternalClasses(); NS_ENSURE_SUCCESS(rv, rv); JSAutoRequest ar(mContext); @@ -2973,21 +2969,21 @@ nsJSContext::InitClasses(void *aGlobalObj) ::JS_SetOptions(mContext, mDefaultJSOptions); // Attempt to initialize profiling functions - ::JS_DefineProfilingFunctions(mContext, globalObj); + ::JS_DefineProfilingFunctions(mContext, aGlobalObj); #ifdef NS_TRACE_MALLOC // Attempt to initialize TraceMalloc functions - ::JS_DefineFunctions(mContext, globalObj, TraceMallocFunctions); + ::JS_DefineFunctions(mContext, aGlobalObj, TraceMallocFunctions); #endif #ifdef MOZ_JPROF // Attempt to initialize JProf functions - ::JS_DefineFunctions(mContext, globalObj, JProfFunctions); + ::JS_DefineFunctions(mContext, aGlobalObj, JProfFunctions); #endif #ifdef MOZ_TRACEVIS // Attempt to initialize Ethogram functions - ::JS_DefineFunctions(mContext, globalObj, EthogramFunctions); + ::JS_DefineFunctions(mContext, aGlobalObj, EthogramFunctions); #endif JSOptionChangedCallback(js_options_dot_str, this); diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h index 921f7da3ee5..34289426cf8 100644 --- a/dom/base/nsJSEnvironment.h +++ b/dom/base/nsJSEnvironment.h @@ -161,7 +161,7 @@ public: virtual void SetGCOnDestruction(bool aGCOnDestruction); - virtual nsresult InitClasses(void *aGlobalObj); + virtual nsresult InitClasses(JSObject* aGlobalObj); virtual void ClearScope(void* aGlobalObj, bool bClearPolluters); virtual void WillInitializeContext();