From d3a6412c66f62aa045f2856b0bf0ede4af10a984 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 1 Dec 2014 16:13:20 +0100 Subject: Remove most of the places where getPointer() is used This is no longer required, and simply uglifies the code Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743 Reviewed-by: Simon Hausmann --- src/particles/qquickv4particledata.cpp | 2 +- src/qml/debugger/qv4debugservice.cpp | 4 +- src/qml/jsapi/qjsvalue.cpp | 14 ++-- src/qml/jsruntime/qv4arrayobject.cpp | 18 ++--- src/qml/jsruntime/qv4context.cpp | 96 +++++++++++++-------------- src/qml/jsruntime/qv4dateobject.cpp | 2 +- src/qml/jsruntime/qv4engine.cpp | 4 +- src/qml/jsruntime/qv4errorobject.cpp | 2 +- src/qml/jsruntime/qv4functionobject.cpp | 12 ++-- src/qml/jsruntime/qv4include.cpp | 20 +++--- src/qml/jsruntime/qv4jsonobject.cpp | 8 +-- src/qml/jsruntime/qv4lookup.cpp | 6 +- src/qml/jsruntime/qv4object.cpp | 18 ++--- src/qml/jsruntime/qv4objectproto.cpp | 44 ++++++------ src/qml/jsruntime/qv4qobjectwrapper.cpp | 12 ++-- src/qml/jsruntime/qv4regexpobject.cpp | 4 +- src/qml/jsruntime/qv4runtime.cpp | 28 ++++---- src/qml/jsruntime/qv4script.cpp | 2 +- src/qml/jsruntime/qv4serialize.cpp | 6 +- src/qml/jsruntime/qv4stringobject.cpp | 8 +-- src/qml/qml/qqmlbinding.cpp | 2 +- src/qml/qml/qqmlcomponent.cpp | 4 +- src/qml/qml/qqmlcontextwrapper.cpp | 2 +- src/qml/qml/qqmllocale.cpp | 2 +- src/qml/qml/qqmlobjectcreator.cpp | 4 +- src/qml/qml/qqmlvaluetypewrapper.cpp | 6 +- src/qml/qml/qqmlxmlhttprequest.cpp | 38 +++++------ src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 16 ++--- src/qml/qml/v8/qv4domerrors_p.h | 2 +- src/qml/qml/v8/qv8engine.cpp | 4 +- src/qml/types/qqmldelegatemodel.cpp | 18 ++--- src/qml/types/qqmllistmodel.cpp | 12 ++-- src/qml/types/qquickworkerscript.cpp | 6 +- src/qml/util/qqmladaptormodel.cpp | 6 +- src/quick/items/context2d/qquickcontext2d.cpp | 18 ++--- src/quick/items/qquickitem.cpp | 24 +++---- src/quick/util/qquickglobal.cpp | 22 +++--- 37 files changed, 248 insertions(+), 248 deletions(-) (limited to 'src') diff --git a/src/particles/qquickv4particledata.cpp b/src/particles/qquickv4particledata.cpp index 55ff0a4d28..bdb9273cd8 100644 --- a/src/particles/qquickv4particledata.cpp +++ b/src/particles/qquickv4particledata.cpp @@ -510,7 +510,7 @@ QQuickV4ParticleData::QQuickV4ParticleData(QV8Engine* engine, QQuickParticleData QV4::Scope scope(v4); QV4::ScopedObject o(scope, v4->memoryManager->alloc(v4, datum)); QV4::ScopedObject p(scope, d->proto.value()); - o->setPrototype(p.getPointer()); + o->setPrototype(p); m_v4Value = o; } diff --git a/src/qml/debugger/qv4debugservice.cpp b/src/qml/debugger/qv4debugservice.cpp index 90f86cc29a..79c384ead9 100644 --- a/src/qml/debugger/qv4debugservice.cpp +++ b/src/qml/debugger/qv4debugservice.cpp @@ -232,12 +232,12 @@ protected: QV4::Scope scope(engine()); QV4::ScopedObject obj(scope, value->asObject()); - int ref = cachedObjectRef(obj.getPointer()); + int ref = cachedObjectRef(obj); if (ref != -1) { addNameRefPair(name, ref); } else { int ref = newRefId(); - cacheObjectRef(obj.getPointer(), ref); + cacheObjectRef(obj, ref); QJsonArray properties, *prev = &properties; QSet used; diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index fd7aeed1cd..1c2a727e36 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -731,7 +731,7 @@ void QJSValue::setPrototype(const QJSValue& prototype) qWarning("QJSValue::setPrototype() failed: cannot set a prototype created in a different engine"); return; } - if (!o->setPrototype(p.getPointer())) + if (!o->setPrototype(p)) qWarning("QJSValue::setPrototype() failed: cyclic prototype value"); } @@ -906,7 +906,7 @@ QJSValue QJSValue::property(quint32 arrayIndex) const if (!o) return QJSValue(); - QV4::ScopedValue result(scope, arrayIndex == UINT_MAX ? o->get(engine->id_uintMax.getPointer()) : o->getIndexed(arrayIndex)); + QV4::ScopedValue result(scope, arrayIndex == UINT_MAX ? o->get(engine->id_uintMax) : o->getIndexed(arrayIndex)); if (d->engine->hasException) d->engine->catchException(); return new QJSValuePrivate(engine, result); @@ -948,7 +948,7 @@ void QJSValue::setProperty(const QString& name, const QJSValue& value) s->makeIdentifier(); QV4::ScopedValue v(scope, value.d->getValue(engine)); - o->put(s.getPointer(), v); + o->put(s, v); if (d->engine->hasException) d->engine->catchException(); } @@ -980,7 +980,7 @@ void QJSValue::setProperty(quint32 arrayIndex, const QJSValue& value) if (arrayIndex != UINT_MAX) o->putIndexed(arrayIndex, v); else - o->put(engine->id_uintMax.getPointer(), v); + o->put(engine->id_uintMax, v); if (d->engine->hasException) d->engine->catchException(); } @@ -1014,7 +1014,7 @@ bool QJSValue::deleteProperty(const QString &name) return false; ScopedString s(scope, engine->newString(name)); - bool b = o->deleteProperty(s.getPointer()); + bool b = o->deleteProperty(s); if (d->engine->hasException) d->engine->catchException(); return b; @@ -1038,7 +1038,7 @@ bool QJSValue::hasProperty(const QString &name) const return false; ScopedString s(scope, engine->newIdentifier(name)); - return o->hasProperty(s.getPointer()); + return o->hasProperty(s); } /*! @@ -1059,7 +1059,7 @@ bool QJSValue::hasOwnProperty(const QString &name) const return false; ScopedString s(scope, engine->newIdentifier(name)); - return o->hasOwnProperty(s.getPointer()); + return o->hasOwnProperty(s); } /*! diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 69cfcdf07a..f6e676de2c 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -121,7 +121,7 @@ ReturnedValue ArrayPrototype::method_toString(CallContext *ctx) if (ctx->d()->engine->hasException) return Encode::undefined(); ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("join"))); - ScopedFunctionObject f(scope, o->get(s.getPointer())); + ScopedFunctionObject f(scope, o->get(s)); if (!!f) { ScopedCallData d(scope, 0); d->thisObject = ctx->d()->callData->thisObject; @@ -145,7 +145,7 @@ ReturnedValue ArrayPrototype::method_concat(CallContext *ctx) return Encode::undefined(); ScopedArrayObject instance(scope, thisObject); if (instance) { - result->copyArrayData(instance.getPointer()); + result->copyArrayData(instance); } else { result->arraySet(0, thisObject); } @@ -158,7 +158,7 @@ ReturnedValue ArrayPrototype::method_concat(CallContext *ctx) elt = ctx->d()->callData->args[i]; if (elt) { uint n = elt->getLength(); - uint newLen = ArrayData::append(result.getPointer(), elt.getPointer(), n); + uint newLen = ArrayData::append(result, elt, n); result->setArrayLengthUnchecked(newLen); } else if (eltAsObj && eltAsObj->isListType()) { const uint startIndex = result->getLength(); @@ -212,7 +212,7 @@ ReturnedValue ArrayPrototype::method_join(CallContext *ctx) // crazy! // ScopedString name(scope, ctx->d()->engine->newString(QStringLiteral("0"))); - ScopedValue r6(scope, self->get(name.getPointer())); + ScopedValue r6(scope, self->get(name)); if (!r6->isNullOrUndefined()) R = r6->toQString(); @@ -221,7 +221,7 @@ ReturnedValue ArrayPrototype::method_join(CallContext *ctx) R += r4; name = Primitive::fromDouble(k).toString(scope.engine); - r12 = self->get(name.getPointer()); + r12 = self->get(name); if (scope.hasException()) return Encode::undefined(); @@ -279,7 +279,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx) ScopedString s(scope); for (int i = 0; i < ctx->d()->callData->argc; ++i) { s = Primitive::fromDouble(l + i).toString(scope.engine); - instance->put(s.getPointer(), ctx->d()->callData->args[i]); + instance->put(s, ctx->d()->callData->args[i]); } double newLen = l + ctx->d()->callData->argc; if (!instance->isArrayObject()) @@ -294,7 +294,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx) if (!ctx->d()->callData->argc) ; else if (!instance->protoHasArray() && instance->arrayData()->length() <= len && instance->arrayData()->type == Heap::ArrayData::Simple) { - instance->arrayData()->vtable()->putArray(instance.getPointer(), len, ctx->d()->callData->args, ctx->d()->callData->argc); + instance->arrayData()->vtable()->putArray(instance, len, ctx->d()->callData->args, ctx->d()->callData->argc); len = instance->arrayData()->length(); } else { for (int i = 0; i < ctx->d()->callData->argc; ++i) @@ -362,7 +362,7 @@ ReturnedValue ArrayPrototype::method_shift(CallContext *ctx) ScopedValue result(scope); if (!instance->protoHasArray() && !instance->arrayData()->attrs && instance->arrayData()->length() <= len && instance->arrayData()->type != Heap::ArrayData::Custom) { - result = instance->arrayData()->vtable()->pop_front(instance.getPointer()); + result = instance->arrayData()->vtable()->pop_front(instance); } else { result = instance->getIndexed(0); if (scope.hasException()) @@ -543,7 +543,7 @@ ReturnedValue ArrayPrototype::method_unshift(CallContext *ctx) if (!instance->protoHasArray() && !instance->arrayData()->attrs && instance->arrayData()->length() <= len && instance->arrayData()->type != Heap::ArrayData::Custom) { - instance->arrayData()->vtable()->push_front(instance.getPointer(), ctx->d()->callData->args, ctx->d()->callData->argc); + instance->arrayData()->vtable()->push_front(instance, ctx->d()->callData->args, ctx->d()->callData->argc); } else { ScopedValue v(scope); for (uint k = len; k > 0; --k) { diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 5b993ab2f8..3c36612222 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -110,10 +110,10 @@ void ExecutionContext::createMutableBinding(String *name, bool deletable) Scoped ctx(scope, this); while (ctx) { if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - CallContext *c = static_cast(ctx.getPointer()); - if (!c->d()->activation) - c->d()->activation = d()->engine->newObject(); - activation = c->d()->activation; + Heap::CallContext *c = static_cast(ctx->d()); + if (!c->activation) + c->activation = scope.engine->newObject(); + activation = c->activation; break; } ctx = ctx->d()->outer; @@ -212,27 +212,27 @@ bool ExecutionContext::deleteProperty(String *name) for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { hasWith = true; - ScopedObject withObject(scope, static_cast(ctx.getPointer())->d()->withObject); + ScopedObject withObject(scope, static_cast(ctx->d())->withObject); if (withObject->hasProperty(name)) return withObject->deleteProperty(name); } else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext) { - CatchContext *c = static_cast(ctx.getPointer()); - if (c->d()->exceptionVarName->isEqualTo(name)) + Heap::CatchContext *c = static_cast(ctx->d()); + if (c->exceptionVarName->isEqualTo(name)) return false; } else if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - CallContext *c = static_cast(ctx.getPointer()); - ScopedFunctionObject f(scope, c->d()->function); + Heap::CallContext *c = static_cast(ctx->d()); + ScopedFunctionObject f(scope, c->function); if (f->needsActivation() || hasWith) { uint index = f->function()->internalClass->find(name); if (index < UINT_MAX) // ### throw in strict mode? return false; } - ScopedObject activation(scope, c->d()->activation); + ScopedObject activation(scope, c->activation); if (activation && activation->hasProperty(name)) return activation->deleteProperty(name); } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - ScopedObject global(scope, static_cast(ctx.getPointer())->d()->global); + ScopedObject global(scope, static_cast(ctx->d())->global); if (global->hasProperty(name)) return global->deleteProperty(name); } @@ -287,33 +287,33 @@ void ExecutionContext::setProperty(String *name, const ValueRef value) Scoped ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { - ScopedObject w(scope, static_cast(ctx.getPointer())->d()->withObject); + ScopedObject w(scope, static_cast(ctx->d())->withObject); if (w->hasProperty(name)) { w->put(name, value); return; } - } else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext && static_cast(ctx.getPointer())->d()->exceptionVarName->isEqualTo(name)) { - static_cast(ctx.getPointer())->d()->exceptionValue = *value; + } else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext && static_cast(ctx->d())->exceptionVarName->isEqualTo(name)) { + static_cast(ctx->d())->exceptionValue = *value; return; } else { ScopedObject activation(scope, (Object *)0); if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - CallContext *c = static_cast(ctx.getPointer()); - if (c->d()->function->function) { - uint index = c->d()->function->function->internalClass->find(name); + Heap::CallContext *c = static_cast(ctx->d()); + if (c->function->function) { + uint index = c->function->function->internalClass->find(name); if (index < UINT_MAX) { - if (index < c->d()->function->formalParameterCount()) { - c->d()->callData->args[c->d()->function->formalParameterCount() - index - 1] = *value; + if (index < c->function->formalParameterCount()) { + c->callData->args[c->function->formalParameterCount() - index - 1] = *value; } else { - index -= c->d()->function->formalParameterCount(); - c->d()->locals[index] = *value; + index -= c->function->formalParameterCount(); + c->locals[index] = *value; } return; } } - activation = c->d()->activation; + activation = c->activation; } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - activation = static_cast(ctx.getPointer())->d()->global; + activation = static_cast(ctx->d())->global; } if (activation) { @@ -330,7 +330,7 @@ void ExecutionContext::setProperty(String *name, const ValueRef value) } } } - if (d()->strictMode || name->equals(d()->engine->id_this.getPointer())) { + if (d()->strictMode || name->equals(d()->engine->id_this)) { ScopedValue n(scope, name->asReturnedValue()); engine()->throwReferenceError(n); return; @@ -344,7 +344,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) ScopedValue v(scope); name->makeIdentifier(); - if (name->equals(d()->engine->id_this.getPointer())) + if (name->equals(d()->engine->id_this)) return d()->callData->thisObject.asReturnedValue(); bool hasWith = false; @@ -352,7 +352,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) Scoped ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { - ScopedObject w(scope, static_cast(ctx.getPointer())->d()->withObject); + ScopedObject w(scope, static_cast(ctx->d())->withObject); hasWith = true; bool hasProperty = false; v = w->get(name, &hasProperty); @@ -364,23 +364,23 @@ ReturnedValue ExecutionContext::getProperty(String *name) else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext) { hasCatchScope = true; - CatchContext *c = static_cast(ctx.getPointer()); - if (c->d()->exceptionVarName->isEqualTo(name)) - return c->d()->exceptionValue.asReturnedValue(); + Heap::CatchContext *c = static_cast(ctx->d()); + if (c->exceptionVarName->isEqualTo(name)) + return c->exceptionValue.asReturnedValue(); } else if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - QV4::CallContext *c = static_cast(ctx.getPointer()); - ScopedFunctionObject f(scope, c->d()->function); + Heap::CallContext *c = static_cast(ctx->d()); + ScopedFunctionObject f(scope, c->function); if (f->function() && (f->needsActivation() || hasWith || hasCatchScope)) { uint index = f->function()->internalClass->find(name); if (index < UINT_MAX) { - if (index < c->d()->function->formalParameterCount()) - return c->d()->callData->args[c->d()->function->formalParameterCount() - index - 1].asReturnedValue(); - return c->d()->locals[index - c->d()->function->formalParameterCount()].asReturnedValue(); + if (index < c->function->formalParameterCount()) + return c->callData->args[c->function->formalParameterCount() - index - 1].asReturnedValue(); + return c->locals[index - c->function->formalParameterCount()].asReturnedValue(); } } - ScopedObject activation(scope, c->d()->activation); + ScopedObject activation(scope, c->activation); if (activation) { bool hasProperty = false; v = activation->get(name, &hasProperty); @@ -393,7 +393,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - ScopedObject global(scope, static_cast(ctx.getPointer())->d()->global); + ScopedObject global(scope, static_cast(ctx->d())->global); bool hasProperty = false; v = global->get(name, &hasProperty); if (hasProperty) @@ -411,7 +411,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) base = (Object *)0; name->makeIdentifier(); - if (name->equals(d()->engine->id_this.getPointer())) + if (name->equals(d()->engine->id_this)) return d()->callData->thisObject.asReturnedValue(); bool hasWith = false; @@ -419,7 +419,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) Scoped ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { - ScopedObject w(scope, static_cast(ctx.getPointer())->d()->withObject); + ScopedObject w(scope, static_cast(ctx->d())->withObject); hasWith = true; bool hasProperty = false; v = w->get(name, &hasProperty); @@ -432,23 +432,23 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext) { hasCatchScope = true; - CatchContext *c = static_cast(ctx.getPointer()); - if (c->d()->exceptionVarName->isEqualTo(name)) - return c->d()->exceptionValue.asReturnedValue(); + Heap::CatchContext *c = static_cast(ctx->d()); + if (c->exceptionVarName->isEqualTo(name)) + return c->exceptionValue.asReturnedValue(); } else if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - QV4::CallContext *c = static_cast(ctx.getPointer()); - ScopedFunctionObject f(scope, c->d()->function); + Heap::CallContext *c = static_cast(ctx->d()); + ScopedFunctionObject f(scope, c->function); if (f->function() && (f->needsActivation() || hasWith || hasCatchScope)) { uint index = f->function()->internalClass->find(name); if (index < UINT_MAX) { if (index < f->formalParameterCount()) - return c->d()->callData->args[f->formalParameterCount() - index - 1].asReturnedValue(); - return c->d()->locals[index - f->formalParameterCount()].asReturnedValue(); + return c->callData->args[f->formalParameterCount() - index - 1].asReturnedValue(); + return c->locals[index - f->formalParameterCount()].asReturnedValue(); } } - ScopedObject activation(scope, c->d()->activation); + ScopedObject activation(scope, c->activation); if (activation) { bool hasProperty = false; v = activation->get(name, &hasProperty); @@ -460,11 +460,11 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) } if (f->function() && f->function()->isNamedExpression() && name->equals(ScopedString(scope, f->function()->name()))) - return c->d()->function->asReturnedValue(); + return c->function->asReturnedValue(); } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - ScopedObject global(scope, static_cast(ctx.getPointer())->d()->global); + ScopedObject global(scope, static_cast(ctx->d())->global); bool hasProperty = false; v = global->get(name, &hasProperty); if (hasProperty) diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 7fc9855f98..7f79de3035 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -1299,7 +1299,7 @@ ReturnedValue DatePrototype::method_toJSON(CallContext *ctx) return Encode::null(); ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("toISOString"))); - ScopedValue v(scope, O->objectValue()->get(s.getPointer())); + ScopedValue v(scope, O->objectValue()->get(s)); FunctionObject *toIso = v->asFunctionObject(); if (!toIso) diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 3d645404d3..11d9800c83 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -451,7 +451,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) globalObject()->defineDefaultProperty(QStringLiteral("unescape"), GlobalFunctions::method_unescape, 1); Scoped name(scope, newString(QStringLiteral("thrower"))); - thrower = ScopedFunctionObject(scope, BuiltinFunction::create(global, name.getPointer(), ::throwTypeError)).getPointer(); + thrower = ScopedFunctionObject(scope, BuiltinFunction::create(global, name, ::throwTypeError)); } ExecutionEngine::~ExecutionEngine() @@ -1140,7 +1140,7 @@ QQmlError ExecutionEngine::catchExceptionAsQmlError() QV4::Scoped errorObj(scope, exception); if (!!errorObj && errorObj->asSyntaxError()) { QV4::ScopedString m(scope, newString(QStringLiteral("message"))); - QV4::ScopedValue v(scope, errorObj->get(m.getPointer())); + QV4::ScopedValue v(scope, errorObj->get(m)); error.setDescription(v->toQStringNoThrow()); } else error.setDescription(exception->toQStringNoThrow()); diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp index b1c83a075a..849c560024 100644 --- a/src/qml/jsruntime/qv4errorobject.cpp +++ b/src/qml/jsruntime/qv4errorobject.cpp @@ -375,7 +375,7 @@ ReturnedValue ErrorPrototype::method_toString(CallContext *ctx) qname = name->toQString(); ScopedString s(scope, ctx->d()->engine->newString(QString::fromLatin1("message"))); - ScopedValue message(scope, o->get(s.getPointer())); + ScopedValue message(scope, o->get(s)); QString qmessage; if (!message->isUndefined()) qmessage = message->toQString(); diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 822184042c..e7610cfb59 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -88,7 +88,7 @@ Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const QString Scope s(scope->engine()); ScopedFunctionObject f(s, this); ScopedString n(s, s.engine->newString(name)); - f->init(n.getPointer(), createProto); + f->init(n, createProto); } Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const QString &name, bool createProto) @@ -98,7 +98,7 @@ Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const QString &nam Scope s(scope->engine); ScopedFunctionObject f(s, this); ScopedString n(s, s.engine->newString(name)); - f->init(n.getPointer(), createProto); + f->init(n, createProto); } Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const ReturnedValue name) @@ -108,7 +108,7 @@ Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const Returne Scope s(scope); ScopedFunctionObject f(s, this); ScopedString n(s, name); - f->init(n.getPointer(), false); + f->init(n, false); } Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValue name) @@ -118,7 +118,7 @@ Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValu Scope s(scope->engine); ScopedFunctionObject f(s, this); ScopedString n(s, name); - f->init(n.getPointer(), false); + f->init(n, false); } Heap::FunctionObject::FunctionObject(InternalClass *ic, QV4::Object *prototype) @@ -402,7 +402,7 @@ ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData) ScopedContext context(scope, v4->currentContext()); callData->thisObject = obj.asReturnedValue(); - Scoped ctx(scope, context->newCallContext(f.getPointer(), callData)); + Scoped ctx(scope, context->newCallContext(f, callData)); ExecutionContextSaver ctxSaver(scope, context); ScopedValue result(scope, Q_V4_PROFILE(v4, f->function())); @@ -490,7 +490,7 @@ ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData) CallContext::Data ctx(v4); ctx.strictMode = f->strictMode(); ctx.callData = callData; - ctx.function = f.getPointer()->d(); + ctx.function = f->d(); ctx.compilationUnit = f->function()->compilationUnit; ctx.lookups = ctx.compilationUnit->runtimeLookups; ctx.outer = f->scope(); diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index bf2662dd34..bdd2136851 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -81,11 +81,11 @@ QV4::ReturnedValue QV4Include::resultValue(QV4::ExecutionEngine *v4, Status stat QV4::ScopedObject o(scope, v4->newObject()); QV4::ScopedString s(scope); QV4::ScopedValue v(scope); - o->put((s = v4->newString(QStringLiteral("OK"))).getPointer(), (v = QV4::Primitive::fromInt32(Ok))); - o->put((s = v4->newString(QStringLiteral("LOADING"))).getPointer(), (v = QV4::Primitive::fromInt32(Loading))); - o->put((s = v4->newString(QStringLiteral("NETWORK_ERROR"))).getPointer(), (v = QV4::Primitive::fromInt32(NetworkError))); - o->put((s = v4->newString(QStringLiteral("EXCEPTION"))).getPointer(), (v = QV4::Primitive::fromInt32(Exception))); - o->put((s = v4->newString(QStringLiteral("status"))).getPointer(), (v = QV4::Primitive::fromInt32(status))); + o->put((s = v4->newString(QStringLiteral("OK"))), (v = QV4::Primitive::fromInt32(Ok))); + o->put((s = v4->newString(QStringLiteral("LOADING"))), (v = QV4::Primitive::fromInt32(Loading))); + o->put((s = v4->newString(QStringLiteral("NETWORK_ERROR"))), (v = QV4::Primitive::fromInt32(NetworkError))); + o->put((s = v4->newString(QStringLiteral("EXCEPTION"))), (v = QV4::Primitive::fromInt32(Exception))); + o->put((s = v4->newString(QStringLiteral("status"))), (v = QV4::Primitive::fromInt32(status))); return o.asReturnedValue(); } @@ -150,14 +150,14 @@ void QV4Include::finished() script.run(); if (scope.engine->hasException) { QV4::ScopedValue ex(scope, scope.engine->catchException()); - resultObj->put(status.getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Exception))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Exception))); QV4::ScopedString exception(scope, v4->newString(QStringLiteral("exception"))); - resultObj->put(exception.getPointer(), ex); + resultObj->put(exception, ex); } else { - resultObj->put(status.getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Ok))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Ok))); } } else { - resultObj->put(status.getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(NetworkError))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(NetworkError))); } QV4::ScopedValue cb(scope, m_callbackFunction.value()); @@ -225,7 +225,7 @@ QV4::ReturnedValue QV4Include::method_include(QV4::CallContext *ctx) QV4::ScopedValue ex(scope, scope.engine->catchException()); result = resultValue(scope.engine, Exception); QV4::ScopedString exception(scope, scope.engine->newString(QStringLiteral("exception"))); - result->asObject()->put(exception.getPointer(), ex); + result->asObject()->put(exception, ex); } else { result = resultValue(scope.engine, Ok); } diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 8bcb2e4708..6b38c79d55 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -284,7 +284,7 @@ bool JsonParser::parseMember(Object *o) if (idx < UINT_MAX) { o->putIndexed(idx, val); } else { - o->insertMember(s.getPointer(), val); + o->insertMember(s, val); } END; @@ -705,7 +705,7 @@ QString Stringify::Str(const QString &key, ValueRef v) ScopedObject o(scope, value); if (o) { ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("toJSON"))); - Scoped toJSON(scope, o->get(s.getPointer())); + Scoped toJSON(scope, o->get(s)); if (!!toJSON) { ScopedCallData callData(scope, 1); callData->thisObject = value; @@ -808,7 +808,7 @@ QString Stringify::JO(Object *o) for (int i = 0; i < propertyList.size(); ++i) { bool exists; s = propertyList.at(i); - ScopedValue v(scope, o->get(s.getPointer(), &exists)); + ScopedValue v(scope, o->get(s, &exists)); if (!exists) continue; QString member = makeMember(s->toQString(), v); @@ -1002,7 +1002,7 @@ QV4::ReturnedValue JsonObject::fromJsonObject(ExecutionEngine *engine, const QJs ScopedValue v(scope); for (QJsonObject::const_iterator it = object.begin(); it != object.end(); ++it) { v = fromJsonValue(engine, it.value()); - o->put((s = engine->newString(it.key())).getPointer(), v); + o->put((s = engine->newString(it.key())), v); } return o.asReturnedValue(); } diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index 9febcaab69..dead79a939 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -155,7 +155,7 @@ ReturnedValue Lookup::indexedGetterFallback(Lookup *l, const ValueRef object, co ScopedString name(scope, index->toString(scope.engine)); if (scope.hasException()) return Encode::undefined(); - return o->get(name.getPointer()); + return o->get(name); } @@ -211,7 +211,7 @@ void Lookup::indexedSetterFallback(Lookup *l, const ValueRef object, const Value } ScopedString name(scope, index->toString(scope.engine)); - o->put(name.getPointer(), value); + o->put(name, value); } void Lookup::indexedSetterObjectInt(Lookup *l, const ValueRef object, const ValueRef index, const ValueRef v) @@ -251,7 +251,7 @@ ReturnedValue Lookup::getterGeneric(Lookup *l, ExecutionEngine *engine, const Va proto = engine->stringPrototype.asObject(); Scope scope(engine); ScopedString name(scope, engine->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]); - if (name->equals(engine->id_length.getPointer())) { + if (name->equals(engine->id_length)) { // special case, as the property is on the object itself l->getter = stringLengthGetter; return stringLengthGetter(l, engine, object); diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 0e3ea50186..7e913361bf 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -77,7 +77,7 @@ void Object::put(ExecutionEngine *engine, const QString &name, const ValueRef va { Scope scope(engine); ScopedString n(scope, engine->newString(name)); - put(n.getPointer(), value); + put(n, value); } ReturnedValue Object::getValue(const ValueRef thisObject, const Property *p, PropertyAttributes attrs) @@ -127,7 +127,7 @@ void Object::defineDefaultProperty(const QString &name, ValueRef value) ExecutionEngine *e = engine(); Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); - defineDefaultProperty(s.getPointer(), value); + defineDefaultProperty(s, value); } void Object::defineDefaultProperty(const QString &name, ReturnedValue (*code)(CallContext *), int argumentCount) @@ -136,9 +136,9 @@ void Object::defineDefaultProperty(const QString &name, ReturnedValue (*code)(Ca Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); ScopedContext global(scope, e->rootContext()); - Scoped function(scope, BuiltinFunction::create(global, s.getPointer(), code)); + Scoped function(scope, BuiltinFunction::create(global, s, code)); function->defineReadonlyProperty(e->id_length, Primitive::fromInt32(argumentCount)); - defineDefaultProperty(s.getPointer(), function); + defineDefaultProperty(s, function); } void Object::defineDefaultProperty(String *name, ReturnedValue (*code)(CallContext *), int argumentCount) @@ -156,7 +156,7 @@ void Object::defineAccessorProperty(const QString &name, ReturnedValue (*getter) ExecutionEngine *e = engine(); Scope scope(e); Scoped s(scope, e->newIdentifier(name)); - defineAccessorProperty(s.getPointer(), getter, setter); + defineAccessorProperty(s, getter, setter); } void Object::defineAccessorProperty(String *name, ReturnedValue (*getter)(CallContext *), ReturnedValue (*setter)(CallContext *)) @@ -165,8 +165,8 @@ void Object::defineAccessorProperty(String *name, ReturnedValue (*getter)(CallCo QV4::Scope scope(v4); ScopedProperty p(scope); ScopedContext global(scope, scope.engine->rootContext()); - p->setGetter(getter ? ScopedFunctionObject(scope, BuiltinFunction::create(global, name, getter)).getPointer() : 0); - p->setSetter(setter ? ScopedFunctionObject(scope, BuiltinFunction::create(global, name, setter)).getPointer() : 0); + p->setGetter(ScopedFunctionObject(scope, (getter ? BuiltinFunction::create(global, name, getter) : 0))); + p->setSetter(ScopedFunctionObject(scope, (setter ? BuiltinFunction::create(global, name, setter) : 0))); insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); } @@ -175,7 +175,7 @@ void Object::defineReadonlyProperty(const QString &name, ValueRef value) QV4::ExecutionEngine *e = engine(); Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); - defineReadonlyProperty(s.getPointer(), value); + defineReadonlyProperty(s, value); } void Object::defineReadonlyProperty(String *name, ValueRef value) @@ -1058,7 +1058,7 @@ bool Object::__defineOwnProperty__(ExecutionEngine *engine, const QString &name, { Scope scope(engine); ScopedString s(scope, engine->newString(name)); - return __defineOwnProperty__(engine, s.getPointer(), p, attrs); + return __defineOwnProperty__(engine, s, p, attrs); } diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index e977c748fc..0a592bb7d7 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -64,7 +64,7 @@ ReturnedValue ObjectCtor::construct(Managed *that, CallData *callData) Scoped obj(scope, v4->newObject()); Scoped proto(scope, ctor->get(v4->id_prototype)); if (!!proto) - obj->setPrototype(proto.getPointer()); + obj->setPrototype(proto); return obj.asReturnedValue(); } return RuntimeHelpers::toObject(scope.engine, ValueRef(&callData->args[0])); @@ -109,8 +109,8 @@ void ObjectPrototype::init(ExecutionEngine *v4, Object *ctor) defineDefaultProperty(QStringLiteral("__defineSetter__"), method_defineSetter, 2); ScopedContext global(scope, scope.engine->rootContext()); - Property p(ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_get_proto)).getPointer(), - ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_set_proto)).getPointer()); + Property p(ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_get_proto)), + ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_set_proto))); insertMember(v4->id___proto__, p, Attr_Accessor|Attr_NotEnumerable); } @@ -132,7 +132,7 @@ ReturnedValue ObjectPrototype::method_getOwnPropertyDescriptor(CallContext *ctx) if (!O) return ctx->engine()->throwTypeError(); - if (ArgumentsObject::isNonStrictArgumentsObject(O.getPointer())) + if (ArgumentsObject::isNonStrictArgumentsObject(O)) Scoped(scope, O)->fullyCreate(); ScopedValue v(scope, ctx->argument(1)); @@ -140,7 +140,7 @@ ReturnedValue ObjectPrototype::method_getOwnPropertyDescriptor(CallContext *ctx) if (scope.hasException()) return Encode::undefined(); PropertyAttributes attrs; - Property *desc = O->__getOwnProperty__(name.getPointer(), &attrs); + Property *desc = O->__getOwnProperty__(name, &attrs); return fromPropertyDescriptor(scope.engine, desc, attrs); } @@ -191,7 +191,7 @@ ReturnedValue ObjectPrototype::method_defineProperty(CallContext *ctx) if (scope.engine->hasException) return Encode::undefined(); - if (!O->__defineOwnProperty__(scope.engine, name.getPointer(), pd, attrs)) + if (!O->__defineOwnProperty__(scope.engine, name, pd, attrs)) return ctx->engine()->throwTypeError(); return O.asReturnedValue(); @@ -226,7 +226,7 @@ ReturnedValue ObjectPrototype::method_defineProperties(CallContext *ctx) return Encode::undefined(); bool ok; if (name) - ok = O->__defineOwnProperty__(scope.engine, name.getPointer(), n, nattrs); + ok = O->__defineOwnProperty__(scope.engine, name, n, nattrs); else ok = O->__defineOwnProperty__(scope.engine, index, n, nattrs); if (!ok) @@ -248,7 +248,7 @@ ReturnedValue ObjectPrototype::method_seal(CallContext *ctx) o->setInternalClass(o->internalClass()->sealed()); if (o->arrayData()) { - ArrayData::ensureAttributes(o.getPointer()); + ArrayData::ensureAttributes(o); for (uint i = 0; i < o->d()->arrayData->alloc; ++i) { if (!o->arrayData()->isEmpty(i)) o->d()->arrayData->attrs[i].setConfigurable(false); @@ -265,7 +265,7 @@ ReturnedValue ObjectPrototype::method_freeze(CallContext *ctx) if (!o) return ctx->engine()->throwTypeError(); - if (ArgumentsObject::isNonStrictArgumentsObject(o.getPointer())) + if (ArgumentsObject::isNonStrictArgumentsObject(o)) Scoped(scope, o)->fullyCreate(); o->setExtensible(false); @@ -273,7 +273,7 @@ ReturnedValue ObjectPrototype::method_freeze(CallContext *ctx) o->setInternalClass(o->internalClass()->frozen()); if (o->arrayData()) { - ArrayData::ensureAttributes(o.getPointer()); + ArrayData::ensureAttributes(o); for (uint i = 0; i < o->arrayData()->alloc; ++i) { if (!o->arrayData()->isEmpty(i)) o->arrayData()->attrs[i].setConfigurable(false); @@ -430,9 +430,9 @@ ReturnedValue ObjectPrototype::method_hasOwnProperty(CallContext *ctx) Scoped O(scope, ctx->d()->callData->thisObject, Scoped::Convert); if (scope.engine->hasException) return Encode::undefined(); - bool r = O->hasOwnProperty(P.getPointer()); + bool r = O->hasOwnProperty(P); if (!r) - r = !O->query(P.getPointer()).isEmpty(); + r = !O->query(P).isEmpty(); return Encode(r); } @@ -466,7 +466,7 @@ ReturnedValue ObjectPrototype::method_propertyIsEnumerable(CallContext *ctx) if (scope.engine->hasException) return Encode::undefined(); PropertyAttributes attrs; - o->__getOwnProperty__(p.getPointer(), &attrs); + o->__getOwnProperty__(p, &attrs); return Encode(attrs.isEnumerable()); } @@ -494,7 +494,7 @@ ReturnedValue ObjectPrototype::method_defineGetter(CallContext *ctx) Property pd; pd.value = f; pd.set = Primitive::emptyValue(); - o->__defineOwnProperty__(scope.engine, prop.getPointer(), pd, Attr_Accessor); + o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); return Encode::undefined(); } @@ -522,7 +522,7 @@ ReturnedValue ObjectPrototype::method_defineSetter(CallContext *ctx) Property pd; pd.value = Primitive::emptyValue(); pd.set = f; - o->__defineOwnProperty__(scope.engine, prop.getPointer(), pd, Attr_Accessor); + o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); return Encode::undefined(); } @@ -554,7 +554,7 @@ ReturnedValue ObjectPrototype::method_set_proto(CallContext *ctx) if (o->prototype() == p->d()) { ok = true; } else if (o->isExtensible()) { - ok = o->setPrototype(p.getPointer()); + ok = o->setPrototype(p); } } if (!ok) @@ -645,24 +645,24 @@ ReturnedValue ObjectPrototype::fromPropertyDescriptor(ExecutionEngine *engine, c if (attrs.isData()) { pd.value = desc->value; s = engine->newString(QStringLiteral("value")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); pd.value = Primitive::fromBoolean(attrs.isWritable()); s = engine->newString(QStringLiteral("writable")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); } else { pd.value = desc->getter() ? desc->getter()->asReturnedValue() : Encode::undefined(); s = engine->newString(QStringLiteral("get")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); pd.value = desc->setter() ? desc->setter()->asReturnedValue() : Encode::undefined(); s = engine->newString(QStringLiteral("set")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); } pd.value = Primitive::fromBoolean(attrs.isEnumerable()); s = engine->newString(QStringLiteral("enumerable")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); pd.value = Primitive::fromBoolean(attrs.isConfigurable()); s = engine->newString(QStringLiteral("configurable")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); return o.asReturnedValue(); } diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 720d651291..daaa0c16f1 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -283,13 +283,13 @@ ReturnedValue QObjectWrapper::getQmlProperty(QQmlContextData *qmlContext, String } QQmlPropertyData local; - QQmlPropertyData *result = findProperty(scope.engine, qmlContext, name.getPointer(), revisionMode, &local); + QQmlPropertyData *result = findProperty(scope.engine, qmlContext, name, revisionMode, &local); if (!result) { if (includeImports && name->startsWithUpper()) { // Check for attached properties if (qmlContext && qmlContext->imports) { - QQmlTypeNameCache::Result r = qmlContext->imports->query(name.getPointer()); + QQmlTypeNameCache::Result r = qmlContext->imports->query(name); if (hasProperty) *hasProperty = true; @@ -308,7 +308,7 @@ ReturnedValue QObjectWrapper::getQmlProperty(QQmlContextData *qmlContext, String } } } - return QV4::Object::get(this, name.getPointer(), hasProperty); + return QV4::Object::get(this, name, hasProperty); } QQmlData *ddata = QQmlData::get(d()->object, false); @@ -348,8 +348,8 @@ ReturnedValue QObjectWrapper::getProperty(QObject *object, ExecutionContext *ctx QV4::ScopedString connect(scope, ctx->d()->engine->newIdentifier(QStringLiteral("connect"))); QV4::ScopedString disconnect(scope, ctx->d()->engine->newIdentifier(QStringLiteral("disconnect"))); - handler->put(connect.getPointer(), QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(connect.getPointer()))); - handler->put(disconnect.getPointer(), QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(disconnect.getPointer()))); + handler->put(connect, QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(connect))); + handler->put(disconnect, QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(disconnect))); return handler.asReturnedValue(); } else { @@ -618,7 +618,7 @@ ReturnedValue QObjectWrapper::wrap(ExecutionEngine *engine, QObject *object) alternateWrapper = create(engine, object); if (!engine->m_multiplyWrappedQObjects) engine->m_multiplyWrappedQObjects = new MultiplyWrappedQObjectMap; - engine->m_multiplyWrappedQObjects->insert(object, alternateWrapper.getPointer()); + engine->m_multiplyWrappedQObjects->insert(object, alternateWrapper); ddata->hasTaintedV8Object = true; } diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index 6a1d86522d..fcbf91c3b0 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -152,7 +152,7 @@ void RegExpObject::init(ExecutionEngine *engine) ScopedString lastIndex(scope, engine->newIdentifier(QStringLiteral("lastIndex"))); ScopedValue v(scope, Primitive::fromInt32(0)); - insertMember(lastIndex.getPointer(), v, Attr_NotEnumerable|Attr_NotConfigurable); + insertMember(lastIndex, v, Attr_NotEnumerable|Attr_NotConfigurable); if (!this->value()) return; @@ -211,7 +211,7 @@ QString RegExpObject::source() const { Scope scope(engine()); ScopedString source(scope, scope.engine->newIdentifier(QStringLiteral("source"))); - ScopedValue s(scope, const_cast(this)->get(source.getPointer())); + ScopedValue s(scope, const_cast(this)->get(source)); return s->toQString(); } diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index e1d8b19b65..c4c0fd416c 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -284,7 +284,7 @@ ReturnedValue Runtime::deleteElement(ExecutionEngine *engine, const ValueRef bas } ScopedString name(scope, index->toString(engine)); - return Runtime::deleteMemberString(engine, base, name.getPointer()); + return Runtime::deleteMemberString(engine, base, name); } ReturnedValue Runtime::deleteMember(ExecutionEngine *engine, const ValueRef base, int nameIndex) @@ -349,7 +349,7 @@ QV4::ReturnedValue Runtime::in(ExecutionEngine *engine, const ValueRef left, con ScopedString s(scope, left->toString(engine)); if (scope.hasException()) return Encode::undefined(); - bool r = right->objectValue()->hasProperty(s.getPointer()); + bool r = right->objectValue()->hasProperty(s); return Encode(r); } @@ -451,14 +451,14 @@ Heap::String *RuntimeHelpers::convertToString(ExecutionEngine *engine, const Val case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); case Value::Undefined_Type: - return engine->id_undefined.getPointer()->d(); + return engine->id_undefined->d(); case Value::Null_Type: - return engine->id_null.getPointer()->d(); + return engine->id_null->d(); case Value::Boolean_Type: if (value->booleanValue()) - return engine->id_true.getPointer()->d(); + return engine->id_true->d(); else - return engine->id_false.getPointer()->d(); + return engine->id_false->d(); case Value::Managed_Type: if (value->isString()) return value->stringValue()->d(); @@ -482,14 +482,14 @@ static Heap::String *convert_to_string_add(ExecutionEngine *engine, const ValueR case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); case Value::Undefined_Type: - return engine->id_undefined.getPointer()->d(); + return engine->id_undefined->d(); case Value::Null_Type: - return engine->id_null.getPointer()->d(); + return engine->id_null->d(); case Value::Boolean_Type: if (value->booleanValue()) - return engine->id_true.getPointer()->d(); + return engine->id_true->d(); else - return engine->id_false.getPointer()->d(); + return engine->id_false->d(); case Value::Managed_Type: if (value->isString()) return value->stringValue()->d(); @@ -608,7 +608,7 @@ ReturnedValue Runtime::getElement(ExecutionEngine *engine, const ValueRef object ScopedString name(scope, index->toString(engine)); if (scope.hasException()) return Encode::undefined(); - return o->get(name.getPointer()); + return o->get(name); } void Runtime::setElement(ExecutionEngine *engine, const ValueRef object, const ValueRef index, const ValueRef value) @@ -632,7 +632,7 @@ void Runtime::setElement(ExecutionEngine *engine, const ValueRef object, const V } ScopedString name(scope, index->toString(engine)); - o->put(name.getPointer(), value); + o->put(name, value); } ReturnedValue Runtime::foreachIterator(ExecutionEngine *engine, const ValueRef in) @@ -998,7 +998,7 @@ ReturnedValue Runtime::callElement(ExecutionEngine *engine, const ValueRef index return Encode::undefined(); callData->thisObject = baseObject; - ScopedObject o(scope, baseObject->get(s.getPointer())); + ScopedObject o(scope, baseObject->get(s)); if (!o) return engine->throwTypeError(); @@ -1144,7 +1144,7 @@ QV4::ReturnedValue Runtime::typeofElement(ExecutionEngine *engine, const ValueRe ScopedObject obj(scope, base->toObject(engine)); if (scope.engine->hasException) return Encode::undefined(); - ScopedValue prop(scope, obj->get(name.getPointer())); + ScopedValue prop(scope, obj->get(name)); return Runtime::typeofValue(engine, prop); } diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index d125f04109..088e9616ce 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -185,7 +185,7 @@ Heap::FunctionObject *QmlBindingWrapper::createQmlCallableForFunction(QQmlContex p->setGetter(g); p->setSetter(0); s = engine->newString(QString::fromUtf8(param)); - qmlScopeObject->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); + qmlScopeObject->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); } } diff --git a/src/qml/jsruntime/qv4serialize.cpp b/src/qml/jsruntime/qv4serialize.cpp index 5eb3e81b51..0ca1b45386 100644 --- a/src/qml/jsruntime/qv4serialize.cpp +++ b/src/qml/jsruntime/qv4serialize.cpp @@ -272,7 +272,7 @@ void Serialize::serialize(QByteArray &data, const QV4::ValueRef v, QV8Engine *en serialize(data, s, engine); str = s; - val = o->get(str.getPointer()); + val = o->get(str); if (scope.hasException()) scope.engine->catchException(); @@ -333,7 +333,7 @@ ReturnedValue Serialize::deserialize(const char *&data, QV8Engine *engine) name = deserialize(data, engine); value = deserialize(data, engine); n = name.asReturnedValue(); - o->put(n.getPointer(), value); + o->put(n, value); } return o.asReturnedValue(); } @@ -363,7 +363,7 @@ ReturnedValue Serialize::deserialize(const char *&data, QV8Engine *engine) QVariant var = qVariantFromValue(ref); QV4::ScopedValue v(scope, engine->fromVariant((var))); QV4::ScopedString s(scope, v4->newString(QStringLiteral("__qml:hidden:ref"))); - rv->asObject()->defineReadonlyProperty(s.getPointer(), v); + rv->asObject()->defineReadonlyProperty(s, v); agent->release(); agent->setV8Engine(engine); diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index e148782d4c..3e30cbcae8 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -387,7 +387,7 @@ ReturnedValue StringPrototype::method_match(CallContext *context) // ### use the standard builtin function, not the one that might be redefined in the proto ScopedString execString(scope, scope.engine->newString(QStringLiteral("exec"))); - Scoped exec(scope, scope.engine->regExpPrototype.asObject()->get(execString.getPointer())); + Scoped exec(scope, scope.engine->regExpPrototype.asObject()->get(execString)); ScopedCallData callData(scope, 1); callData->thisObject = rx; @@ -396,7 +396,7 @@ ReturnedValue StringPrototype::method_match(CallContext *context) return exec->call(callData); ScopedString lastIndex(scope, context->d()->engine->newString(QStringLiteral("lastIndex"))); - rx->put(lastIndex.getPointer(), ScopedValue(scope, Primitive::fromInt32(0))); + rx->put(lastIndex, ScopedValue(scope, Primitive::fromInt32(0))); Scoped a(scope, context->d()->engine->newArrayObject()); double previousLastIndex = 0; @@ -409,11 +409,11 @@ ReturnedValue StringPrototype::method_match(CallContext *context) if (result->isNull()) break; assert(result->isObject()); - index = rx->get(lastIndex.getPointer(), 0); + index = rx->get(lastIndex, 0); double thisIndex = index->toInteger(); if (previousLastIndex == thisIndex) { previousLastIndex = thisIndex + 1; - rx->put(lastIndex.getPointer(), ScopedValue(scope, Primitive::fromDouble(previousLastIndex))); + rx->put(lastIndex, ScopedValue(scope, Primitive::fromDouble(previousLastIndex))); } else { previousLastIndex = thisIndex; } diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 7babcd2f4e..9589ec63cb 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -172,7 +172,7 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags) Q_ASSERT(f); if (f->bindingKeyFlag()) { Q_ASSERT(f->as()); - QQmlSourceLocation loc = static_cast(f.getPointer())->d()->bindingLocation; + QQmlSourceLocation loc = static_cast(f->d())->bindingLocation; url = loc.sourceFile; lineNumber = loc.line; columnNumber = loc.column; diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 395d33f3c1..7f794e6863 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1365,7 +1365,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args) QV4::Scoped r(scope, v4->memoryManager->alloc(args->engine(), mode)); QV4::ScopedObject p(scope, e->incubationProto.value()); - r->setPrototype(p.getPointer()); + r->setPrototype(p); if (!valuemap->isUndefined()) { r->d()->valuemap = valuemap; @@ -1373,7 +1373,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args) } r->d()->parent = parent; - QQmlIncubator *incubator = r.getPointer()->d()->incubator.data(); + QQmlIncubator *incubator = r->d()->incubator.data(); create(*incubator, creationContext()); if (incubator->status() == QQmlIncubator::Null) { diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index a5c1f67532..8d6cc662cb 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -399,7 +399,7 @@ ReturnedValue QmlContextWrapper::idObjectsArray() ExecutionEngine *v4 = engine(); Scope scope(v4); Scoped a(scope, v4->memoryManager->alloc(v4, this)); - d()->idObjectsWrapper = a.getPointer(); + d()->idObjectsWrapper = a; } return d()->idObjectsWrapper->asReturnedValue(); } diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 592318e561..bc7b651c93 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -811,7 +811,7 @@ QV4::ReturnedValue QQmlLocale::wrap(QV8Engine *engine, const QLocale &locale) QV4::Scoped wrapper(scope, v4->memoryManager->alloc(v4)); wrapper->d()->locale = locale; QV4::ScopedObject p(scope, d->prototype.value()); - wrapper->setPrototype(p.getPointer()); + wrapper->setPrototype(p); return wrapper.asReturnedValue(); } diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index be38b86d75..c58a5494f2 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -268,7 +268,7 @@ bool QQmlObjectCreator::populateDeferredProperties(QObject *instance) QV4::ScopedContext global(valueScope, valueScope.engine->rootContext()); QV4::Scoped qmlBindingWrapper(valueScope, v4->memoryManager->alloc(global, qmlScope)); // ### GC - QV4::ExecutionContext *qmlContext = QV4::ScopedContext(valueScope, qmlBindingWrapper->context()).getPointer(); + QV4::ExecutionContext *qmlContext = QV4::ScopedContext(valueScope, qmlBindingWrapper->context()); qSwap(_qmlContext, qmlContext); @@ -1180,7 +1180,7 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo QV4::ScopedContext global(valueScope, valueScope.engine->rootContext()); QV4::Scoped qmlBindingWrapper(valueScope, v4->memoryManager->alloc(global, qmlScope)); // ### GC - QV4::ExecutionContext *qmlContext = QV4::ScopedContext(valueScope, qmlBindingWrapper->context()).getPointer(); + QV4::ExecutionContext *qmlContext = QV4::ScopedContext(valueScope, qmlBindingWrapper->context()); qSwap(_qmlContext, qmlContext); diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index dba60047e6..a98bad636a 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -144,7 +144,7 @@ void QmlValueTypeWrapper::initProto(ExecutionEngine *v4) Scope scope(v4); Scoped o(scope, v4->newObject()); o->defineDefaultProperty(v4->id_toString, method_toString, 1); - v4->qmlExtensions()->valueTypeWrapperPrototype = o.getPointer(); + v4->qmlExtensions()->valueTypeWrapperPrototype = o; } ReturnedValue QmlValueTypeWrapper::create(QV8Engine *v8, QObject *object, int property, QQmlValueType *type) @@ -347,7 +347,7 @@ void QmlValueTypeWrapper::put(Managed *m, String *name, const ValueRef value) QByteArray propName = name->toQString().toUtf8(); if (r->d()->objectType == Heap::QmlValueTypeWrapper::Reference) { - QmlValueTypeReference *reference = static_cast(r.getPointer()); + Scoped reference(scope, static_cast(r->d())); QMetaProperty writebackProperty = reference->d()->object->metaObject()->property(reference->d()->property); if (!reference->d()->object || !writebackProperty.isWritable() || !readReferenceValue(reference)) @@ -413,7 +413,7 @@ void QmlValueTypeWrapper::put(Managed *m, String *name, const ValueRef value) } else { Q_ASSERT(r->d()->objectType == Heap::QmlValueTypeWrapper::Copy); - QmlValueTypeCopy *copy = static_cast(r.getPointer()); + Scoped copy(scope, static_cast(r->d())); int index = r->d()->type->metaObject()->indexOfProperty(propName.constData()); if (index == -1) diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index a19376db68..517f5a8b59 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -98,9 +98,9 @@ static ReturnedValue constructMeObject(const ValueRef thisObj, QV8Engine *e) ExecutionEngine *v4 = QV8Engine::getV4(e); Scope scope(v4); Scoped meObj(scope, v4->newObject()); - meObj->put(ScopedString(scope, v4->newString(QStringLiteral("ThisObject"))).getPointer(), thisObj); + meObj->put(ScopedString(scope, v4->newString(QStringLiteral("ThisObject"))), thisObj); ScopedValue v(scope, QmlContextWrapper::qmlScope(e, e->callingContext(), 0)); - meObj->put(ScopedString(scope, v4->newString(QStringLiteral("ActivationObject"))).getPointer(), v); + meObj->put(ScopedString(scope, v4->newString(QStringLiteral("ActivationObject"))), v); return meObj.asReturnedValue(); } @@ -620,7 +620,7 @@ ReturnedValue Node::create(QV8Engine *engine, NodeImpl *data) switch (data->type) { case NodeImpl::Attr: - instance->setPrototype((p = Attr::prototype(v4)).getPointer()); + instance->setPrototype((p = Attr::prototype(v4))); break; case NodeImpl::Comment: case NodeImpl::Document: @@ -632,13 +632,13 @@ ReturnedValue Node::create(QV8Engine *engine, NodeImpl *data) case NodeImpl::ProcessingInstruction: return Encode::undefined(); case NodeImpl::CDATA: - instance->setPrototype((p = CDATA::prototype(v4)).getPointer()); + instance->setPrototype((p = CDATA::prototype(v4))); break; case NodeImpl::Text: - instance->setPrototype((p = Text::prototype(v4)).getPointer()); + instance->setPrototype((p = Text::prototype(v4))); break; case NodeImpl::Element: - instance->setPrototype((p = Element::prototype(v4)).getPointer()); + instance->setPrototype((p = Element::prototype(v4))); break; } @@ -652,7 +652,7 @@ ReturnedValue Element::prototype(ExecutionEngine *engine) Scope scope(engine); ScopedObject p(scope, engine->newObject()); ScopedObject pp(scope); - p->setPrototype((pp = NodePrototype::getProto(engine)).getPointer()); + p->setPrototype((pp = NodePrototype::getProto(engine))); p->defineAccessorProperty(QStringLiteral("tagName"), NodePrototype::method_get_nodeName, 0); d->elementPrototype = p; engine->v8Engine->freezeObject(p); @@ -667,7 +667,7 @@ ReturnedValue Attr::prototype(ExecutionEngine *engine) Scope scope(engine); Scoped p(scope, engine->newObject()); ScopedObject pp(scope); - p->setPrototype((pp = NodePrototype::getProto(engine)).getPointer()); + p->setPrototype((pp = NodePrototype::getProto(engine))); p->defineAccessorProperty(QStringLiteral("name"), method_name, 0); p->defineAccessorProperty(QStringLiteral("value"), method_value, 0); p->defineAccessorProperty(QStringLiteral("ownerElement"), method_ownerElement, 0); @@ -728,7 +728,7 @@ ReturnedValue CharacterData::prototype(ExecutionEngine *v4) Scope scope(v4); Scoped p(scope, v4->newObject()); ScopedObject pp(scope); - p->setPrototype((pp = NodePrototype::getProto(v4)).getPointer()); + p->setPrototype((pp = NodePrototype::getProto(v4))); p->defineAccessorProperty(QStringLiteral("data"), NodePrototype::method_get_nodeValue, 0); p->defineAccessorProperty(QStringLiteral("length"), method_length, 0); d->characterDataPrototype = p; @@ -764,7 +764,7 @@ ReturnedValue Text::prototype(ExecutionEngine *v4) Scope scope(v4); Scoped p(scope, v4->newObject()); ScopedObject pp(scope); - p->setPrototype((pp = CharacterData::prototype(v4)).getPointer()); + p->setPrototype((pp = CharacterData::prototype(v4))); p->defineAccessorProperty(QStringLiteral("isElementContentWhitespace"), method_isElementContentWhitespace, 0); p->defineAccessorProperty(QStringLiteral("wholeText"), method_wholeText, 0); d->textPrototype = p; @@ -781,7 +781,7 @@ ReturnedValue CDATA::prototype(ExecutionEngine *v4) Scope scope(v4); Scoped p(scope, v4->newObject()); ScopedObject pp(scope); - p->setPrototype((pp = Text::prototype(v4)).getPointer()); + p->setPrototype((pp = Text::prototype(v4))); d->cdataPrototype = p; v4->v8Engine->freezeObject(p); } @@ -795,7 +795,7 @@ ReturnedValue Document::prototype(ExecutionEngine *v4) Scope scope(v4); Scoped p(scope, v4->newObject()); ScopedObject pp(scope); - p->setPrototype((pp = NodePrototype::getProto(v4)).getPointer()); + p->setPrototype((pp = NodePrototype::getProto(v4))); p->defineAccessorProperty(QStringLiteral("xmlVersion"), method_xmlVersion, 0); p->defineAccessorProperty(QStringLiteral("xmlEncoding"), method_xmlEncoding, 0); p->defineAccessorProperty(QStringLiteral("xmlStandalone"), method_xmlStandalone, 0); @@ -892,7 +892,7 @@ ReturnedValue Document::load(QV8Engine *engine, const QByteArray &data) ScopedObject instance(scope, v4->memoryManager->alloc(v4, document)); ScopedObject p(scope); - instance->setPrototype((p = Document::prototype(v4)).getPointer()); + instance->setPrototype((p = Document::prototype(v4))); return instance.asReturnedValue(); } @@ -1546,21 +1546,21 @@ void QQmlXMLHttpRequest::dispatchCallbackImpl(const ValueRef me) } ScopedString s(scope, v4->newString(QStringLiteral("ThisObject"))); - Scoped thisObj(scope, o->get(s.getPointer())); + Scoped thisObj(scope, o->get(s)); if (!thisObj) { v4->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ThisObject")); return; } s = v4->newString(QStringLiteral("onreadystatechange")); - Scoped callback(scope, thisObj->get(s.getPointer())); + Scoped callback(scope, thisObj->get(s)); if (!callback) { // not an error, but no onreadystatechange function to call. return; } s = v4->newString(QStringLiteral("ActivationObject")); - Scoped activationObject(scope, o->get(s.getPointer())); + Scoped activationObject(scope, o->get(s)); if (!activationObject) { v4->throwError(QStringLiteral("QQmlXMLHttpRequest: internal error: empty ActivationObject")); return; @@ -1693,7 +1693,7 @@ Heap::QQmlXMLHttpRequestCtor::QQmlXMLHttpRequestCtor(ExecutionEngine *engine) if (!ctor->d()->proto) ctor->setupProto(); ScopedString s(scope, engine->id_prototype); - ctor->defineDefaultProperty(s.getPointer(), ScopedObject(scope, ctor->d()->proto)); + ctor->defineDefaultProperty(s, ScopedObject(scope, ctor->d()->proto)); } DEFINE_OBJECT_VTABLE(QQmlXMLHttpRequestCtor); @@ -1703,7 +1703,7 @@ void QQmlXMLHttpRequestCtor::setupProto() ExecutionEngine *v4 = engine(); Scope scope(v4); Scoped p(scope, v4->newObject()); - d()->proto = p.getPointer()->d(); + d()->proto = p->d(); // Methods p->defineDefaultProperty(QStringLiteral("open"), method_open); @@ -2001,7 +2001,7 @@ void *qt_add_qmlxmlhttprequest(QV8Engine *engine) Scoped ctor(scope, v4->memoryManager->alloc(v4)); ScopedString s(scope, v4->newString(QStringLiteral("XMLHttpRequest"))); - v4->globalObject()->defineReadonlyProperty(s.getPointer(), ctor); + v4->globalObject()->defineReadonlyProperty(s, ctor); QQmlXMLHttpRequestData *data = new QQmlXMLHttpRequestData; return data; diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index c6e97445c0..8485576477 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -93,11 +93,11 @@ Heap::QtObject::QtObject(ExecutionEngine *v4, QQmlEngine *qmlEngine) for (int ii = 0; ii < qtMetaObject->enumeratorCount(); ++ii) { QMetaEnum enumerator = qtMetaObject->enumerator(ii); for (int jj = 0; jj < enumerator.keyCount(); ++jj) { - o->put((str = v4->newString(QString::fromUtf8(enumerator.key(jj)))).getPointer(), (v = QV4::Primitive::fromInt32(enumerator.value(jj)))); + o->put((str = v4->newString(QString::fromUtf8(enumerator.key(jj)))), (v = QV4::Primitive::fromInt32(enumerator.value(jj)))); } } - o->put((str = v4->newString(QStringLiteral("Asynchronous"))).getPointer(), (v = QV4::Primitive::fromInt32(0))); - o->put((str = v4->newString(QStringLiteral("Synchronous"))).getPointer(), (v = QV4::Primitive::fromInt32(1))); + o->put((str = v4->newString(QStringLiteral("Asynchronous"))), (v = QV4::Primitive::fromInt32(0))); + o->put((str = v4->newString(QStringLiteral("Synchronous"))), (v = QV4::Primitive::fromInt32(1))); o->defineDefaultProperty(QStringLiteral("include"), QV4Include::method_include); o->defineDefaultProperty(QStringLiteral("isQtObject"), QV4::QtObject::method_isQtObject); @@ -953,16 +953,16 @@ ReturnedValue QtObject::method_createQmlObject(CallContext *ctx) const QQmlError &error = errors.at(ii); errorstr += QLatin1String("\n ") + error.toString(); qmlerror = v4->newObject(); - qmlerror->put((s = v4->newString(QStringLiteral("lineNumber"))).getPointer(), (v = QV4::Primitive::fromInt32(error.line()))); - qmlerror->put((s = v4->newString(QStringLiteral("columnNumber"))).getPointer(), (v = QV4::Primitive::fromInt32(error.column()))); - qmlerror->put((s = v4->newString(QStringLiteral("fileName"))).getPointer(), (v = v4->newString(error.url().toString()))); - qmlerror->put((s = v4->newString(QStringLiteral("message"))).getPointer(), (v = v4->newString(error.description()))); + qmlerror->put((s = v4->newString(QStringLiteral("lineNumber"))), (v = QV4::Primitive::fromInt32(error.line()))); + qmlerror->put((s = v4->newString(QStringLiteral("columnNumber"))), (v = QV4::Primitive::fromInt32(error.column()))); + qmlerror->put((s = v4->newString(QStringLiteral("fileName"))), (v = v4->newString(error.url().toString()))); + qmlerror->put((s = v4->newString(QStringLiteral("message"))), (v = v4->newString(error.description()))); qmlerrors->putIndexed(ii, qmlerror); } v = v4->newString(errorstr); Scoped errorObject(scope, v4->newErrorObject(v)); - errorObject->put((s = v4->newString(QStringLiteral("qmlErrors"))).getPointer(), qmlerrors); + errorObject->put((s = v4->newString(QStringLiteral("qmlErrors"))), qmlerrors); return errorObject.asReturnedValue(); } }; diff --git a/src/qml/qml/v8/qv4domerrors_p.h b/src/qml/qml/v8/qv4domerrors_p.h index facf7972ad..b68981a492 100644 --- a/src/qml/qml/v8/qv4domerrors_p.h +++ b/src/qml/qml/v8/qv4domerrors_p.h @@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE #define V4THROW_DOM(error, string) { \ QV4::ScopedValue v(scope, scope.engine->newString(QStringLiteral(string))); \ QV4::Scoped ex(scope, scope.engine->newErrorObject(v)); \ - ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(QStringLiteral("code"))).getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(error))); \ + ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(QStringLiteral("code"))), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(error))); \ return ctx->engine()->throwError(ex); \ } diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 742244f649..ed0f50f16c 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -333,7 +333,7 @@ static QV4::ReturnedValue objectFromVariantMap(QV8Engine *engine, const QVariant uint idx = s->asArrayIndex(); if (idx > 16 && (!o->arrayData() || idx > o->arrayData()->length() * 2)) o->initSparseArray(); - o->put(s.getPointer(), (v = engine->fromVariant(iter.value()))); + o->put(s, (v = engine->fromVariant(iter.value()))); } return o.asReturnedValue(); } @@ -620,7 +620,7 @@ QV4::ReturnedValue QV8Engine::variantMapToJS(const QVariantMap &vmap) if (idx < UINT_MAX) o->arraySet(idx, v); else - o->insertMember(s.getPointer(), v); + o->insertMember(s, v); } return o.asReturnedValue(); } diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 814c376b05..919f926bc2 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -1721,26 +1721,26 @@ void QQmlDelegateModelItemMetaType::initializePrototype() QV4::ScopedContext global(scope, scope.engine->rootContext()); p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, 30, QQmlDelegateModelItem::get_member))); p->setSetter(0); - proto->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); + proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); s = v4->newString(QStringLiteral("inItems")); p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Default, QQmlDelegateModelItem::get_member))); p->setSetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Default, QQmlDelegateModelItem::set_member))); - proto->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); + proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); s = v4->newString(QStringLiteral("inPersistedItems")); p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Persisted, QQmlDelegateModelItem::get_member))); p->setSetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Persisted, QQmlDelegateModelItem::set_member))); - proto->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); + proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); s = v4->newString(QStringLiteral("itemsIndex")); p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Default, QQmlDelegateModelItem::get_index))); - proto->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); + proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); s = v4->newString(QStringLiteral("persistedItemsIndex")); p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Persisted, QQmlDelegateModelItem::get_index))); p->setSetter(0); - proto->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); + proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); for (int i = 2; i < groupNames.count(); ++i) { QString propertyName = QStringLiteral("in") + groupNames.at(i); @@ -1748,14 +1748,14 @@ void QQmlDelegateModelItemMetaType::initializePrototype() s = v4->newString(propertyName); p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, i + 1, QQmlDelegateModelItem::get_member))); p->setSetter((f = QV4::DelegateModelGroupFunction::create(global, i + 1, QQmlDelegateModelItem::set_member))); - proto->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); + proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); } for (int i = 2; i < groupNames.count(); ++i) { const QString propertyName = groupNames.at(i) + QStringLiteral("Index"); s = v4->newString(propertyName); p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, i + 1, QQmlDelegateModelItem::get_index))); p->setSetter(0); - proto->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); + proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); } modelItemProto = proto; } @@ -2489,7 +2489,7 @@ QQmlV4Handle QQmlDelegateModelGroup::get(int index) QV4::Scope scope(v4); QV4::ScopedObject o(scope, v4->memoryManager->alloc(v4, cacheItem)); QV4::ScopedObject p(scope, model->m_cacheMetaType->modelItemProto.value()); - o->setPrototype(p.getPointer()); + o->setPrototype(p); ++cacheItem->scriptRef; return QQmlV4Handle(o); @@ -3298,7 +3298,7 @@ public: QV4::ScopedObject changeProto(scope, engineData(v4->v8Engine)->changeProto.value()); QV4::Scoped object(scope, QQmlDelegateModelGroupChange::create(v4)); - object->setPrototype(changeProto.getPointer()); + object->setPrototype(changeProto); object->d()->change = change; if (hasProperty) diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index afd887ba53..083bbd6f1c 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -424,13 +424,13 @@ void ListModel::set(int elementIndex, QV4::Object *object, QVector *roles, // Add the value now if ((s = propertyValue)) { - const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName.getPointer(), ListLayout::Role::String); + const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::String); roleIndex = e->setStringProperty(r, s->toQString()); } else if (propertyValue->isNumber()) { - const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName.getPointer(), ListLayout::Role::Number); + const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Number); roleIndex = e->setDoubleProperty(r, propertyValue->asDouble()); } else if ((a = propertyValue)) { - const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName.getPointer(), ListLayout::Role::List); + const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::List); ListModel *subModel = new ListModel(r.subLayout, 0, -1); int arrayLength = a->getLength(); @@ -441,16 +441,16 @@ void ListModel::set(int elementIndex, QV4::Object *object, QVector *roles, roleIndex = e->setListProperty(r, subModel); } else if (propertyValue->isBoolean()) { - const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName.getPointer(), ListLayout::Role::Bool); + const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Bool); roleIndex = e->setBoolProperty(r, propertyValue->booleanValue()); } else if (QV4::DateObject *dd = propertyValue->asDateObject()) { - const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName.getPointer(), ListLayout::Role::DateTime); + const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::DateTime); QDateTime dt = dd->toQDateTime(); roleIndex = e->setDateTimeProperty(r, dt); } else if (QV4::Object *o = propertyValue->asObject()) { if (QV4::QObjectWrapper *wrapper = o->as()) { QObject *o = wrapper->object(); - const ListLayout::Role &role = m_layout->getRoleOrCreate(propertyName.getPointer(), ListLayout::Role::QObject); + const ListLayout::Role &role = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::QObject); if (role.type == ListLayout::Role::QObject) roleIndex = e->setQObjectProperty(role, o); } else { diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index 8bc677f6ba..ae494f1732 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -228,7 +228,7 @@ void QQuickWorkerScriptEnginePrivate::WorkerEngine::init() QV4::Scoped createsendconstructor(scope, createsendscript.run()); Q_ASSERT(!scope.engine->hasException); QV4::ScopedString name(scope, m_v4Engine->newString(QStringLiteral("sendMessage"))); - QV4::ScopedValue function(scope, QV4::BuiltinFunction::create(globalContext, name.getPointer(), + QV4::ScopedValue function(scope, QV4::BuiltinFunction::create(globalContext, name, QQuickWorkerScriptEnginePrivate::method_sendMessage)); QV4::ScopedCallData callData(scope, 1); callData->args[0] = function; @@ -307,9 +307,9 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::getWorker(WorkerScript *scri w->setReadOnly(false); QV4::Scoped api(scope, v4->newObject()); - api->put(QV4::ScopedString(scope, v4->newString(QStringLiteral("sendMessage"))).getPointer(), QV4::ScopedValue(scope, workerEngine->sendFunction(script->id))); + api->put(QV4::ScopedString(scope, v4->newString(QStringLiteral("sendMessage"))), QV4::ScopedValue(scope, workerEngine->sendFunction(script->id))); - w->QV4::Object::put(QV4::ScopedString(scope, v4->newString(QStringLiteral("WorkerScript"))).getPointer(), api); + w->QV4::Object::put(QV4::ScopedString(scope, v4->newString(QStringLiteral("WorkerScript"))), api); w->setReadOnly(true); } diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index 355525ac18..5c60487574 100644 --- a/src/qml/util/qqmladaptormodel.cpp +++ b/src/qml/util/qqmladaptormodel.cpp @@ -224,7 +224,7 @@ public: QV4::ScopedFunctionObject s(scope, v4->memoryManager->alloc(global, propertyId, QQmlDMCachedModelData::set_property)); p->setGetter(g); p->setSetter(s); - proto->insertMember(name.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); + proto->insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); } prototype = proto; } @@ -427,7 +427,7 @@ public: QV4::Scope scope(v4); QV4::ScopedObject proto(scope, type->prototype.value()); QV4::ScopedObject o(scope, proto->engine()->memoryManager->alloc(proto->engine(), this)); - o->setPrototype(proto.getPointer()); + o->setPrototype(proto); ++scriptRef; return o.asReturnedValue(); } @@ -606,7 +606,7 @@ public: QV4::Scope scope(v4); QV4::ScopedObject o(scope, v4->memoryManager->alloc(v4, this)); QV4::ScopedObject p(scope, data->listItemProto.value()); - o->setPrototype(p.getPointer()); + o->setPrototype(p); ++scriptRef; return o.asReturnedValue(); } diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 9e1d3b345c..77f75d796d 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -567,10 +567,10 @@ struct QQuickJSContext2DPrototype : public QV4::Object { V4_OBJECT2(QQuickJSContext2DPrototype, QV4::Object) public: - static QQuickJSContext2DPrototype *create(QV4::ExecutionEngine *engine) + static QV4::Heap::QQuickJSContext2DPrototype *create(QV4::ExecutionEngine *engine) { QV4::Scope scope(engine); - QV4::ScopedObject o(scope, engine->memoryManager->alloc(engine)); + QV4::Scoped o(scope, engine->memoryManager->alloc(engine)); o->defineDefaultProperty(QStringLiteral("quadraticCurveTo"), method_quadraticCurveTo, 0); o->defineDefaultProperty(QStringLiteral("restore"), method_restore, 0); @@ -617,7 +617,7 @@ public: o->defineDefaultProperty(QStringLiteral("closePath"), method_closePath, 0); o->defineAccessorProperty(QStringLiteral("canvas"), QQuickJSContext2DPrototype::method_get_canvas, 0); - return static_cast(o.getPointer()); + return o->d(); } static QV4::ReturnedValue method_get_canvas(QV4::CallContext *ctx); @@ -942,7 +942,7 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV8Engine* engi QV4::Scope scope(v4); QV4::Scoped pixelData(scope, scope.engine->memoryManager->alloc(v4)); QV4::ScopedObject p(scope, ed->pixelArrayProto.value()); - pixelData->setPrototype(p.getPointer()); + pixelData->setPrototype(p); if (image.isNull()) { pixelData->d()->image = QImage(w, h, QImage::Format_ARGB32); @@ -1568,7 +1568,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient(QV4:: QV4::Scoped gradient(scope, scope.engine->memoryManager->alloc(scope.engine)); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p.getPointer()); + gradient->setPrototype(p); gradient->d()->brush = QLinearGradient(x0, y0, x1, y1); return gradient.asReturnedValue(); } @@ -1622,7 +1622,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(QV4:: QV4::Scoped gradient(scope, scope.engine->memoryManager->alloc(scope.engine)); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p.getPointer()); + gradient->setPrototype(p); gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r0+r1, QPointF(x0, y0)); return gradient.asReturnedValue(); } @@ -1668,7 +1668,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient(QV4: QV4::Scoped gradient(scope, scope.engine->memoryManager->alloc(scope.engine)); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p.getPointer()); + gradient->setPrototype(p); gradient->d()->brush = QConicalGradient(x, y, angle); return gradient.asReturnedValue(); } @@ -1742,7 +1742,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::CallCon if (QV4::Object *o = ctx->d()->callData->args[0].asObject()) { QV4::ScopedString s(scope, scope.engine->newString(QStringLiteral("data"))); - QV4::Scoped pixelData(scope, o->get(s.getPointer())); + QV4::Scoped pixelData(scope, o->get(s)); if (!!pixelData) { patternTexture = pixelData->d()->image; } @@ -4332,7 +4332,7 @@ void QQuickContext2D::setV8Engine(QV8Engine *engine) QV4::Scope scope(v4Engine); QV4::Scoped wrapper(scope, v4Engine->memoryManager->alloc(v4Engine)); QV4::ScopedObject p(scope, ed->contextPrototype.value()); - wrapper->setPrototype(p.getPointer()); + wrapper->setPrototype(p); wrapper->d()->context = this; m_v4value = wrapper; } diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 6ae74281ca..dc68808748 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -4169,15 +4169,15 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const QRectF r = mapRectFromItem(itemObj, QRectF(x, y, w, h)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(r.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(r.y()))); - rv->put((s = v4->newString(QStringLiteral("width"))).getPointer(), (v = QV4::Primitive::fromDouble(r.width()))); - rv->put((s = v4->newString(QStringLiteral("height"))).getPointer(), (v = QV4::Primitive::fromDouble(r.height()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(r.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(r.y()))); + rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Primitive::fromDouble(r.width()))); + rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Primitive::fromDouble(r.height()))); } else { QPointF p = mapFromItem(itemObj, QPointF(x, y)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(p.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(p.y()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(p.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(p.y()))); } } } @@ -4249,15 +4249,15 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const QRectF r = mapRectToItem(itemObj, QRectF(x, y, w, h)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(r.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(r.y()))); - rv->put((s = v4->newString(QStringLiteral("width"))).getPointer(), (v = QV4::Primitive::fromDouble(r.width()))); - rv->put((s = v4->newString(QStringLiteral("height"))).getPointer(), (v = QV4::Primitive::fromDouble(r.height()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(r.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(r.y()))); + rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Primitive::fromDouble(r.width()))); + rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Primitive::fromDouble(r.height()))); } else { QPointF p = mapToItem(itemObj, QPointF(x, y)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(p.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(p.y()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(p.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(p.y()))); } } } diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 139bae4038..b507b47e6b 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -278,17 +278,17 @@ public: QV4::ScopedString s(scope); - QV4::ScopedValue vbold(scope, obj->get((s = v4->newString(QStringLiteral("bold"))).getPointer())); - QV4::ScopedValue vcap(scope, obj->get((s = v4->newString(QStringLiteral("capitalization"))).getPointer())); - QV4::ScopedValue vfam(scope, obj->get((s = v4->newString(QStringLiteral("family"))).getPointer())); - QV4::ScopedValue vital(scope, obj->get((s = v4->newString(QStringLiteral("italic"))).getPointer())); - QV4::ScopedValue vlspac(scope, obj->get((s = v4->newString(QStringLiteral("letterSpacing"))).getPointer())); - QV4::ScopedValue vpixsz(scope, obj->get((s = v4->newString(QStringLiteral("pixelSize"))).getPointer())); - QV4::ScopedValue vpntsz(scope, obj->get((s = v4->newString(QStringLiteral("pointSize"))).getPointer())); - QV4::ScopedValue vstrk(scope, obj->get((s = v4->newString(QStringLiteral("strikeout"))).getPointer())); - QV4::ScopedValue vundl(scope, obj->get((s = v4->newString(QStringLiteral("underline"))).getPointer())); - QV4::ScopedValue vweight(scope, obj->get((s = v4->newString(QStringLiteral("weight"))).getPointer())); - QV4::ScopedValue vwspac(scope, obj->get((s = v4->newString(QStringLiteral("wordSpacing"))).getPointer())); + QV4::ScopedValue vbold(scope, obj->get((s = v4->newString(QStringLiteral("bold"))))); + QV4::ScopedValue vcap(scope, obj->get((s = v4->newString(QStringLiteral("capitalization"))))); + QV4::ScopedValue vfam(scope, obj->get((s = v4->newString(QStringLiteral("family"))))); + QV4::ScopedValue vital(scope, obj->get((s = v4->newString(QStringLiteral("italic"))))); + QV4::ScopedValue vlspac(scope, obj->get((s = v4->newString(QStringLiteral("letterSpacing"))))); + QV4::ScopedValue vpixsz(scope, obj->get((s = v4->newString(QStringLiteral("pixelSize"))))); + QV4::ScopedValue vpntsz(scope, obj->get((s = v4->newString(QStringLiteral("pointSize"))))); + QV4::ScopedValue vstrk(scope, obj->get((s = v4->newString(QStringLiteral("strikeout"))))); + QV4::ScopedValue vundl(scope, obj->get((s = v4->newString(QStringLiteral("underline"))))); + QV4::ScopedValue vweight(scope, obj->get((s = v4->newString(QStringLiteral("weight"))))); + QV4::ScopedValue vwspac(scope, obj->get((s = v4->newString(QStringLiteral("wordSpacing"))))); // pull out the values, set ok to true if at least one valid field is given. if (vbold->isBoolean()) { -- cgit v1.2.3