Bug 738761 - Remove nsIScriptTimeoutHandler::GetScriptVersion and pass JSVersion to nsIScriptContext::EvaluateString; r=jst

This commit is contained in:
Ms2ger 2012-03-29 23:09:13 +02:00
parent a1a7ce8473
commit 09e5acca2c
8 changed files with 9 additions and 16 deletions

View File

@ -918,7 +918,8 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
mDocument->NodePrincipal(),
aRequest->mOriginPrincipal,
url.get(), aRequest->mLineNo,
aRequest->mJSVersion, nsnull, &isUndefined);
JSVersion(aRequest->mJSVersion), nsnull,
&isUndefined);
// Put the old script back in case it wants to do anything else.
mCurrentScript = oldCurrent;

View File

@ -9319,8 +9319,7 @@ nsGlobalWindow::RunTimeout(nsTimeout *aTimeout)
bool is_undefined;
scx->EvaluateString(nsDependentString(script), FastGetGlobalJSObject(),
timeout->mPrincipal, timeout->mPrincipal,
filename, lineNo,
handler->GetScriptVersion(), nsnull,
filename, lineNo, JSVERSION_DEFAULT, nsnull,
&is_undefined);
} else {
nsCOMPtr<nsIVariant> dummy;

View File

@ -124,7 +124,7 @@ public:
nsIPrincipal *aOriginPrincipal,
const char *aURL,
PRUint32 aLineNo,
PRUint32 aVersion,
JSVersion aVersion,
nsAString *aRetValue,
bool* aIsUndefined) = 0;

View File

@ -42,9 +42,8 @@
class nsIArray;
#define NS_ISCRIPTTIMEOUTHANDLER_IID \
{ /* {17a9ce1a-d73b-45d1-8145-a0ae57bcc76e} */ \
0x17a9ce1a, 0xd73b, 0x45d1, \
{ 0x81, 0x45, 0xa0, 0xae, 0x57, 0xbc, 0xc7, 0x6e } }
{ 0xd60ec934, 0x0c75, 0x4777, \
{ 0xba, 0x41, 0xb8, 0x2f, 0x37, 0xc9, 0x13, 0x56 } }
/**
* Abstraction of the script objects etc required to do timeouts in a
@ -75,9 +74,6 @@ public:
// If a script object, get the argv suitable for passing back to the
// script context.
virtual nsIArray *GetArgv() = 0;
// Get the language version for this timeout.
virtual PRUint32 GetScriptVersion() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptTimeoutHandler,

View File

@ -1358,7 +1358,7 @@ nsJSContext::EvaluateString(const nsAString& aScript,
nsIPrincipal *aOriginPrincipal,
const char *aURL,
PRUint32 aLineNo,
PRUint32 aVersion,
JSVersion aVersion,
nsAString *aRetValue,
bool* aIsUndefined)
{

View File

@ -88,7 +88,7 @@ public:
nsIPrincipal *originPrincipal,
const char *aURL,
PRUint32 aLineNo,
PRUint32 aVersion,
JSVersion aVersion,
nsAString *aRetValue,
bool* aIsUndefined);
virtual nsresult EvaluateStringWithValue(const nsAString& aScript,

View File

@ -79,9 +79,6 @@ public:
virtual PRUint32 GetScriptTypeID() {
return nsIProgrammingLanguage::JAVASCRIPT;
}
virtual PRUint32 GetScriptVersion() {
return mVersion;
}
virtual nsIArray *GetArgv() {
return mArgv;

View File

@ -363,7 +363,7 @@ nsresult nsJSThunk::EvaluateScript(nsIChannel *aChannel,
principal,
mURL.get(), // url
1, // line no
nsnull,
JSVERSION_DEFAULT,
&result,
&isUndefined);