aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-06-25 09:53:01 +0200
committerLiang Qi <liang.qi@qt.io>2018-06-25 12:15:55 +0200
commitfbf6f7400a5b5ae10267171e201391ce1ff8eb96 (patch)
tree18e22092c2764fea16442fd814f230d4fe095a49 /src/qml/jsruntime/qv4script.cpp
parentc21a6a9f2c2d635aca3bf88a6431c560b16b1cc6 (diff)
parent9999591e69a0908cd3fbe14646fb98881e32061b (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/quick/handlers/qquickhandlerpoint.cpp src/quick/handlers/qquicksinglepointhandler.cpp tests/auto/qml/ecmascripttests/test262 Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r--src/qml/jsruntime/qv4script.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index ca6e4c50b1..efd528860f 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -91,9 +91,10 @@ void Script::parse()
Module module(v4->debugger() != nullptr);
if (sourceCode.startsWith(QLatin1String("function("))) {
- qWarning() << "Warning: Using function expressions as statements in scripts in not compliant with the ECMAScript specification at\n"
- << (sourceCode.leftRef(70) + QLatin1String("..."))
- << "\nThis will throw a syntax error in Qt 5.12. If you want a function expression, surround it by parentheses.";
+ static const int snippetLength = 70;
+ qWarning() << "Warning: Using function expressions as statements in scripts is not compliant with the ECMAScript specification:\n"
+ << (sourceCode.leftRef(snippetLength) + QLatin1String("..."))
+ << "\nThis will throw a syntax error in Qt 5.12. If you want a function expression, surround it by parentheses.";
}
Engine ee, *engine = &ee;