diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-23 12:29:56 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-23 12:29:56 (GMT) |
commit | b0bc605e2ede4466aabf5b5da040e5801dbf9156 (patch) | |
tree | 4db2a40ca239bbde9df52580064a9a6c2db921e6 /src/declarative/qml/qmlcompiler.cpp | |
parent | 3baf0c6d7d8098c6226c0ffade2b6740b0bc96cc (diff) | |
download | Qt-b0bc605e2ede4466aabf5b5da040e5801dbf9156.zip Qt-b0bc605e2ede4466aabf5b5da040e5801dbf9156.tar.gz Qt-b0bc605e2ede4466aabf5b5da040e5801dbf9156.tar.bz2 |
Make more qmlecmascript tests pass
Test cases constantsOverrideBindings, outerBindingOverridesInnerBinding and
aliasPropertyAndBinding now pass.
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 053c6f8..c192c50 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -791,6 +791,15 @@ void QmlCompiler::genObject(QmlParser::Object *obj) if (!obj->custom.isEmpty()) create.create.data = output->indexForByteArray(obj->custom); create.create.type = obj->type; + if (!output->types.at(create.create.type).type && + !obj->bindingBitmask.isEmpty()) { + while (obj->bindingBitmask.size() % 4) + obj->bindingBitmask.append(char(0)); + create.create.bindingBits = + output->indexForByteArray(obj->bindingBitmask); + } else { + create.create.bindingBits = -1; + } output->bytecode << create; // Setup the synthesized meta object if necessary @@ -1236,6 +1245,9 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop, } } + if (prop->index != -1) + prop->parent->setBindingBit(prop->index); + if (!prop->isDefault && prop->name == "id" && !ctxt.isSubContext()) { // The magic "id" behavior doesn't apply when "id" is resolved as a @@ -2032,7 +2044,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) builder.addSignal(p.name + "Changed()"); QMetaPropertyBuilder propBuilder = - builder.addProperty(p.name, type, ii); + builder.addProperty(p.name, type, builder.methodCount() - 1); propBuilder.setScriptable(true); propBuilder.setWritable(!readonly); } @@ -2157,7 +2169,10 @@ bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder, data.append((const char *)&propIdx, sizeof(propIdx)); builder.addSignal(prop.name + "Changed()"); - builder.addProperty(prop.name, aliasProperty.typeName(), builder.methodCount() - 1); + QMetaPropertyBuilder propBuilder = + builder.addProperty(prop.name, aliasProperty.typeName(), + builder.methodCount() - 1); + propBuilder.setScriptable(true); return true; } |