Fix a bug in V4V8Object::put()
authorLars Knoll <lars.knoll@digia.com>
Sun, 19 May 2013 21:15:13 +0000 (23:15 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Tue, 21 May 2013 07:56:00 +0000 (09:56 +0200)
When a fallback handler returns an empty value it is not
intercepting the call, and thus the put() method of the base
obejct should get called.

Fixes most issues with worker threads.

Change-Id: I88f0fcb6349cc818163248d456e3fb916188f48f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/v4/qv4v8.cpp

index d8843d6..ea02065 100644 (file)
@@ -1550,12 +1550,17 @@ protected:
         }
         PropertyAttributes attrs;
         Property *pd  = that->__getOwnProperty__(name, &attrs);
-        if (pd)
+        if (pd) {
             that->putValue(ctx, pd, attrs, value);
-        else if (that->m_template->m_fallbackPropertySetter)
-            that->m_template->m_fallbackPropertySetter(String::New(name), v8Value, that->fallbackAccessorInfo());
-        else
-            BaseClass::put(m, ctx, name, value);
+            return;
+        }
+        if (that->m_template->m_fallbackPropertySetter) {
+            Handle<Value> v = that->m_template->m_fallbackPropertySetter(String::New(name), v8Value, that->fallbackAccessorInfo());
+            if (!v.IsEmpty())
+                return;
+        }
+
+        BaseClass::put(m, ctx, name, value);
     }
 
     static void putIndexed(QV4::Managed *m, ExecutionContext *ctx, uint index, const QV4::Value &value)