Smaller cleanup in the lookup code
authorLars Knoll <lars.knoll@digia.com>
Fri, 12 Apr 2013 13:29:05 +0000 (15:29 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Fri, 12 Apr 2013 13:52:50 +0000 (15:52 +0200)
Change-Id: I74835d7c088b803205aa417ec2b7a2808f66f6ca
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/v4/qv4functionobject.h
src/v4/qv4runtime.cpp

index e186057..4ef9db1 100644 (file)
@@ -148,9 +148,9 @@ struct Lookup {
         return 0;
     }
 
-    Property *setterLookup(Object *o, bool *writable) {
+    Property *setterLookup(Object *o, PropertyAttributes *attrs) {
         if (o->internalClass == classList[0]) {
-            *writable = o->internalClass->propertyData[index].isWritable();
+            *attrs = o->internalClass->propertyData[index];
             return o->memberData + index;
         }
 
@@ -158,7 +158,7 @@ struct Lookup {
         if (idx != UINT_MAX) {
             classList[0] = o->internalClass;
             index = idx;
-            *writable = o->internalClass->propertyData[index].isWritable();
+            *attrs = o->internalClass->propertyData[index];
             return o->memberData + index;
         }
         return 0;
index 727aa6e..6f1e1c9 100644 (file)
@@ -748,10 +748,10 @@ void __qmljs_set_property_lookup(ExecutionContext *ctx, const Value &object, int
     Object *o = object.toObject(ctx);
     Lookup *l = ctx->lookups + lookupIndex;
 
-    bool writable;
-    Property *p = l->setterLookup(o, &writable);
+    PropertyAttributes attrs;
+    Property *p = l->setterLookup(o, &attrs);
     if (p && (l->index != ArrayObject::LengthPropertyIndex || !o->isArrayObject())) {
-        o->putValue(ctx, p, o->internalClass->propertyData[l->index], value);
+        o->putValue(ctx, p, attrs, value);
         return;
     }