From 9744e8bd423d528165f5e78704c6e017852b8e9a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 6 May 2014 09:23:59 +0200 Subject: Convert ExecutionContext to new storage scheme Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4jsonobject.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/qml/jsruntime/qv4jsonobject.cpp') diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index c904dd95c9..8552936663 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -237,7 +237,7 @@ ReturnedValue JsonParser::parseObject() BEGIN << "parseObject pos=" << json; Scope scope(context); - ScopedObject o(scope, context->engine->newObject()); + ScopedObject o(scope, context->d()->engine->newObject()); QChar token = nextToken(); while (token == Quote) { @@ -285,7 +285,7 @@ bool JsonParser::parseMember(ObjectRef o) if (!parseValue(val)) return false; - ScopedString s(scope, context->engine->newIdentifier(key)); + ScopedString s(scope, context->d()->engine->newIdentifier(key)); uint idx = s->asArrayIndex(); if (idx < UINT_MAX) { o->putIndexed(idx, val); @@ -304,7 +304,7 @@ ReturnedValue JsonParser::parseArray() { Scope scope(context); BEGIN << "parseArray"; - Scoped array(scope, context->engine->newArrayObject()); + Scoped array(scope, context->d()->engine->newArrayObject()); if (++nestingLevel > nestingLimit) { lastError = QJsonParseError::DeepNesting; @@ -407,7 +407,7 @@ bool JsonParser::parseValue(ValueRef val) return false; DEBUG << "value: string"; END; - val = context->engine->newString(value); + val = context->d()->engine->newString(value); return true; } case BeginArray: { @@ -710,21 +710,21 @@ QString Stringify::Str(const QString &key, ValueRef v) ScopedValue value(scope, *v); ScopedObject o(scope, value); if (o) { - ScopedString s(scope, ctx->engine->newString(QStringLiteral("toJSON"))); + ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("toJSON"))); Scoped toJSON(scope, o->get(s)); if (!!toJSON) { ScopedCallData callData(scope, 1); callData->thisObject = value; - callData->args[0] = ctx->engine->newString(key); + callData->args[0] = ctx->d()->engine->newString(key); value = toJSON->call(callData); } } if (replacerFunction) { - ScopedObject holder(scope, ctx->engine->newObject()); + ScopedObject holder(scope, ctx->d()->engine->newObject()); holder->put(ctx, QString(), value); ScopedCallData callData(scope, 2); - callData->args[0] = ctx->engine->newString(key); + callData->args[0] = ctx->d()->engine->newString(key); callData->args[1] = value; callData->thisObject = holder; value = replacerFunction->call(callData); @@ -954,7 +954,7 @@ ReturnedValue JsonObject::method_stringify(CallContext *ctx) QString result = stringify.Str(QString(), arg0); if (result.isEmpty() || scope.engine->hasException) return Encode::undefined(); - return ctx->engine->newString(result)->asReturnedValue(); + return ctx->d()->engine->newString(result)->asReturnedValue(); } @@ -962,7 +962,7 @@ ReturnedValue JsonObject::method_stringify(CallContext *ctx) ReturnedValue JsonObject::fromJsonValue(ExecutionEngine *engine, const QJsonValue &value) { if (value.isString()) - return engine->currentContext()->engine->newString(value.toString())->asReturnedValue(); + return engine->currentContext()->d()->engine->newString(value.toString())->asReturnedValue(); else if (value.isDouble()) return Encode(value.toDouble()); else if (value.isBool()) -- cgit v1.2.3