diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 10:09:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:08 +0200 |
commit | 0f2cf9074d4f0220f5c707eed478f99334814789 (patch) | |
tree | 685ea2295b8728b3545523e2625a4cf65f39b9ee /src/qml/jsruntime/qv4numberobject.cpp | |
parent | 1ef957834bf9040ccd001fa6d80e483b9b21452c (diff) |
Fix CallContext to not hold arguments on the C stack anymore
Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4numberobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4numberobject.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp index f946b3180a..bc5e225f9b 100644 --- a/src/qml/jsruntime/qv4numberobject.cpp +++ b/src/qml/jsruntime/qv4numberobject.cpp @@ -100,9 +100,9 @@ void NumberPrototype::init(ExecutionEngine *engine, const Value &ctor) inline Value thisNumberValue(ExecutionContext *ctx) { - if (ctx->thisObject.isNumber()) - return ctx->thisObject; - NumberObject *n = ctx->thisObject.asNumberObject(); + if (ctx->callData->thisObject.isNumber()) + return ctx->callData->thisObject; + NumberObject *n = ctx->callData->thisObject.asNumberObject(); if (!n) ctx->throwTypeError(); return n->value; @@ -112,8 +112,8 @@ ReturnedValue NumberPrototype::method_toString(SimpleCallContext *ctx) { double num = thisNumberValue(ctx).asDouble(); - if (ctx->argumentCount && !ctx->arguments[0].isUndefined()) { - int radix = ctx->arguments[0].toInt32(); + if (ctx->callData->argc && !ctx->callData->args[0].isUndefined()) { + int radix = ctx->callData->args[0].toInt32(); if (radix < 2 || radix > 36) { ctx->throwError(QString::fromLatin1("Number.prototype.toString: %0 is not a valid radix") .arg(radix)); @@ -180,14 +180,14 @@ ReturnedValue NumberPrototype::method_toFixed(SimpleCallContext *ctx) double fdigits = 0; - if (ctx->argumentCount > 0) - fdigits = ctx->arguments[0].toInteger(); + if (ctx->callData->argc > 0) + fdigits = ctx->callData->args[0].toInteger(); if (std::isnan(fdigits)) fdigits = 0; if (fdigits < 0 || fdigits > 20) - ctx->throwRangeError(ctx->thisObject); + ctx->throwRangeError(ctx->callData->thisObject); QString str; if (std::isnan(v)) @@ -207,8 +207,8 @@ ReturnedValue NumberPrototype::method_toExponential(SimpleCallContext *ctx) int fdigits = -1; - if (ctx->argumentCount && !ctx->arguments[0].isUndefined()) { - int fdigits = ctx->arguments[0].toInt32(); + if (ctx->callData->argc && !ctx->callData->args[0].isUndefined()) { + int fdigits = ctx->callData->args[0].toInt32(); if (fdigits < 0 || fdigits > 20) { String *error = ctx->engine->newString(QStringLiteral("Number.prototype.toExponential: fractionDigits out of range")); ctx->throwRangeError(Value::fromString(error)); @@ -229,10 +229,10 @@ ReturnedValue NumberPrototype::method_toPrecision(SimpleCallContext *ctx) ScopedValue v(scope, thisNumberValue(ctx)); - if (!ctx->argumentCount || ctx->arguments[0].isUndefined()) + if (!ctx->callData->argc || ctx->callData->args[0].isUndefined()) return __qmljs_to_string(v, ctx); - double precision = ctx->arguments[0].toInt32(); + double precision = ctx->callData->args[0].toInt32(); if (precision < 1 || precision > 21) { String *error = ctx->engine->newString(QStringLiteral("Number.prototype.toPrecision: precision out of range")); ctx->throwRangeError(Value::fromString(error)); |