aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4numberobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-09 13:38:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-11 13:02:23 +0200
commit262d7261033df7650938c38401112a4767d926ff (patch)
tree8a9ecd61f546d40afa796e5ec3e786301fba1258 /src/qml/jsruntime/qv4numberobject.cpp
parent6324e987e23b4fefc622f1fc6493baa1a3e47ee9 (diff)
Continue conversion to using scoped values
This converts all methods in qv4runtime_p.h to not use raw values in arguments anymore. The conversion of return values will be done in a separate commit. Change-Id: Ie6e8f3bed459d09cb831f7f87920b7eada161502 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4numberobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4numberobject.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp
index dbdf109a4a..ffcbca2ce5 100644
--- a/src/qml/jsruntime/qv4numberobject.cpp
+++ b/src/qml/jsruntime/qv4numberobject.cpp
@@ -225,7 +225,9 @@ Value NumberPrototype::method_toExponential(SimpleCallContext *ctx)
Value NumberPrototype::method_toPrecision(SimpleCallContext *ctx)
{
- Value v = thisNumberValue(ctx);
+ ValueScope scope(ctx);
+
+ ScopedValue v(scope, thisNumberValue(ctx));
Value prec = ctx->argument(0);
if (prec.isUndefined())
@@ -239,7 +241,7 @@ Value NumberPrototype::method_toPrecision(SimpleCallContext *ctx)
char str[100];
double_conversion::StringBuilder builder(str, sizeof(str));
- double_conversion::DoubleToStringConverter::EcmaScriptConverter().ToPrecision(v.asDouble(), precision, &builder);
+ double_conversion::DoubleToStringConverter::EcmaScriptConverter().ToPrecision(v->asDouble(), precision, &builder);
QString result = QString::fromLatin1(builder.Finalize());
return Value::fromString(ctx, result);