Fix some stuff brendan pointed out.
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 08 Mar 2011 18:08:59 -0800
changeset 64255 5c33462bf06c5bd36211cbf0f7ca19a43ecc6b1f
parent 64254 3035bb78201359418f1bdc6b4ed3f15c4f9e282f
child 64256 80d8431f209ee23b4383e1d81aaf59ddc35b9117
push idunknown
push userunknown
push dateunknown
milestone2.0b13pre
Fix some stuff brendan pointed out.
js/src/jscntxt.cpp
js/src/jsproxy.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -140,17 +140,16 @@ StackSegment::contains(const JSStackFram
 
 JSStackFrame *
 StackSegment::computeNextFrame(JSStackFrame *fp) const
 {
     JS_ASSERT(contains(fp));
     JS_ASSERT(fp != getCurrentFrame());
 
     JSStackFrame *next = getCurrentFrame();
-    JSStackFrame *end = getInitialFrame()->prev();
     JSStackFrame *prev;
     while ((prev = next->prev()) != fp)
         next = prev;
     return next;
 }
 
 bool
 StackSpace::init()
--- a/js/src/jsproxy.cpp
+++ b/js/src/jsproxy.cpp
@@ -146,48 +146,48 @@ JSProxyHandler::set(JSContext *cx, JSObj
     JS_ASSERT(OperationInProgress(cx, proxy));
     AutoPropertyDescriptorRooter desc(cx);
     if (!getOwnPropertyDescriptor(cx, proxy, id, true, &desc))
         return false;
     /* The control-flow here differs from ::get() because of the fall-through case below. */
     if (desc.obj) {
         if (desc.attrs & JSPROP_READONLY)
             return true;
-        if (desc.setter && ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub)) {
+        if (!desc.setter) {
+            desc.setter = StrictPropertyStub;
+        } else if ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub) {
             if (!CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, strict, vp))
                 return false;
             if (!proxy->isProxy() || proxy->getProxyHandler() != this)
                 return true;
             if (desc.attrs & JSPROP_SHARED)
                 return true;
         }
         if (!desc.getter)
             desc.getter = PropertyStub;
-        if (!desc.setter)
-            desc.setter = StrictPropertyStub;
         desc.value = *vp;
         return defineProperty(cx, receiver, id, &desc);
     }
     if (!getPropertyDescriptor(cx, proxy, id, true, &desc))
         return false;
     if (desc.obj) {
         if (desc.attrs & JSPROP_READONLY)
             return true;
-        if (desc.setter && ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub)) {
+        if (!desc.setter) {
+            desc.setter = StrictPropertyStub;
+        } else if ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub) {
             if (!CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, strict, vp))
                 return false;
             if (!proxy->isProxy() || proxy->getProxyHandler() != this)
                 return true;
             if (desc.attrs & JSPROP_SHARED)
                 return true;
         }
         if (!desc.getter)
             desc.getter = PropertyStub;
-        if (!desc.setter)
-            desc.setter = StrictPropertyStub;
         return defineProperty(cx, receiver, id, &desc);
     }
 
     desc.obj = receiver;
     desc.value = *vp;
     desc.attrs = JSPROP_ENUMERATE;
     desc.shortid = 0;
     desc.getter = NULL;