From: Simon Hausmann Date: Tue, 29 Apr 2014 15:15:55 +0000 (+0200) Subject: Fix Number.toExponential with parameter X-Git-Tag: upstream/5.3.1~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=358436f32a4e35091e8b56e32cf639b303665426;p=platform%2Fupstream%2Fqtdeclarative.git 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 --- diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp index 1076094..c97e86f 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);