aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-22 15:20:47 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-22 15:21:06 +0100
commitf286db98ee41a8aa71b9a65a235b6d3e265d79f4 (patch)
tree16e17d4c52d35f7e55fc2103db5c96850e9bdfff /src/qml
parentce093497f2d4164fa8abc06cf976f9e36798e11e (diff)
parentb60a5dc9405ce89d7a742abc81b906d5c8cf5f7d (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/parser/qqmljs.g19
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp22
-rw-r--r--src/qml/qml/qqmlboundsignal_p.h1
-rw-r--r--src/qml/qml/qqmlcomponent.cpp4
-rw-r--r--src/qml/qml/qqmlengine.cpp2
5 files changed, 44 insertions, 4 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index 1a7028dbb3..161c8ffcde 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -467,7 +467,24 @@ bool Parser::parse(int startToken)
token_buffer[0].token = startToken;
first_token = &token_buffer[0];
- last_token = &token_buffer[1];
+ if (startToken == T_FEED_JS_PROGRAM && !lexer->qmlMode()) {
+ Directives ignoreDirectives;
+ Directives *directives = driver->directives();
+ if (!directives)
+ directives = &ignoreDirectives;
+ DiagnosticMessage error;
+ if (!lexer->scanDirectives(directives, &error)) {
+ diagnostic_messages.append(error);
+ return false;
+ }
+ token_buffer[1].token = lexer->tokenKind();
+ token_buffer[1].dval = lexer->tokenValue();
+ token_buffer[1].loc = location(lexer);
+ token_buffer[1].spell = lexer->tokenSpell();
+ last_token = &token_buffer[2];
+ } else {
+ last_token = &token_buffer[1];
+ }
tos = -1;
program = 0;
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index f2acc7352c..9879763c72 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -245,6 +245,28 @@ void QQmlBoundSignalExpression::evaluate(void **a)
ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete.
}
+void QQmlBoundSignalExpression::evaluate(const QList<QVariant> &args)
+{
+ Q_ASSERT (context() && engine());
+
+ if (!expressionFunctionValid())
+ return;
+
+ QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine());
+ QV4::Scope scope(ep->v4engine());
+
+ ep->referenceScarceResources(); // "hold" scarce resources in memory during evaluation.
+
+ QV4::ScopedCallData callData(scope, args.count());
+ for (int ii = 0; ii < args.count(); ++ii) {
+ callData->args[ii] = scope.engine->fromVariant(args[ii]);
+ }
+
+ QQmlJavaScriptExpression::evaluate(callData, 0);
+
+ ep->dereferenceScarceResources(); // "release" scarce resources if top-level expression evaluation is complete.
+}
+
////////////////////////////////////////////////////////////////////////
diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h
index 59ed37c939..10c59b07c1 100644
--- a/src/qml/qml/qqmlboundsignal_p.h
+++ b/src/qml/qml/qqmlboundsignal_p.h
@@ -84,6 +84,7 @@ public:
// evaluation of a bound signal expression doesn't return any value
void evaluate(void **a);
+ void evaluate(const QList<QVariant> &args);
QQmlSourceLocation sourceLocation() const;
QString expression() const;
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 3337838a90..b8bd0f7f1d 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -295,7 +295,7 @@ V4_DEFINE_EXTENSION(QQmlComponentExtension, componentExtension);
\value Null This QQmlComponent has no data. Call loadUrl() or setData() to add QML content.
\value Ready This QQmlComponent is ready and create() may be called.
\value Loading This QQmlComponent is loading network data.
- \value Error An error has occurred. Call errors() to retrieve a list of \{QQmlError}{errors}.
+ \value Error An error has occurred. Call errors() to retrieve a list of \l {QQmlError}{errors}.
*/
/*!
@@ -685,7 +685,7 @@ void QQmlComponentPrivate::loadUrl(const QUrl &newUrl, QQmlComponent::Compilatio
}
/*!
- Return the list of errors that occurred during the last compile or create
+ Returns the list of errors that occurred during the last compile or create
operation. An empty list is returned if isError() is not set.
*/
QList<QQmlError> QQmlComponent::errors() const
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 74a3129dfb..0e99e4ca89 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1240,7 +1240,7 @@ bool QQmlEngine::outputWarningsToStandardError() const
If \a enabled is true, any warning messages generated by QML will be
output to stderr and emitted by the warnings() signal. If \a enabled
- is false, on the warnings() signal will be emitted. This allows
+ is false, only the warnings() signal will be emitted. This allows
applications to handle warning output themselves.
The default value is true.