diff options
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index b4d9e11716..afa7d2ed52 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -90,6 +90,12 @@ 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."; + } + Engine ee, *engine = ⅇ Lexer lexer(engine); lexer.setCode(sourceCode, line, parseAsBinding); |