aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4numberobject.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-04-29 17:15:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-21 16:20:35 +0200
commit358436f32a4e35091e8b56e32cf639b303665426 (patch)
treeadaeaf06cb9083b23cec8129186bde5b80862ba3 /src/qml/jsruntime/qv4numberobject.cpp
parenta51822cbf87291de6ba327c38d43583671ee892b (diff)
Fix Number.toExponential with parameter
The fractionDigits parameter was unfortunately ignored, due to an accidental double variable declaration, the latter in a narrower scope shadowing the former in the correct scope. Task-number: QTBUG-38577 Change-Id: I28f35466d2d744e84b86a3ca6b3371eb86869b55 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4numberobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4numberobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp
index 1076094a1e..c97e86f2cd 100644
--- a/src/qml/jsruntime/qv4numberobject.cpp
+++ b/src/qml/jsruntime/qv4numberobject.cpp
@@ -227,7 +227,7 @@ ReturnedValue NumberPrototype::method_toExponential(CallContext *ctx)
int fdigits = -1;
if (ctx->callData->argc && !ctx->callData->args[0].isUndefined()) {
- int fdigits = ctx->callData->args[0].toInt32();
+ fdigits = ctx->callData->args[0].toInt32();
if (fdigits < 0 || fdigits > 20) {
ScopedString error(scope, ctx->engine->newString(QStringLiteral("Number.prototype.toExponential: fractionDigits out of range")));
return ctx->throwRangeError(error);