diff options
author | Lars Knoll <[email protected]> | 2013-09-09 13:38:10 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-09-11 13:02:23 +0200 |
commit | 262d7261033df7650938c38401112a4767d926ff (patch) | |
tree | 8a9ecd61f546d40afa796e5ec3e786301fba1258 /src/qml/jsruntime/qv4jsonobject.cpp | |
parent | 6324e987e23b4fefc622f1fc6493baa1a3e47ee9 (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 <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 82c7e8caed..ef1f500580 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -886,6 +886,8 @@ Value JsonObject::method_parse(SimpleCallContext *ctx) Value JsonObject::method_stringify(SimpleCallContext *ctx) { + ValueScope scope(ctx); + Stringify stringify(ctx); Object *o = ctx->argument(1).asObject(); @@ -893,12 +895,13 @@ Value JsonObject::method_stringify(SimpleCallContext *ctx) stringify.replacerFunction = o->asFunctionObject(); if (o->isArrayObject()) { uint arrayLen = o->arrayLength(); + ScopedValue v(scope); for (uint i = 0; i < arrayLen; ++i) { - Value v = o->getIndexed(i); - if (v.asNumberObject() || v.asStringObject() || v.isNumber()) + v = o->getIndexed(i); + if (v->asNumberObject() || v->asStringObject() || v->isNumber()) v = __qmljs_to_string(v, ctx); - if (v.isString()) { - String *s = v.stringValue(); + if (v->isString()) { + String *s = v->stringValue(); if (!stringify.propertyList.contains(s)) stringify.propertyList.append(s); } |