diff options
author | Lars Knoll <[email protected]> | 2015-01-10 22:04:54 +0100 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2015-01-12 14:52:50 +0100 |
commit | 447844aa25754db7e868469de4537af4331709ac (patch) | |
tree | 80245a0d948e87c8cfd7a35eb5fdc93a65105ccd /src/qml/jsruntime/qv4objectiterator.cpp | |
parent | 56211be8a0429fb3e3fa268c7698e1df079aa04e (diff) |
Get rid of Value::engine()
This method is not guaranteed to return an engine. We're safer
checking for the value being an object first and then getting
the engine from there.
Change-Id: I5c95e675337e545f2421613bd31c42d1e58d6f9a
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4objectiterator.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp index f0970d160e..2ce5c98316 100644 --- a/src/qml/jsruntime/qv4objectiterator.cpp +++ b/src/qml/jsruntime/qv4objectiterator.cpp @@ -73,7 +73,7 @@ void ObjectIterator::init(Object *o) #endif if (object->as<ArgumentsObject>()) { - Scope scope(object->engine()); + Scope scope(engine); Scoped<ArgumentsObject> (scope, object->asReturnedValue())->fullyCreate(); } } @@ -136,7 +136,7 @@ ReturnedValue ObjectIterator::nextPropertyName(ValueRef value) PropertyAttributes attrs; uint index; - Scope scope(object->engine()); + Scope scope(engine); ScopedProperty p(scope); ScopedString name(scope); next(name.getRef(), &index, p, &attrs); @@ -158,7 +158,7 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString(ValueRef value) PropertyAttributes attrs; uint index; - Scope scope(object->engine()); + Scope scope(engine); ScopedProperty p(scope); ScopedString name(scope); next(name.getRef(), &index, p, &attrs); @@ -170,7 +170,7 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString(ValueRef value) if (!!name) return name->asReturnedValue(); assert(index < UINT_MAX); - return Encode(object->engine()->newString(QString::number(index))); + return Encode(engine->newString(QString::number(index))); } ReturnedValue ObjectIterator::nextPropertyNameAsString() @@ -180,7 +180,7 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString() PropertyAttributes attrs; uint index; - Scope scope(object->engine()); + Scope scope(engine); ScopedProperty p(scope); ScopedString name(scope); next(name.getRef(), &index, p, &attrs); @@ -190,7 +190,7 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString() if (!!name) return name->asReturnedValue(); Q_ASSERT(index < UINT_MAX); - return Encode(object->engine()->newString(QString::number(index))); + return Encode(engine->newString(QString::number(index))); } |