diff options
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index fb47c4a15e..49bee363a3 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -388,13 +388,13 @@ ReturnedValue ObjectPrototype::method_toString(SimpleCallContext *ctx) { Scope scope(ctx); if (ctx->callData->thisObject.isUndefined()) { - return Value::fromString(ctx, QStringLiteral("[object Undefined]")).asReturnedValue(); + return ctx->engine->newString(QStringLiteral("[object Undefined]"))->asReturnedValue(); } else if (ctx->callData->thisObject.isNull()) { - return Value::fromString(ctx, QStringLiteral("[object Null]")).asReturnedValue(); + return ctx->engine->newString(QStringLiteral("[object Null]"))->asReturnedValue(); } else { ScopedObject obj(scope, __qmljs_to_object(ctx, ValueRef(&ctx->callData->thisObject))); QString className = obj->className(); - return Value::fromString(ctx, QString::fromUtf8("[object %1]").arg(className)).asReturnedValue(); + return ctx->engine->newString(QString::fromUtf8("[object %1]").arg(className))->asReturnedValue(); } } |