diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2018-10-05 14:17:05 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-11-01 15:07:01 +0000 |
commit | 8b418d9be73dafd25c9c528127274a3573f1a7e1 (patch) | |
tree | f5901f8cf6e9a23caadbf5ba6fc4c3329b9823c7 /src/qml/compiler/qv4compilercontext_p.h | |
parent | fd3cf7a45ad5abf269aecc63dc164d9bd0f1b407 (diff) |
Clone ContextType::Global as ContextType::ScriptImportedByQML
Add new enum value QV4::Compiler::ContextType::ScriptImportedByQML, which
behaves exactly the same as ContextType::Global. A follow-up patch will change
the behavior slightly.
Task-number: QTBUG-69408
Change-Id: I20d27804fd1433f2229704546bcd78a0ac108c01
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilercontext_p.h')
-rw-r--r-- | src/qml/compiler/qv4compilercontext_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compilercontext_p.h b/src/qml/compiler/qv4compilercontext_p.h index 796d5e274c..d36ef0f447 100644 --- a/src/qml/compiler/qv4compilercontext_p.h +++ b/src/qml/compiler/qv4compilercontext_p.h @@ -75,7 +75,8 @@ enum class ContextType { // * return statements are allowed everywhere (like in FunctionCode) // * variable declarations are treated as true locals (like in FunctionCode) Block, - ESModule + ESModule, + ScriptImportedByQML, }; struct Context; @@ -313,7 +314,7 @@ struct Context { bool requiresImplicitReturnValue() const { return contextType == ContextType::Binding || contextType == ContextType::Eval || - contextType == ContextType::Global; + contextType == ContextType::Global || contextType == ContextType::ScriptImportedByQML; } void addUsedVariable(const QString &name) { |