OSDN Git Service

QmlJS: Remove unused function environment from binder.
authorChristian Kamm <christian.d.kamm@nokia.com>
Wed, 28 Apr 2010 07:40:51 +0000 (09:40 +0200)
committerChristian Kamm <christian.d.kamm@nokia.com>
Wed, 28 Apr 2010 08:01:36 +0000 (10:01 +0200)
This used to contain all functions declared in Script blocks. With them
gone, there's no reason to keep it.

src/libs/qmljs/qmljsbind.cpp
src/libs/qmljs/qmljsbind.h
src/libs/qmljs/qmljsinterpreter.cpp
src/libs/qmljs/qmljsinterpreter.h
src/libs/qmljs/qmljslink.cpp

index 6118237..00d9013 100644 (file)
@@ -43,7 +43,6 @@ Bind::Bind(Document *doc)
     : _doc(doc),
       _currentObjectValue(0),
       _idEnvironment(0),
-      _functionEnvironment(0),
       _rootObjectValue(0)
 {
     if (_doc)
@@ -79,11 +78,6 @@ Interpreter::ObjectValue *Bind::idEnvironment() const
     return _idEnvironment;
 }
 
-Interpreter::ObjectValue *Bind::functionEnvironment() const
-{
-    return _functionEnvironment;
-}
-
 Interpreter::ObjectValue *Bind::rootObjectValue() const
 {
     return _rootObjectValue;
@@ -175,7 +169,6 @@ void Bind::accept(Node *node)
 bool Bind::visit(AST::UiProgram *)
 {
     _idEnvironment = _engine.newObject(/*prototype =*/ 0);
-    _functionEnvironment = _engine.newObject(/*prototype =*/ 0);
     return true;
 }
 
index bb1a77f..9de6f27 100644 (file)
@@ -56,7 +56,6 @@ public:
 
     Interpreter::ObjectValue *currentObjectValue() const;
     Interpreter::ObjectValue *idEnvironment() const;
-    Interpreter::ObjectValue *functionEnvironment() const;
     Interpreter::ObjectValue *rootObjectValue() const;
 
     Interpreter::ObjectValue *findQmlObject(AST::Node *node) const;
@@ -98,7 +97,6 @@ private:
 
     Interpreter::ObjectValue *_currentObjectValue;
     Interpreter::ObjectValue *_idEnvironment;
-    Interpreter::ObjectValue *_functionEnvironment;
     Interpreter::ObjectValue *_rootObjectValue;
 
     QHash<AST::Node *, Interpreter::ObjectValue *> _qmlObjects;
index d6c9a82..a3cf327 100644 (file)
@@ -1316,7 +1316,6 @@ void ScopeChain::QmlComponentChain::clear()
     qDeleteAll(instantiatingComponents);
     instantiatingComponents.clear();
     rootObject = 0;
-    functionScopes.clear();
     ids = 0;
 }
 
@@ -1327,7 +1326,6 @@ void ScopeChain::QmlComponentChain::add(QList<const ObjectValue *> *list) const
 
     if (rootObject)
         list->append(rootObject);
-    list->append(functionScopes);
     if (ids)
         list->append(ids);
 }
@@ -1347,7 +1345,6 @@ void ScopeChain::update()
     if (qmlComponentScope.rootObject && ! qmlScopeObjects.contains(qmlComponentScope.rootObject))
         _all += qmlComponentScope.rootObject;
     _all += qmlScopeObjects;
-    _all += qmlComponentScope.functionScopes;
     if (qmlComponentScope.ids)
         _all += qmlComponentScope.ids;
     if (qmlTypes)
index a22d78e..309765e 100644 (file)
@@ -256,7 +256,6 @@ public:
 
         QList<QmlComponentChain *> instantiatingComponents;
         const ObjectValue *rootObject;
-        QList<const ObjectValue *> functionScopes;
         const ObjectValue *ids;
 
         void add(QList<const ObjectValue *> *list) const;
index 3a85464..fbbe407 100644 (file)
@@ -115,7 +115,6 @@ void Link::makeComponentChain(
     if (bind->rootObjectValue())
         target->rootObject = bind->rootObjectValue();
 
-    target->functionScopes += bind->functionEnvironment();
     target->ids = bind->idEnvironment();
 }