From 1b10ce6a08edbc2ac7e8fd7e97e3fc691f2081df Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Tue, 16 Jun 2020 10:23:19 +0200 Subject: Port QtDeclarative from QStringRef to QStringView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-84319 Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Shawn Rutledge Reviewed-by: Timur Pocheptsov --- src/qml/jsruntime/qv4script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4script.cpp') diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index 7fa3544e5a..10250f6adc 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -96,7 +96,7 @@ void Script::parse() if (sourceCode.startsWith(QLatin1String("function("))) { 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("...")) + << (QStringView{sourceCode}.left(snippetLength) + QLatin1String("...")) << "\nThis will throw a syntax error in Qt 5.12. If you want a function expression, surround it by parentheses."; } -- cgit v1.2.3