/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
// Its possible we could delay the calculation of the "actual" context (in the case
// of sub contexts) until it is definately needed.
QDeclarativeContextData *context = resource->getContext();
+ QDeclarativeContextData *expressionContext = context;
if (!context)
return v8::Undefined();
int propertyIdx = context->propertyNames->value(propertystring);
if (propertyIdx != -1) {
- typedef QDeclarativeEnginePrivate::CapturedProperty CapturedProperty;
if (propertyIdx < context->idValueCount) {
- if (ep->captureProperties)
- ep->capturedProperties << CapturedProperty(&context->idValues[propertyIdx].bindings);
-
+ ep->captureProperty(&context->idValues[propertyIdx].bindings);
return engine->newQObject(context->idValues[propertyIdx]);
} else {
QDeclarativeContextPrivate *cp = context->asQDeclarativeContextPrivate();
- if (ep->captureProperties)
- ep->capturedProperties << CapturedProperty(context->asQDeclarativeContext(), -1,
- propertyIdx + cp->notifyIndex);
+ ep->captureProperty(context->asQDeclarativeContext(), -1,
+ propertyIdx + cp->notifyIndex);
const QVariant &value = cp->propertyValues.at(propertyIdx);
if (value.userType() == qMetaTypeId<QList<QObject*> >()) {
context = context->parent;
}
+ expressionContext->unresolvedNames = true;
+
QString error = QLatin1String("Can't find variable: ") + engine->toString(property);
v8::ThrowException(v8::Exception::ReferenceError(engine->toString(error)));
return v8::Undefined();
// Its possible we could delay the calculation of the "actual" context (in the case
// of sub contexts) until it is definately needed.
QDeclarativeContextData *context = resource->getContext();
+ QDeclarativeContextData *expressionContext = context;
if (!context)
return v8::Undefined();
context = context->parent;
}
+ expressionContext->unresolvedNames = true;
+
if (!resource->readOnly) {
return v8::Handle<v8::Value>();
} else {