diff options
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index c2a15b8725..de56fcd5f3 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -1298,7 +1298,8 @@ Value DatePrototype::method_toJSON(SimpleCallContext *ctx) if (tv->isNumber() && !std::isfinite(tv->toNumber())) return Value::nullValue(); - FunctionObject *toIso = O->objectValue()->get(ctx->engine->newString(QStringLiteral("toISOString"))).asFunctionObject(); + ScopedValue v(scope, O->objectValue()->get(ctx->engine->newString(QStringLiteral("toISOString")))); + FunctionObject *toIso = v->asFunctionObject(); if (!toIso) ctx->throwTypeError(); |