aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script.cpp
diff options
context:
space:
mode:
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 afa7d2ed52..5cd62c90f1 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;