Fix qmljs_call_property
authorLars Knoll <lars.knoll@digia.com>
Sat, 1 Dec 2012 18:57:26 +0000 (19:57 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Sun, 2 Dec 2012 14:54:40 +0000 (15:54 +0100)
Change-Id: Ic32fc8815704ed201a3b50eae05ff2705372210d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qmljs_runtime.cpp
qmljs_runtime.h

index 774676a..dcfb62d 100644 (file)
@@ -719,23 +719,15 @@ Value __qmljs_call_activation_property(ExecutionContext *context, String *name,
     }
 }
 
-Value __qmljs_call_property(ExecutionContext *context, Value base, String *name, Value *args, int argc)
+Value __qmljs_call_property(ExecutionContext *context, Value thisObject, String *name, Value *args, int argc)
 {
-    Object *baseObject;
-    Value thisObject;
+    if (!thisObject.isObject())
+        thisObject = __qmljs_to_object(thisObject, context);
 
-    if (base.isUndefined()) {
-        baseObject = context->activation;
-        thisObject = Value::nullValue();
-    } else {
-        if (!base.isObject())
-            base = __qmljs_to_object(base, context);
-        assert(base.isObject());
-        baseObject = base.objectValue();
-        thisObject = base;
-    }
+    assert(thisObject.isObject());
+    Object *baseObject = base.objectValue();
 
-    Value func = baseObject ? baseObject->__get__(context, name) : Value::undefinedValue();
+    Value func = baseObject->__get__(context, name);
     return callFunction(context, thisObject, func.asFunctionObject(), args, argc);
 }
 
index 2df8dd1..d6a7839 100644 (file)
@@ -92,7 +92,7 @@ extern "C" {
 
 // context
 Value __qmljs_call_activation_property(ExecutionContext *, String *name, Value *args, int argc);
-Value __qmljs_call_property(ExecutionContext *context, Value base, String *name, Value *args, int argc);
+Value __qmljs_call_property(ExecutionContext *context, Value thisObject, String *name, Value *args, int argc);
 Value __qmljs_call_value(ExecutionContext *context, Value thisObject, Value func, Value *args, int argc);
 
 Value __qmljs_construct_activation_property(ExecutionContext *, String *name, Value *args, int argc);