diff --git a/dom/base/nsIScriptContext.h b/dom/base/nsIScriptContext.h index f6a4b28a4f50..1cdb72f0950c 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 \ -{ 0x8bfc08bb, 0x0127, 0x46d5, \ - { 0x95, 0xfc, 0xca, 0x25, 0xa0, 0x62, 0xc9, 0x9a } } +{ 0xddc9b75f, 0xa230, 0x4966, \ + { 0xa6, 0xe0, 0x67, 0x5a, 0xba, 0xc9, 0x08, 0x8c } } /* This MUST match JSVERSION_DEFAULT. This version stuff if we don't know what language we have is a little silly... */ @@ -172,7 +172,7 @@ public: * @return NS_OK if the script was valid and got executed * */ - virtual nsresult ExecuteScript(void* aScriptObject, + virtual nsresult ExecuteScript(JSScript* aScriptObject, JSObject* aScopeObject, nsAString* aRetValue, bool* aIsUndefined) = 0; diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 569dbeff4bd9..dfa4cdfbad15 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1596,7 +1596,7 @@ nsJSContext::CompileScript(const PRUnichar* aText, } nsresult -nsJSContext::ExecuteScript(void *aScriptObject, +nsJSContext::ExecuteScript(JSScript* aScriptObject, JSObject* aScopeObject, nsAString* aRetValue, bool* aIsUndefined) @@ -1628,10 +1628,9 @@ nsJSContext::ExecuteScript(void *aScriptObject, return NS_ERROR_FAILURE; } - JSScript *script = static_cast(aScriptObject); nsCOMPtr principal; rv = sSecurityManager->GetObjectPrincipal(mContext, - JS_GetGlobalFromScript(script), + JS_GetGlobalFromScript(aScriptObject), getter_AddRefs(principal)); NS_ENSURE_SUCCESS(rv, rv); @@ -1646,7 +1645,7 @@ nsJSContext::ExecuteScript(void *aScriptObject, // not be a GC root currently, provided we run the GC only from the // operation callback or from ScriptEvaluated. jsval val; - bool ok = JS_ExecuteScript(mContext, aScopeObject, script, &val); + bool ok = JS_ExecuteScript(mContext, aScopeObject, aScriptObject, &val); if (ok) { // If all went well, convert val to a string (XXXbe unless undefined?). rv = JSValueToAString(mContext, val, aRetValue, aIsUndefined); diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h index c37d1ec6d2f6..7066773e743b 100644 --- a/dom/base/nsJSEnvironment.h +++ b/dom/base/nsJSEnvironment.h @@ -97,7 +97,7 @@ public: PRUint32 aLineNo, PRUint32 aVersion, nsScriptObjectHolder &aScriptObject); - virtual nsresult ExecuteScript(void* aScriptObject, + virtual nsresult ExecuteScript(JSScript* aScriptObject, JSObject* aScopeObject, nsAString* aRetValue, bool* aIsUndefined);