aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language/evaluator.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2018-01-10 08:56:36 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2018-01-10 13:15:06 +0000
commit50a95860f9ca5aee0d4400aae404ee44f5366c47 (patch)
tree5d66a105e3b1dc51057ec4695e55100111edc7dd /src/lib/corelib/language/evaluator.h
parent3e340654da5b2b0d71dd6f51254f72f92a06aad6 (diff)
Remove duplicated script error handling code
Add throwOnEvaluationError to evaluator.h. That function takes a function argument that provides a fallback error location in case the location cannot be extracted from the script error itself. Change-Id: I4ad5d87f5876b9025e7ab4c65285171e05b4d2f6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/language/evaluator.h')
-rw-r--r--src/lib/corelib/language/evaluator.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/corelib/language/evaluator.h b/src/lib/corelib/language/evaluator.h
index 08c37c85e..f16ee4f26 100644
--- a/src/lib/corelib/language/evaluator.h
+++ b/src/lib/corelib/language/evaluator.h
@@ -48,6 +48,8 @@
#include <QtScript/qscriptvalue.h>
+#include <functional>
+
namespace qbs {
namespace Internal {
class EvaluatorScriptClass;
@@ -113,6 +115,9 @@ private:
mutable QHash<FileContextConstPtr, FileContextScopes> m_fileContextScopesMap;
};
+void throwOnEvaluationError(ScriptEngine *engine, const QScriptValue &scriptValue,
+ const std::function<CodeLocation()> &provideFallbackCodeLocation);
+
class EvalCacheEnabler
{
public: