aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllocale.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-11-11 15:08:30 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-12 20:44:13 +0100
commitafbf1f74af678af0eda76035133406aa8883408a (patch)
tree2bc7b93256cad8691baa0079e60ba4cf2d52fa93 /src/qml/qml/qqmllocale.cpp
parentfaf13a3aa0c97b7386e44d02f323a9156a733c9f (diff)
Ported ExecutionEngine::newString and newIdentifier to Heap::String
Avoid the use of Returned<String> for newString and changed the identifier table to use Heap::String. This required moving some code back into Heap::String, but that's code that doesn't call back into the GC, so allocations and therefore future object moves aren't possible. Change-Id: I1dca3e9c12a9c56f09419af8cc8cba39fe04f720 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmllocale.cpp')
-rw-r--r--src/qml/qml/qqmllocale.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index 59671d6f6d..bed6c4c57e 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -376,9 +376,9 @@ QV4::ReturnedValue QQmlNumberExtension::method_toLocaleString(QV4::CallContext *
if (ctx->d()->callData->argc > 1) {
if (!ctx->d()->callData->args[1].isString())
V4THROW_ERROR("Locale: Number.toLocaleString(): Invalid arguments");
- QV4::String *fs = ctx->d()->callData->args[1].toString(ctx);
- if (fs->d()->length())
- format = fs->toQString().at(0).unicode();
+ QString fs = ctx->d()->callData->args[1].toQString();
+ if (fs.length())
+ format = fs.at(0).unicode();
}
int prec = 2;
if (ctx->d()->callData->argc > 2) {
@@ -440,12 +440,12 @@ QV4::ReturnedValue QQmlNumberExtension::method_fromLocaleString(QV4::CallContext
numberIdx = 1;
}
- QV4::String *ns = ctx->d()->callData->args[numberIdx].toString(ctx);
- if (!ns->d()->length())
+ QString ns = ctx->d()->callData->args[numberIdx].toQString();
+ if (!ns.length())
return QV4::Encode(Q_QNAN);
bool ok = false;
- double val = locale.toDouble(ns->toQString(), &ok);
+ double val = locale.toDouble(ns, &ok);
if (!ok)
V4THROW_ERROR("Locale: Number.fromLocaleString(): Invalid format")