diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-27 11:40:04 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:20:33 +0000 |
commit | a6eb09fa2015a6cff1c8344e5784235d6292098f (patch) | |
tree | e91188032ed251f22a0c07eb72baddccba45fee0 /src/qml/jsruntime/qv4arrayiterator.cpp | |
parent | 8761cbd4f7aada5a976831ff404b004f537a660b (diff) |
Cleanup IteratorPrototype::createIterResult API
Change-Id: I42fe22c65f0551287f4acdc5a76889f07cca042c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayiterator.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4arrayiterator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4arrayiterator.cpp b/src/qml/jsruntime/qv4arrayiterator.cpp index 13c036f9a9..fb8c3295bd 100644 --- a/src/qml/jsruntime/qv4arrayiterator.cpp +++ b/src/qml/jsruntime/qv4arrayiterator.cpp @@ -66,7 +66,7 @@ ReturnedValue ArrayIteratorPrototype::method_next(const FunctionObject *b, const ScopedObject a(scope, thisObject->d()->iteratedObject); if (!a) { QV4::Value undefined = Primitive::undefinedValue(); - return IteratorPrototype::createIterResultObject(scope.engine, undefined, ScopedValue(scope, Primitive::fromBoolean(true)))->asReturnedValue(); + return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); } quint32 index = thisObject->d()->nextIndex; @@ -78,19 +78,19 @@ ReturnedValue ArrayIteratorPrototype::method_next(const FunctionObject *b, const if (index >= len) { thisObject->d()->iteratedObject.set(scope.engine, nullptr); QV4::Value undefined = Primitive::undefinedValue(); - return IteratorPrototype::createIterResultObject(scope.engine, undefined, ScopedValue(scope, Primitive::fromBoolean(true)))->asReturnedValue(); + return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); } thisObject->d()->nextIndex = index + 1; if (itemKind == KeyIteratorKind) { - return IteratorPrototype::createIterResultObject(scope.engine, Primitive::fromInt32(index), ScopedValue(scope, Primitive::fromBoolean(false)))->asReturnedValue(); + return IteratorPrototype::createIterResultObject(scope.engine, Primitive::fromInt32(index), false); } ReturnedValue elementValue = a->getIndexed(index); CHECK_EXCEPTION(); if (itemKind == ValueIteratorKind) { - return IteratorPrototype::createIterResultObject(scope.engine, Value::fromReturnedValue(elementValue), ScopedValue(scope, Primitive::fromBoolean(false)))->asReturnedValue(); + return IteratorPrototype::createIterResultObject(scope.engine, Value::fromReturnedValue(elementValue), false); } else { Q_ASSERT(itemKind == KeyValueIteratorKind); @@ -100,7 +100,7 @@ ReturnedValue ArrayIteratorPrototype::method_next(const FunctionObject *b, const resultArray->arrayPut(1, Value::fromReturnedValue(elementValue)); resultArray->setArrayLengthUnchecked(2); - return IteratorPrototype::createIterResultObject(scope.engine, resultArray, ScopedValue(scope, Primitive::fromBoolean(false)))->asReturnedValue(); + return IteratorPrototype::createIterResultObject(scope.engine, resultArray, false); } } |