aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4errorobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-09 13:38:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-11 13:02:23 +0200
commit262d7261033df7650938c38401112a4767d926ff (patch)
tree8a9ecd61f546d40afa796e5ec3e786301fba1258 /src/qml/jsruntime/qv4errorobject.cpp
parent6324e987e23b4fefc622f1fc6493baa1a3e47ee9 (diff)
Continue conversion to using scoped values
This converts all methods in qv4runtime_p.h to not use raw values in arguments anymore. The conversion of return values will be done in a separate commit. Change-Id: Ie6e8f3bed459d09cb831f7f87920b7eada161502 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4errorobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4errorobject.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp
index 6e6aeca299..6174c9a7f5 100644
--- a/src/qml/jsruntime/qv4errorobject.cpp
+++ b/src/qml/jsruntime/qv4errorobject.cpp
@@ -327,20 +327,22 @@ void ErrorPrototype::init(ExecutionEngine *engine, const Value &ctor, Object *ob
Value ErrorPrototype::method_toString(SimpleCallContext *ctx)
{
+ ValueScope scope(ctx);
+
Object *o = ctx->thisObject.asObject();
if (!o)
ctx->throwTypeError();
- Value name = o->get(ctx->engine->newString(QString::fromLatin1("name")));
+ ScopedValue name(scope, o->get(ctx->engine->newString(QString::fromLatin1("name"))));
QString qname;
- if (name.isUndefined())
+ if (name->isUndefined())
qname = QString::fromLatin1("Error");
else
qname = __qmljs_to_string(name, ctx).stringValue()->toQString();
- Value message = o->get(ctx->engine->newString(QString::fromLatin1("message")));
+ ScopedValue message(scope, o->get(ctx->engine->newString(QString::fromLatin1("message"))));
QString qmessage;
- if (!message.isUndefined())
+ if (!message->isUndefined())
qmessage = __qmljs_to_string(message, ctx).stringValue()->toQString();
QString str;