Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / v8 / qv8contextwrapper.cpp
index 29857b2..8b7fbe8 100644 (file)
@@ -1,8 +1,7 @@
 /****************************************************************************
 **
-** 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.
 **
@@ -35,6 +34,7 @@
 **
 **
 **
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
@@ -258,6 +258,7 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property,
     // 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();
@@ -317,21 +318,17 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property,
             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*> >()) {
@@ -366,6 +363,8 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property,
         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();
@@ -398,6 +397,7 @@ v8::Handle<v8::Value> QV8ContextWrapper::Setter(v8::Local<v8::String> property,
     // 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();
@@ -440,6 +440,8 @@ v8::Handle<v8::Value> QV8ContextWrapper::Setter(v8::Local<v8::String> property,
         context = context->parent;
     }
 
+    expressionContext->unresolvedNames = true;
+
     if (!resource->readOnly) {
         return v8::Handle<v8::Value>();
     } else {