diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-10-24 10:38:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-29 23:05:33 +0100 |
commit | 1fc951da6aa0bff05af37b20744aba810a2d2988 (patch) | |
tree | ce83346780586278bc5ba91370146a034aeebeac /src/qml/compiler/qqmlcodegenerator_p.h | |
parent | 4d33a38f4b11cea2123b818487ff55f0988767bc (diff) |
Cleanup QML specific JS code generator
Move parameters global to the entire QML file to the constructor, pass
component/context specific parameters to the generate function.
Change-Id: I6c3ab41b3bab19b066bbe20f971c5cafaeb70b98
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmlcodegenerator_p.h')
-rw-r--r-- | src/qml/compiler/qqmlcodegenerator_p.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator_p.h b/src/qml/compiler/qqmlcodegenerator_p.h index 0f4c2b145a..1b72e96097 100644 --- a/src/qml/compiler/qqmlcodegenerator_p.h +++ b/src/qml/compiler/qqmlcodegenerator_p.h @@ -345,9 +345,8 @@ private: struct Q_QML_EXPORT JSCodeGen : public QQmlJS::Codegen { - JSCodeGen() - : QQmlJS::Codegen(/*strict mode*/false) - {} + JSCodeGen(const QString &fileName, const QString &sourceCode, V4IR::Module *jsModule, + QQmlJS::Engine *jsEngine, AST::UiProgram *qmlRoot); struct IdMapping { @@ -357,15 +356,16 @@ struct Q_QML_EXPORT JSCodeGen : public QQmlJS::Codegen typedef QVector<IdMapping> ObjectIdMapping; // Returns mapping from input functions to index in V4IR::Module::functions / compiledData->runtimeFunctions - QVector<int> generateJSCodeForFunctionsAndBindings(const QString &fileName, ParsedQML *output); - QVector<int> generateJSCodeForFunctionsAndBindings(const QString &fileName, const QString &sourceCode, V4IR::Module *jsModule, - QQmlJS::Engine *jsEngine, AST::UiProgram *qmlRoot, AST::Node *contextRoot, const QList<AST::Node*> &functions, - const ObjectIdMapping &objectIds = ObjectIdMapping()); + QVector<int> generateJSCodeForFunctionsAndBindings(AST::Node *contextRoot, const QList<AST::Node*> &functions, const ObjectIdMapping &objectIds = ObjectIdMapping()); protected: virtual V4IR::Expr *fallbackNameLookup(const QString &name, int line, int col) const; private: + QString sourceCode; + QQmlJS::Engine *jsEngine; // needed for memory pool + AST::UiProgram *qmlRoot; + ObjectIdMapping idObjects; }; |