From 8a6fadb39aec58f373ef24f39d39f7fbc050277d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 18 Oct 2013 15:42:10 +0200 Subject: [PATCH] Revert commit d818575966e2e2000fe2b7ee390c620f595d9825 This reverts the commit that deprecated the with statement and added a note to the docs that binding expressions will be compiled in strict mode in Qt 5.2. It turns out that we had to keep the with statement and enabling strict mode breaks just too much unfortunately. Change-Id: Id38c27f684fbfcb6b6b848be8f691658089d1adb Reviewed-by: Lars Knoll --- src/qml/doc/src/javascript/hostenvironment.qdoc | 9 --------- src/qml/parser/qqmljs.g | 4 ---- src/qml/parser/qqmljsparser.cpp | 4 ---- 3 files changed, 17 deletions(-) diff --git a/src/qml/doc/src/javascript/hostenvironment.qdoc b/src/qml/doc/src/javascript/hostenvironment.qdoc index 3bd64ac..a63ef61 100644 --- a/src/qml/doc/src/javascript/hostenvironment.qdoc +++ b/src/qml/doc/src/javascript/hostenvironment.qdoc @@ -166,15 +166,6 @@ Item { } \endqml -\li The \c with statement is deprecated. Using the \c with statement will issue a warning -at loading time and we plan on removing support for it in Qt 5.2. It is generally considered -a language feature that is not recommended for use due reducing the readability of code and disabling -many optimizations in the engine. It is also forbidden in ECMAScript 5 strict mode. - -\li JavaScript binding expressions are executed in non-strict mode. However we -plan on changing the default for bindings in Qt 5.2 to execute always in -ECMAScript 5 strict mode. - \endlist diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g index 8cc68e3..de4fec4 100644 --- a/src/qml/parser/qqmljs.g +++ b/src/qml/parser/qqmljs.g @@ -2679,10 +2679,6 @@ case $rule_number: { node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; - if (lexer->qmlMode()) { - const QString msg = qApp->translate("QQmlParser", "Deprecated JavaScript `with' statement detected in QML expression. Support for this will be removed in Qt 5.2!"); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, node->withToken, msg)); - } } break; ./ diff --git a/src/qml/parser/qqmljsparser.cpp b/src/qml/parser/qqmljsparser.cpp index 75f0f74..b86b4a9 100644 --- a/src/qml/parser/qqmljsparser.cpp +++ b/src/qml/parser/qqmljsparser.cpp @@ -1560,10 +1560,6 @@ case 317: { node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; - if (lexer->qmlMode()) { - const QString msg = qApp->translate("QQmlParser", "Deprecated JavaScript `with' statement detected in QML expression. Support for this will be removed in Qt 5.2!"); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, node->withToken, msg)); - } } break; case 318: { -- 2.7.4