Remove the ExecutionContext parameter from Managed::get/setLookup
authorLars Knoll <lars.knoll@digia.com>
Fri, 21 Jun 2013 19:48:06 +0000 (21:48 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Sat, 22 Jun 2013 19:03:16 +0000 (21:03 +0200)
Change-Id: I9d3763b97438db83fef899917cbaee2f7cd59f96
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/v4/qv4lookup.cpp
src/qml/qml/v4/qv4managed.cpp
src/qml/qml/v4/qv4managed_p.h
src/qml/qml/v4/qv4object.cpp
src/qml/qml/v4/qv4object_p.h

index d5e8cc8..61e2b8b 100644 (file)
@@ -89,7 +89,7 @@ Property *Lookup::lookup(Object *obj, PropertyAttributes *attrs)
 void Lookup::getterGeneric(QV4::Lookup *l, ExecutionContext *ctx, QV4::Value *result, const QV4::Value &object)
 {
     if (Object *o = object.asObject()) {
-        o->getLookup(ctx, l, result);
+        o->getLookup(l, result);
         return;
     }
 
@@ -341,7 +341,7 @@ void Lookup::globalGetterAccessor2(Lookup *l, ExecutionContext *ctx, Value *resu
 void Lookup::setterGeneric(Lookup *l, ExecutionContext *ctx, const Value &object, const Value &value)
 {
     Object *o = object.toObject(ctx);
-    o->setLookup(ctx, l, value);
+    o->setLookup(l, value);
     return;
 }
 
index f582c25..941c465 100644 (file)
@@ -186,14 +186,14 @@ Value Managed::call(Managed *, ExecutionContext *context, const Value &, Value *
     context->throwTypeError();
 }
 
-void Managed::getLookup(Managed *, ExecutionContext *context, Lookup *, Value *)
+void Managed::getLookup(Managed *m, Lookup *, Value *)
 {
-    context->throwTypeError();
+    m->engine()->current->throwTypeError();
 }
 
-void Managed::setLookup(Managed *, ExecutionContext *ctx, Lookup *, const Value &)
+void Managed::setLookup(Managed *m, Lookup *, const Value &)
 {
-    ctx->throwTypeError();
+    m->engine()->current->throwTypeError();
 }
 
 bool Managed::isEqualTo(Managed *, Managed *)
index 530f469..a8e94e1 100644 (file)
@@ -113,8 +113,8 @@ struct ManagedVTable
     PropertyAttributes (*queryIndexed)(const Managed *, uint index);
     bool (*deleteProperty)(Managed *m, String *name);
     bool (*deleteIndexedProperty)(Managed *m, uint index);
-    void (*getLookup)(Managed *m, ExecutionContext *ctx, Lookup *l, Value *result);
-    void (*setLookup)(Managed *m, ExecutionContext *ctx, Lookup *l, const Value &v);
+    void (*getLookup)(Managed *m, Lookup *l, Value *result);
+    void (*setLookup)(Managed *m, Lookup *l, const Value &v);
     bool (*isEqualTo)(Managed *m, Managed *other);
     Property *(*advanceIterator)(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
     const char *className;
@@ -277,10 +277,10 @@ public:
     { return vtbl->deleteProperty(this, name); }
     bool deleteIndexedProperty(uint index)
     { return vtbl->deleteIndexedProperty(this, index); }
-    void getLookup(ExecutionContext *ctx, Lookup *l, Value *result)
-    { vtbl->getLookup(this, ctx, l, result); }
-    void setLookup(ExecutionContext *ctx, Lookup *l, const Value &v)
-    { vtbl->setLookup(this, ctx, l, v); }
+    void getLookup(Lookup *l, Value *result)
+    { vtbl->getLookup(this, l, result); }
+    void setLookup(Lookup *l, const Value &v)
+    { vtbl->setLookup(this, l, v); }
 
     bool isEqualTo(Managed *other)
     { return vtbl->isEqualTo(this, other); }
@@ -291,8 +291,8 @@ public:
     static bool hasInstance(Managed *that, const Value &value);
     static Value construct(Managed *, ExecutionContext *context, Value *, int);
     static Value call(Managed *, ExecutionContext *, const Value &, Value *, int);
-    static void getLookup(Managed *, ExecutionContext *context, Lookup *, Value *);
-    static void setLookup(Managed *, ExecutionContext *ctx, Lookup *l, const Value &v);
+    static void getLookup(Managed *m, Lookup *, Value *);
+    static void setLookup(Managed *m, Lookup *l, const Value &v);
     static bool isEqualTo(Managed *m, Managed *other);
 
     uint internalType() const {
index e9c5505..f41365e 100644 (file)
@@ -461,7 +461,7 @@ bool Object::deleteIndexedProperty(Managed *m, uint index)
     return static_cast<Object *>(m)->internalDeleteIndexedProperty(index);
 }
 
-void Object::getLookup(Managed *m, ExecutionContext *ctx, Lookup *l, Value *result)
+void Object::getLookup(Managed *m, Lookup *l, Value *result)
 {
     Object *o = static_cast<Object *>(m);
     PropertyAttributes attrs;
@@ -486,7 +486,7 @@ void Object::getLookup(Managed *m, ExecutionContext *ctx, Lookup *l, Value *resu
                 l->getter = Lookup::getterAccessor2;
             if (result)
                 *result = p->value;
-            Value res = o->getValue(ctx, p, attrs);
+            Value res = o->getValue(o->engine()->current, p, attrs);
             if (result)
                 *result = res;
             return;
@@ -496,7 +496,7 @@ void Object::getLookup(Managed *m, ExecutionContext *ctx, Lookup *l, Value *resu
     }
 }
 
-void Object::setLookup(Managed *m, ExecutionContext *ctx, Lookup *l, const Value &value)
+void Object::setLookup(Managed *m, Lookup *l, const Value &value)
 {
     Object *o = static_cast<Object *>(m);
 
@@ -511,12 +511,12 @@ void Object::setLookup(Managed *m, ExecutionContext *ctx, Lookup *l, const Value
         }
 
         if (idx != UINT_MAX) {
-            o->putValue(ctx, o->memberData + idx, o->internalClass->propertyData[idx], value);
+            o->putValue(o->engine()->current, o->memberData + idx, o->internalClass->propertyData[idx], value);
             return;
         }
     }
 
-    o->put(ctx, l->name, value);
+    o->put(o->engine()->current, l->name, value);
 }
 
 Property *Object::advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attrs)
index 4a36a3c..557e4fd 100644 (file)
@@ -358,8 +358,8 @@ protected:
     static PropertyAttributes queryIndexed(const Managed *m, uint index);
     static bool deleteProperty(Managed *m, String *name);
     static bool deleteIndexedProperty(Managed *m, uint index);
-    static void getLookup(Managed *m, ExecutionContext *ctx, Lookup *l, Value *result);
-    static void setLookup(Managed *m, ExecutionContext *ctx, Lookup *l, const Value &v);
+    static void getLookup(Managed *m, Lookup *l, Value *result);
+    static void setLookup(Managed *m, Lookup *l, const Value &v);
     static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);