Bug 824864 - Rename EvaluateStringWithValue to EvaluateString. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Wed, 16 Jan 2013 18:50:26 -0800
changeset 128984 43458e543877f651e213bd9fb1c6cefe67279ccc
parent 128983 badfbc904df619eb05a11de038eed1c9975ee554
child 128985 b40a217c85e3026e300fd5eb403565a95c6df74e
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs824864
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 824864 - Rename EvaluateStringWithValue to EvaluateString. r=bz Now that there's only one of them, we can get rid of the silly suffix. \o/
content/base/src/nsScriptLoader.cpp
content/xbl/src/nsXBLProtoImplField.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsIScriptContext.h
dom/base/nsJSEnvironment.cpp
dom/base/nsJSEnvironment.h
dom/plugins/base/nsNPAPIPlugin.cpp
dom/src/jsurl/nsJSProtocolHandler.cpp
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -857,18 +857,18 @@ nsScriptLoader::EvaluateScript(nsScriptL
   nsContentUtils::GetWrapperSafeScriptFilename(mDocument, aRequest->mURI, url);
 
   JS::CompileOptions options(context->GetNativeContext());
   options.setFileAndLine(url.get(), aRequest->mLineNo)
          .setVersion(JSVersion(aRequest->mJSVersion));
   if (aRequest->mOriginPrincipal)
     options.setOriginPrincipals(nsJSPrincipals::get(aRequest->mOriginPrincipal));
   JS::Value ignored;
-  rv = context->EvaluateStringWithValue(aScript, *globalObject->GetGlobalJSObject(),
-                                        options, /* aCoerceToString = */ false, ignored);
+  rv = context->EvaluateString(aScript, *globalObject->GetGlobalJSObject(),
+                               options, /* aCoerceToString = */ false, ignored);
 
   // Put the old script back in case it wants to do anything else.
   mCurrentScript = oldCurrent;
 
   JSContext *cx = nullptr; // Initialize this to keep GCC happy.
   cx = context->GetNativeContext();
   JSAutoRequest ar(cx);
   context->SetProcessingScriptTag(oldProcessingScriptTag);
--- a/content/xbl/src/nsXBLProtoImplField.cpp
+++ b/content/xbl/src/nsXBLProtoImplField.cpp
@@ -85,17 +85,17 @@ nsXBLProtoImplField::InstallField(nsIScr
 
   // Empty fields are treated as not actually present.
   if (IsEmpty()) {
     return NS_OK;
   }
 
   nsAutoMicroTask mt;
 
-  // EvaluateStringWithValue and JS_DefineUCProperty can both trigger GC, so
+  // EvaluateString and JS_DefineUCProperty can both trigger GC, so
   // protect |result| here.
   nsresult rv;
 
   nsAutoCString uriSpec;
   aBindingDocURI->GetSpec(uriSpec);
   
   JSContext* cx = aContext->GetNativeContext();
   NS_ASSERTION(!::JS_IsExceptionPending(cx),
@@ -106,21 +106,21 @@ nsXBLProtoImplField::InstallField(nsIScr
 
   JSAutoRequest ar(cx);
   jsval result = JSVAL_NULL;
 
   JS::CompileOptions options(cx);
   options.setFileAndLine(uriSpec.get(), mLineNumber)
          .setVersion(JSVERSION_LATEST)
          .setUserBit(true); // Flag us as XBL
-  rv = context->EvaluateStringWithValue(nsDependentString(mFieldText,
-                                                          mFieldTextLength),
-                                        *aBoundNode, options,
-                                        /* aCoerceToString = */ false,
-                                        result);
+  rv = context->EvaluateString(nsDependentString(mFieldText,
+                                                 mFieldTextLength),
+                               *aBoundNode, options,
+                               /* aCoerceToString = */ false,
+                               result);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
 
   // Define the evaluated result as a JS property
   nsDependentString name(mName);
   if (!::JS_DefineUCProperty(cx, aBoundNode,
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9747,18 +9747,18 @@ nsGlobalWindow::RunTimeoutHandler(nsTime
     const char* filename = nullptr;
     uint32_t lineNo = 0;
     handler->GetLocation(&filename, &lineNo);
 
     JS::CompileOptions options(aScx->GetNativeContext());
     options.setFileAndLine(filename, lineNo)
            .setVersion(JSVERSION_DEFAULT);
     JS::Value ignored;
-    aScx->EvaluateStringWithValue(nsDependentString(script), *FastGetGlobalJSObject(),
-                                  options, /*aCoerceToString = */ false, ignored);
+    aScx->EvaluateString(nsDependentString(script), *FastGetGlobalJSObject(),
+                         options, /*aCoerceToString = */ false, ignored);
   } else {
     nsCOMPtr<nsIVariant> dummy;
     nsCOMPtr<nsISupports> me(static_cast<nsIDOMWindow *>(this));
     aScx->CallEventHandler(me, FastGetGlobalJSObject(),
                            scriptObject, handler->GetArgv(),
                            // XXXmarkh - consider allowing CallEventHandler to
                            // accept nullptr?
                            getter_AddRefs(dummy));
--- a/dom/base/nsIScriptContext.h
+++ b/dom/base/nsIScriptContext.h
@@ -68,21 +68,21 @@ public:
    * @param aScopeObject a script object for the scope to execute in.
    * @param aOptions an options object. You probably want to at least set
    *                 filename and line number. The principal is computed
    *                 internally, though 'originPrincipals' may be passed.
    * @param aCoerceToString if the return value is not JSVAL_VOID, convert it
    *                        to a string before returning.
    * @param aRetValue the result of executing the script.
    **/
-  virtual nsresult EvaluateStringWithValue(const nsAString& aScript,
-                                           JSObject& aScopeObject,
-                                           JS::CompileOptions& aOptions,
-                                           bool aCoerceToString,
-                                           JS::Value& aRetValue) = 0;
+  virtual nsresult EvaluateString(const nsAString& aScript,
+                                  JSObject& aScopeObject,
+                                  JS::CompileOptions& aOptions,
+                                  bool aCoerceToString,
+                                  JS::Value& aRetValue) = 0;
 
   /**
    * Compile a script.
    *
    * @param aText a PRUnichar buffer containing script source
    * @param aTextLength number of characters in aText
    * @param aPrincipal the principal that produced the script
    * @param aURL the URL or filename for error messages
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1224,23 +1224,23 @@ nsJSContext::GetCCRefcnt()
   if (mContext && js::ContextHasOutstandingRequests(mContext)) {
     refcnt++;
   }
 
   return refcnt;
 }
 
 nsresult
-nsJSContext::EvaluateStringWithValue(const nsAString& aScript,
-                                     JSObject& aScopeObject,
-                                     JS::CompileOptions& aOptions,
-                                     bool aCoerceToString,
-                                     JS::Value& aRetValue)
+nsJSContext::EvaluateString(const nsAString& aScript,
+                            JSObject& aScopeObject,
+                            JS::CompileOptions& aOptions,
+                            bool aCoerceToString,
+                            JS::Value& aRetValue)
 {
-  SAMPLE_LABEL("JS", "EvaluateStringWithValue");
+  SAMPLE_LABEL("JS", "EvaluateString");
 
   NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
   aRetValue = JSVAL_VOID;
 
   if (!mScriptsEnabled) {
     return NS_OK;
   }
 
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -39,21 +39,21 @@ public:
   virtual ~nsJSContext();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsJSContext,
                                                          nsIScriptContext)
 
   virtual nsIScriptObjectPrincipal* GetObjectPrincipal();
 
-  virtual nsresult EvaluateStringWithValue(const nsAString& aScript,
-                                           JSObject& aScopeObject,
-                                           JS::CompileOptions &aOptions,
-                                           bool aCoerceToString,
-                                           JS::Value& aRetValue);
+  virtual nsresult EvaluateString(const nsAString& aScript,
+                                  JSObject& aScopeObject,
+                                  JS::CompileOptions &aOptions,
+                                  bool aCoerceToString,
+                                  JS::Value& aRetValue);
 
   virtual nsresult CompileScript(const PRUnichar* aText,
                                  int32_t aTextLength,
                                  nsIPrincipal *principal,
                                  const char *aURL,
                                  uint32_t aLineNo,
                                  uint32_t aVersion,
                                  nsScriptObjectHolder<JSScript>& aScriptObject,
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -1590,19 +1590,19 @@ bool NP_CALLBACK
 
   NPN_PLUGIN_LOG(PLUGIN_LOG_NOISY,
                  ("NPN_Evaluate(npp %p, npobj %p, script <<<%s>>>) called\n",
                   npp, npobj, script->UTF8Characters));
 
   JS::CompileOptions options(cx);
   options.setFileAndLine(spec, 0)
          .setVersion(JSVERSION_DEFAULT);
-  nsresult rv = scx->EvaluateStringWithValue(utf16script, *obj, options,
-                                             /* aCoerceToString = */ false,
-                                             *rval);
+  nsresult rv = scx->EvaluateString(utf16script, *obj, options,
+                                    /* aCoerceToString = */ false,
+                                    *rval);
 
   return NS_SUCCEEDED(rv) &&
          (!result || JSValToNPVariant(npp, cx, *rval, result));
 }
 
 bool NP_CALLBACK
 _getproperty(NPP npp, NPObject* npobj, NPIdentifier property,
              NPVariant *result)
--- a/dom/src/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/src/jsurl/nsJSProtocolHandler.cpp
@@ -321,21 +321,19 @@ nsresult nsJSThunk::EvaluateScript(nsICh
 
         stack->Pop(nullptr);
     } else {
         // No need to use the sandbox, evaluate the script directly in
         // the given scope.
         JS::CompileOptions options(cx);
         options.setFileAndLine(mURL.get(), 1)
                .setVersion(JSVERSION_DEFAULT);
-        rv = scriptContext->EvaluateStringWithValue(NS_ConvertUTF8toUTF16(script),
-                                                    *globalJSObject,
-                                                    options,
-                                                    /* aCoerceToString = */ true,
-                                                    v);
+        rv = scriptContext->EvaluateString(NS_ConvertUTF8toUTF16(script),
+                                           *globalJSObject, options,
+                                           /* aCoerceToString = */ true, v);
 
         // If there's an error on cx as a result of that call, report
         // it now -- either we're just running under the event loop,
         // so we shouldn't propagate JS exceptions out of here, or we
         // can't be sure that our caller is JS (and if it's not we'll
         // lose the error), or it might be JS that then proceeds to
         // cause an error of its own (which will also make us lose
         // this error).