Inside the property cache, override data can only handle overrides
pointing to either a method or a property, but not to a signal
handler. This is a bug in itself, but has never come up before due
to no one following override data on methods. When this
was changed by
d2e557c2c2d7fcf3bf7c1676df3902e115986dc2, this bug
was exposed.
This change doesn't actually fix the underlying problem, but it does
restore exactly the same behavior we had previously. The complete
fix will come in a later change.
Change-Id: I6a890e6ca1e40735da8158b21dfe38dc88091081
Reviewed-by: Martin Jones <martin.jones@nokia.com>
QQmlPropertyData *olddata = data;
data = This->overrideData(data);
- if (data) Insert::in(This, properties, methods, iter, data);
+ if (data && !data->isFunction()) Insert::in(This, properties, methods, iter, data);
} else {
if (data->coreIndex < This->propertyIndexCacheStart)
return;
--- /dev/null
+import QtQuick 2.0
+
+QtObject {
+ signal routeStatusChanged
+ function onRouteStatusChanged() { }
+}
void qqmldataDestroyed();
void secondAlias();
void varAlias();
+ void overrideDataAssert();
private:
static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
delete object;
}
+// Used to trigger an assert in the lazy meta object creation stage
+void tst_qqmlecmascript::overrideDataAssert()
+{
+ QQmlComponent c(&engine, testFileUrl("overrideDataAssert.qml"));
+ QObject *object = c.create();
+ QVERIFY(object != 0);
+ object->metaObject();
+ delete object;
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"