aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-11-29 11:05:04 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2018-11-29 11:38:51 +0000
commit2fa1c92cb7e60f89e200eff48cf7e76d8d2febe6 (patch)
tree4b3218530ade7938bc25adcc4c43a6126866b29c /src/qml/qml
parent597ce09c7a1d8b89e9473faae900321ef2d4181d (diff)
Fix parsing of js files via Qt.include()
Make sure to parse them as JavaScript, not as QML, so that certain keywords such as char or double map to identifiers as expected. Also removed an unused function. Fixes: QTBUG-71524 Change-Id: Ie8a8dabe717ee12def6af512943e6d01efcf9876 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 9f2a96d5d9..380163202a 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -408,7 +408,7 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObje
QV4::Scope scope(v4);
QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, scopeObject));
- QV4::Script script(v4, qmlContext, code, filename, line);
+ QV4::Script script(v4, qmlContext, /*parse as QML binding*/true, code, filename, line);
QV4::ScopedValue result(scope);
script.parse();
if (!v4->hasException)
@@ -438,7 +438,7 @@ void QQmlJavaScriptExpression::createQmlBinding(QQmlContextData *ctxt, QObject *
QV4::Scope scope(v4);
QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, qmlScope));
- QV4::Script script(v4, qmlContext, code, filename, line);
+ QV4::Script script(v4, qmlContext, /*parse as QML binding*/true, code, filename, line);
script.parse();
if (v4->hasException) {
QQmlDelayedError *error = delayedError();