diff --git a/mozilla/content/xbl/src/nsXBLDocumentInfo.cpp b/mozilla/content/xbl/src/nsXBLDocumentInfo.cpp index 6e7c476856a..07f1124444a 100644 --- a/mozilla/content/xbl/src/nsXBLDocumentInfo.cpp +++ b/mozilla/content/xbl/src/nsXBLDocumentInfo.cpp @@ -83,7 +83,7 @@ public: virtual JSObject *GetGlobalJSObject(); virtual void OnFinalize(JSObject *aObject); virtual void SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts); - virtual nsresult SetNewArguments(PRUint32 aArgc, jsval* aArgv); + virtual nsresult SetNewArguments(PRUint32 aArgc, void* aArgv); // nsIScriptObjectPrincipal methods virtual nsIPrincipal* GetPrincipal(); @@ -308,7 +308,7 @@ nsXBLDocGlobalObject::SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts) } nsresult -nsXBLDocGlobalObject::SetNewArguments(PRUint32 aArgc, jsval* aArgv) +nsXBLDocGlobalObject::SetNewArguments(PRUint32 aArgc, void* aArgv) { NS_NOTREACHED("waaah!"); return NS_ERROR_UNEXPECTED; diff --git a/mozilla/content/xul/document/src/nsXULPrototypeDocument.cpp b/mozilla/content/xul/document/src/nsXULPrototypeDocument.cpp index 2fddea2f587..30b9a88ed3f 100644 --- a/mozilla/content/xul/document/src/nsXULPrototypeDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULPrototypeDocument.cpp @@ -105,7 +105,7 @@ public: virtual JSObject *GetGlobalJSObject(); virtual void OnFinalize(JSObject *aObject); virtual void SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts); - virtual nsresult SetNewArguments(PRUint32 aArgc, jsval* aArgv); + virtual nsresult SetNewArguments(PRUint32 aArgc, void* aArgv); // nsIScriptObjectPrincipal methods virtual nsIPrincipal* GetPrincipal(); @@ -934,7 +934,7 @@ nsXULPDGlobalObject::SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts) } nsresult -nsXULPDGlobalObject::SetNewArguments(PRUint32 aArgc, jsval* aArgv) +nsXULPDGlobalObject::SetNewArguments(PRUint32 aArgc, void* aArgv) { NS_NOTREACHED("waaah!"); return NS_ERROR_UNEXPECTED; diff --git a/mozilla/dom/public/nsIScriptGlobalObject.h b/mozilla/dom/public/nsIScriptGlobalObject.h index b1011cce72b..4398382871a 100644 --- a/mozilla/dom/public/nsIScriptGlobalObject.h +++ b/mozilla/dom/public/nsIScriptGlobalObject.h @@ -50,11 +50,10 @@ class nsIDocShell; class nsIDOMWindowInternal; class nsIScriptGlobalObjectOwner; struct JSObject; -typedef long jsval; #define NS_ISCRIPTGLOBALOBJECT_IID \ -{ 0xd0db67fc, 0x50f7, 0x4573, \ - { 0x87, 0x3e, 0x5b, 0x33, 0x0b, 0x13, 0x21, 0x81 } } +{ 0xd326a211, 0xdc31, 0x45c6, \ + { 0x98, 0x97, 0x22, 0x11, 0xea, 0xbc, 0xd0, 0x1c } } /** * The JavaScript specific global object. This often used to store @@ -116,8 +115,13 @@ public: * the window right away (if there's an existing document) and it * will also be installed on the window when the next document is * loaded. If argc is nonzero, argv must be non-null. + * + * @param aArgc the number of args + * @param aArgv the pointer to the args. This may be cast to jsval* and the + * args are found at + * ((jsval*)aArgv)[0], ..., ((jsval*)aArgv)[aArgc - 1] */ - virtual nsresult SetNewArguments(PRUint32 aArgc, jsval* aArgv) = 0; + virtual nsresult SetNewArguments(PRUint32 aArgc, void* aArgv) = 0; }; #endif diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 67ccf13f49d..6f4cece77a1 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1659,7 +1659,7 @@ nsGlobalWindow::SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts) } nsresult -nsGlobalWindow::SetNewArguments(PRUint32 aArgc, jsval* aArgv) +nsGlobalWindow::SetNewArguments(PRUint32 aArgc, void* aArgv) { FORWARD_TO_OUTER(SetNewArguments, (aArgc, aArgv), NS_ERROR_NOT_INITIALIZED); @@ -1677,14 +1677,16 @@ nsGlobalWindow::SetNewArguments(PRUint32 aArgc, jsval* aArgv) return NS_OK; } - NS_ASSERTION(aArgv, "Must have argv!"); + jsval* argv = NS_STATIC_CAST(jsval*, aArgv); + + NS_ASSERTION(argv, "Must have argv!"); // Freeze the outer here so that we don't create a bogus new inner // just because we're trying to resolve the Array class on cx. // Resolving it for window.arguments on the outer window should be // fine, I think. Freeze(); - JSObject *argArray = ::JS_NewArrayObject(cx, aArgc, aArgv); + JSObject *argArray = ::JS_NewArrayObject(cx, aArgc, argv); Thaw(); NS_ENSURE_TRUE(argArray, NS_ERROR_OUT_OF_MEMORY); diff --git a/mozilla/dom/src/base/nsGlobalWindow.h b/mozilla/dom/src/base/nsGlobalWindow.h index 00648b4c4a6..efc1c7726a4 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.h +++ b/mozilla/dom/src/base/nsGlobalWindow.h @@ -169,7 +169,7 @@ public: virtual JSObject *GetGlobalJSObject(); virtual void OnFinalize(JSObject *aJSObject); virtual void SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts); - virtual nsresult SetNewArguments(PRUint32 aArgc, jsval* aArgv); + virtual nsresult SetNewArguments(PRUint32 aArgc, void* aArgv); // nsIScriptObjectPrincipal virtual nsIPrincipal* GetPrincipal(); diff --git a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index dd955285d3e..051ff99d032 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -1748,7 +1748,7 @@ nsWindowWatcher::AttachArguments(nsIDOMWindow *aWindow, NS_ENSURE_TRUE(scriptGlobal, NS_ERROR_UNEXPECTED); // Just ask the global to attach the args for us - return scriptGlobal->SetNewArguments(argc, argv); + return scriptGlobal->SetNewArguments(argc, NS_STATIC_CAST(void*, argv)); } nsresult