diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2018-03-26 21:32:05 +0200 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:17:13 +0000 |
| commit | e9492e7b7b44c1f8cd5489d93463fc2b1f8b6d72 (patch) | |
| tree | 01d8e52fe7841c91fd019219055796fcc8db22aa /src/qml/compiler/qqmlirbuilder.cpp | |
| parent | 17f72f2d07352940b67a60c2ff6f7ef848793488 (diff) | |
Rename the CompilationMode enum to ContextType
And make it an enum class. The new name fits better, as it's mainly
used to determine the type of the context when parsing. Also already
added the 'Block' value that will be needed.
Change-Id: I70d963b6a0b22db1a3c607cce6bdd2054b29e000
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder.cpp')
| -rw-r--r-- | src/qml/compiler/qqmlirbuilder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index f763e55113..ffad1927df 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1809,8 +1809,8 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<Compil { QVector<int> runtimeFunctionIndices(functions.size()); - QV4::Compiler::ScanFunctions scan(this, sourceCode, QV4::Compiler::GlobalCode); - scan.enterGlobalEnvironment(QV4::Compiler::QmlBinding); + QV4::Compiler::ScanFunctions scan(this, sourceCode, QV4::Compiler::ContextType::Global); + scan.enterGlobalEnvironment(QV4::Compiler::ContextType::Binding); for (const CompiledFunctionOrExpression &f : functions) { Q_ASSERT(f.node != qmlRoot); QQmlJS::AST::FunctionDeclaration *function = QQmlJS::AST::cast<QQmlJS::AST::FunctionDeclaration*>(f.node); @@ -1818,7 +1818,7 @@ QVector<int> JSCodeGen::generateJSCodeForFunctionsAndBindings(const QList<Compil if (function) scan.enterQmlFunction(function); else - scan.enterEnvironment(f.node, QV4::Compiler::QmlBinding); + scan.enterEnvironment(f.node, QV4::Compiler::ContextType::Binding); scan(function ? function->body : f.node); scan.leaveEnvironment(); @@ -2193,7 +2193,7 @@ QV4::Compiler::Codegen::Reference JSCodeGen::fallbackNameLookup(const QString &n // Look for IDs first. for (const IdMapping &mapping : qAsConst(_idObjects)) { if (name == mapping.name) { - if (_context->compilationMode == QV4::Compiler::QmlBinding) + if (_context->type == QV4::Compiler::ContextType::Binding) _context->idObjectDependencies.insert(mapping.idIndex); Instruction::LoadIdObject load; |
