aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4regexpobject.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2013-11-01 12:38:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-04 02:16:04 +0100
commita79e400150e9d550cc4ddc0c0497778d8b78fe5d (patch)
tree5a66670d4c31aaf0d356042b6fe607728e237b5b /src/qml/jsruntime/qv4regexpobject.cpp
parentb5991ce2a61219bda5a7fa6e33f323158d1eb78b (diff)
Fix various compiler warnings in order to remove warn_off in the near future
Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index 4f0f07377f..02467c3045 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -185,6 +185,7 @@ void RegExpObject::markObjects(Managed *that)
Property *RegExpObject::lastIndexProperty(ExecutionContext *ctx)
{
+ Q_UNUSED(ctx);
Q_ASSERT(0 == internalClass->find(ctx->engine->newIdentifier(QStringLiteral("lastIndex"))));
return &memberData[0];
}
@@ -200,14 +201,14 @@ QRegExp RegExpObject::toQRegExp() const
QString RegExpObject::toString() const
{
- QString result = QChar('/') + source();
- result += QChar('/');
+ QString result = QLatin1Char('/') + source();
+ result += QLatin1Char('/');
if (global)
- result += QChar('g');
+ result += QLatin1Char('g');
if (value->ignoreCase())
- result += QChar('i');
+ result += QLatin1Char('i');
if (value->multiLine())
- result += QChar('m');
+ result += QLatin1Char('m');
return result;
}
@@ -270,21 +271,21 @@ ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData)
if (scope.hasException())
return Encode::undefined();
for (int i = 0; i < str.length(); ++i) {
- if (str.at(i) == QChar('g') && !global) {
+ if (str.at(i) == QLatin1Char('g') && !global) {
global = true;
- } else if (str.at(i) == QChar('i') && !ignoreCase) {
+ } else if (str.at(i) == QLatin1Char('i') && !ignoreCase) {
ignoreCase = true;
- } else if (str.at(i) == QChar('m') && !multiLine) {
+ } else if (str.at(i) == QLatin1Char('m') && !multiLine) {
multiLine = true;
} else {
- return ctx->throwSyntaxError(0);
+ return ctx->throwSyntaxError(QStringLiteral("Invalid flags supplied to RegExp constructor"));
}
}
}
Scoped<RegExp> regexp(scope, RegExp::create(ctx->engine, pattern, ignoreCase, multiLine));
if (!regexp->isValid())
- return ctx->throwSyntaxError(0);
+ return ctx->throwSyntaxError(QStringLiteral("Invalid regular expression"));
return Encode(ctx->engine->newRegExpObject(regexp, global));
}