Bug 1043690 - Remove extraneous const usage. r=jorendorff, a=bustage
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 07 Aug 2014 16:24:45 -0400
changeset 208260 c755d28a5266
parent 208259 7b29fabbf26a
child 208261 e8fbf14de311
push id3793
push userryanvm@gmail.com
push date2014-08-07 20:25 +0000
treeherdermozilla-beta@c755d28a5266 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff, bustage
bugs1043690
milestone32.0
Bug 1043690 - Remove extraneous const usage. r=jorendorff, a=bustage CLOSED TREE
js/src/jsapi-tests/testSetPropertyIgnoringNamedGetter.cpp
js/src/jsfriendapi.h
js/src/jsproxy.cpp
--- a/js/src/jsapi-tests/testSetPropertyIgnoringNamedGetter.cpp
+++ b/js/src/jsapi-tests/testSetPropertyIgnoringNamedGetter.cpp
@@ -10,40 +10,40 @@
 using namespace js;
 using namespace JS;
 
 class CustomProxyHandler : public DirectProxyHandler {
   public:
     CustomProxyHandler() : DirectProxyHandler(nullptr) {}
 
     bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
-                               MutableHandle<JSPropertyDescriptor> desc) const MOZ_OVERRIDE
+                               MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE
     {
         return impl(cx, proxy, id, desc, false);
     }
 
     bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
-                                  MutableHandle<JSPropertyDescriptor> desc) const MOZ_OVERRIDE
+                                  MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE
     {
         return impl(cx, proxy, id, desc, true);
     }
 
     bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,
-             HandleId id, bool strict, MutableHandleValue vp) const MOZ_OVERRIDE
+             HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE
     {
         Rooted<JSPropertyDescriptor> desc(cx);
         if (!DirectProxyHandler::getPropertyDescriptor(cx, proxy, id, &desc))
             return false;
         return SetPropertyIgnoringNamedGetter(cx, this, proxy, receiver, id, &desc,
                                               desc.object() == proxy, strict, vp);
     }
 
   private:
     bool impl(JSContext *cx, HandleObject proxy, HandleId id,
-              MutableHandle<JSPropertyDescriptor> desc, bool ownOnly) const
+              MutableHandle<JSPropertyDescriptor> desc, bool ownOnly)
     {
         if (JSID_IS_STRING(id)) {
             bool match;
             if (!JS_StringEqualsAscii(cx, JSID_TO_STRING(id), "phantom", &match))
                 return false;
             if (match) {
                 desc.object().set(proxy);
                 desc.attributesRef() = JSPROP_READONLY | JSPROP_ENUMERATE;
@@ -54,17 +54,17 @@ class CustomProxyHandler : public Direct
 
         if (ownOnly)
             return DirectProxyHandler::getOwnPropertyDescriptor(cx, proxy, id, desc);
         return DirectProxyHandler::getPropertyDescriptor(cx, proxy, id, desc);
     }
 
 };
 
-const CustomProxyHandler customProxyHandler;
+CustomProxyHandler customProxyHandler;
 
 
 BEGIN_TEST(testSetPropertyIgnoringNamedGetter_direct)
 {
     RootedValue protov(cx);
     EVAL("Object.prototype", &protov);
 
     RootedValue targetv(cx);
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -2205,17 +2205,17 @@ CheckDefineProperty(JSContext *cx, JS::H
  * set() in this way.  It carries out all the steps of BaseProxyHandler::set()
  * except the initial getOwnPropertyDescriptor()/getPropertyDescriptor() calls.
  * The caller must supply those results as the 'desc' and 'descIsOwn'
  * parameters.
  *
  * Implemented in jsproxy.cpp.
  */
 JS_FRIEND_API(bool)
-SetPropertyIgnoringNamedGetter(JSContext *cx, const BaseProxyHandler *handler,
+SetPropertyIgnoringNamedGetter(JSContext *cx, BaseProxyHandler *handler,
                                JS::HandleObject proxy, JS::HandleObject receiver,
                                JS::HandleId id, JS::MutableHandle<JSPropertyDescriptor> desc,
                                bool descIsOwn, bool strict, JS::MutableHandleValue vp);
 
 } /* namespace js */
 
 extern JS_FRIEND_API(bool)
 js_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,
--- a/js/src/jsproxy.cpp
+++ b/js/src/jsproxy.cpp
@@ -170,17 +170,17 @@ BaseProxyHandler::set(JSContext *cx, Han
             return false;
     }
 
     return SetPropertyIgnoringNamedGetter(cx, this, proxy, receiver, id, &desc, descIsOwn, strict,
                                           vp);
 }
 
 bool
-js::SetPropertyIgnoringNamedGetter(JSContext *cx, const BaseProxyHandler *handler,
+js::SetPropertyIgnoringNamedGetter(JSContext *cx, BaseProxyHandler *handler,
                                    HandleObject proxy, HandleObject receiver,
                                    HandleId id, MutableHandle<PropertyDescriptor> desc,
                                    bool descIsOwn, bool strict, MutableHandleValue vp)
 {
     /* The control-flow here differs from ::get() because of the fall-through case below. */
     if (descIsOwn) {
         JS_ASSERT(desc.object());