Add and use a method for querying whether a property is revisioned.
Accessor data and the revision are now unioned, so querying the value directly can give incorrect results. Change-Id: I0ba6c53d8bd6b012507bfb32d33dc414348379b0 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
This commit is contained in:
parent
ba3ac328ca
commit
ab727e6702
|
@ -149,6 +149,7 @@ public:
|
|||
bool hasOverride() const { return !(flags & IsValueTypeVirtual) &&
|
||||
!(flags & HasAccessors) &&
|
||||
overrideIndex >= 0; }
|
||||
bool hasRevision() const { return !(flags & HasAccessors) && revision != 0; }
|
||||
|
||||
// Returns -1 if not a value type virtual property
|
||||
inline int getValueTypeCoreIndex() const;
|
||||
|
|
|
@ -437,7 +437,7 @@ bool QV4IRBuilder::visit(AST::IdentifierExpression *ast)
|
|||
|
||||
QDeclarativePropertyData *data = cache->property(name);
|
||||
|
||||
if (data && data->revision != 0) {
|
||||
if (data && data->hasRevision()) {
|
||||
if (qmlVerboseCompiler())
|
||||
qWarning() << "*** versioned symbol:" << name;
|
||||
discard();
|
||||
|
@ -458,7 +458,7 @@ bool QV4IRBuilder::visit(AST::IdentifierExpression *ast)
|
|||
|
||||
QDeclarativePropertyData *data = cache->property(name);
|
||||
|
||||
if (data && data->revision != 0) {
|
||||
if (data && data->hasRevision()) {
|
||||
if (qmlVerboseCompiler())
|
||||
qWarning() << "*** versioned symbol:" << name;
|
||||
discard();
|
||||
|
@ -609,7 +609,7 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast)
|
|||
if (!data || data->isFunction())
|
||||
return false; // Don't support methods (or non-existing properties ;)
|
||||
|
||||
if (data->revision != 0) {
|
||||
if (data->hasRevision()) {
|
||||
if (qmlVerboseCompiler())
|
||||
qWarning() << "*** versioned symbol:" << name;
|
||||
discard();
|
||||
|
|
|
@ -513,7 +513,7 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject
|
|||
if (!result)
|
||||
return v8::Handle<v8::Value>();
|
||||
|
||||
if (revisionMode == QV8QObjectWrapper::CheckRevision && result->revision != 0) {
|
||||
if (revisionMode == QV8QObjectWrapper::CheckRevision && result->hasRevision()) {
|
||||
QDeclarativeData *ddata = QDeclarativeData::get(object);
|
||||
if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(result))
|
||||
return v8::Handle<v8::Value>();
|
||||
|
@ -673,7 +673,7 @@ bool QV8QObjectWrapper::SetProperty(QV8Engine *engine, QObject *object, const QH
|
|||
if (!result)
|
||||
return false;
|
||||
|
||||
if (revisionMode == QV8QObjectWrapper::CheckRevision && result->revision != 0) {
|
||||
if (revisionMode == QV8QObjectWrapper::CheckRevision && result->hasRevision()) {
|
||||
QDeclarativeData *ddata = QDeclarativeData::get(object);
|
||||
if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(result))
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue