diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-30 09:18:03 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-02 17:27:36 +0200 |
commit | 3bf081203e713330aa1e5e92bc8b30fcc420e228 (patch) | |
tree | 1d9adea16f3b03964bd79a374f98b1d71b032502 /src/qml/jsruntime/qv4engine.cpp | |
parent | d8e31c098dade7280f21ca9781ba11bee5e4f201 (diff) |
Remove more usages of Object::setPrototype()
Change-Id: I8c49f61bc85e3d98dea90bf05db1a3f22d08f7b1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 0d61dab0bc..b7215d06a2 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -140,7 +140,7 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) objectClass = emptyClass->changePrototype(objectPrototype); arrayClass = objectClass->addMember(id_length, Attr_NotConfigurable|Attr_NotEnumerable); - arrayPrototype = new (memoryManager) ArrayPrototype(arrayClass); + ArrayPrototype *arrayPrototype = new (memoryManager) ArrayPrototype(arrayClass); arrayClass = arrayClass->changePrototype(arrayPrototype); InternalClass *argsClass = objectClass->addMember(id_length, Attr_NotEnumerable); @@ -169,12 +169,18 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) ErrorPrototype *errorPrototype = new (memoryManager) ErrorPrototype(objectClass); errorClass = emptyClass->changePrototype(errorPrototype); - evalErrorPrototype = new (memoryManager) EvalErrorPrototype(errorClass); - rangeErrorPrototype = new (memoryManager) RangeErrorPrototype(errorClass); - referenceErrorPrototype = new (memoryManager) ReferenceErrorPrototype(errorClass); - syntaxErrorPrototype = new (memoryManager) SyntaxErrorPrototype(errorClass); - typeErrorPrototype = new (memoryManager) TypeErrorPrototype(errorClass); - uRIErrorPrototype = new (memoryManager) URIErrorPrototype(errorClass); + EvalErrorPrototype *evalErrorPrototype = new (memoryManager) EvalErrorPrototype(errorClass); + evalErrorClass = emptyClass->changePrototype(evalErrorPrototype); + RangeErrorPrototype *rangeErrorPrototype = new (memoryManager) RangeErrorPrototype(errorClass); + rangeErrorClass = emptyClass->changePrototype(rangeErrorPrototype); + ReferenceErrorPrototype *referenceErrorPrototype = new (memoryManager) ReferenceErrorPrototype(errorClass); + referenceErrorClass = emptyClass->changePrototype(referenceErrorPrototype); + SyntaxErrorPrototype *syntaxErrorPrototype = new (memoryManager) SyntaxErrorPrototype(errorClass); + syntaxErrorClass = emptyClass->changePrototype(syntaxErrorPrototype); + TypeErrorPrototype *typeErrorPrototype = new (memoryManager) TypeErrorPrototype(errorClass); + typeErrorClass = emptyClass->changePrototype(typeErrorPrototype); + URIErrorPrototype *uRIErrorPrototype = new (memoryManager) URIErrorPrototype(errorClass); + uriErrorClass = emptyClass->changePrototype(uRIErrorPrototype); variantPrototype = new (memoryManager) VariantPrototype(objectClass); sequencePrototype = new (memoryManager) SequencePrototype(arrayClass->changePrototype(arrayPrototype)); @@ -417,7 +423,7 @@ RegExpObject *ExecutionEngine::newRegExpObject(const QRegExp &re) Object *ExecutionEngine::newErrorObject(const Value &value) { - ErrorObject *object = new (memoryManager) ErrorObject(this, value); + ErrorObject *object = new (memoryManager) ErrorObject(errorClass, value); return object; } @@ -665,13 +671,6 @@ void ExecutionEngine::markObjects() uRIErrorCtor.mark(); objectPrototype->mark(); - arrayPrototype->mark(); - evalErrorPrototype->mark(); - rangeErrorPrototype->mark(); - referenceErrorPrototype->mark(); - syntaxErrorPrototype->mark(); - typeErrorPrototype->mark(); - uRIErrorPrototype->mark(); variantPrototype->mark(); sequencePrototype->mark(); |