Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4setiterator.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | using namespace QV4; | - | ||||||
3 | - | |||||||
4 | const QV4::VTable SetIteratorObject::static_vtbl = { (std::is_same<SetIteratorObject::SuperClass, Object>::value) ? nullptr : &SetIteratorObject::SuperClass::static_vtbl, (sizeof(SetIteratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(SetIteratorObject::Data) + (SetIteratorObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(SetIteratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), SetIteratorObject::IsExecutionContext, SetIteratorObject::IsString, SetIteratorObject::IsObject, SetIteratorObject::IsFunctionObject, SetIteratorObject::IsErrorObject, SetIteratorObject::IsArrayData, SetIteratorObject::IsStringOrSymbol, SetIteratorObject::MyType, { 0, 0, 0, 0 }, "SetIteratorObject", SetIteratorObject::virtualDestroy, SetIteratorObject::Data::markObjects, SetIteratorObject::virtualIsEqualTo, SetIteratorObject::virtualGet, SetIteratorObject::virtualPut, SetIteratorObject::virtualDeleteProperty, SetIteratorObject::virtualHasProperty, SetIteratorObject::virtualGetOwnProperty, SetIteratorObject::virtualDefineOwnProperty, SetIteratorObject::virtualIsExtensible, SetIteratorObject::virtualPreventExtensions, SetIteratorObject::virtualGetPrototypeOf, SetIteratorObject::virtualSetPrototypeOf, SetIteratorObject::virtualGetLength, SetIteratorObject::virtualAdvanceIterator, SetIteratorObject::virtualInstanceOf, SetIteratorObject::virtualCall, SetIteratorObject::virtualCallAsConstructor, }; | - | ||||||
5 | - | |||||||
6 | void SetIteratorPrototype::init(ExecutionEngine *e) | - | ||||||
7 | { | - | ||||||
8 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "next")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "next" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98151 times by 153 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98151 times by 153 tests: }()), method_next, 0);return qstring_literal_temp; Executed by:
| 98151 | ||||||
9 | - | |||||||
10 | Scope scope(e); | - | ||||||
11 | ScopedString val(scope, e->newString(QLatin1String("Set Iterator"))); | - | ||||||
12 | defineReadonlyConfigurableProperty(e->symbol_toStringTag(), val); | - | ||||||
13 | } executed 99019 times by 153 tests: end of block Executed by:
| 99019 | ||||||
14 | - | |||||||
15 | ReturnedValue SetIteratorPrototype::method_next(const FunctionObject *b, const Value *that, const Value *, int) | - | ||||||
16 | { | - | ||||||
17 | Scope scope(b); | - | ||||||
18 | const SetIteratorObject *thisObject = that->as<SetIteratorObject>(); | - | ||||||
19 | if (!thisObject
| 127-204 | ||||||
20 | return executed 127 times by 1 test: scope.engine->throwTypeError(QLatin1String("Not a Set Iterator instance"));return scope.engine->throwTypeError(QLatin1String("Not a Set Iterator instance")); Executed by:
executed 127 times by 1 test: return scope.engine->throwTypeError(QLatin1String("Not a Set Iterator instance")); Executed by:
| 127 | ||||||
21 | - | |||||||
22 | Scoped<SetObject> s(scope, thisObject->d()->iteratedSet); | - | ||||||
23 | uint index = thisObject->d()->setNextIndex; | - | ||||||
24 | IteratorKind itemKind = thisObject->d()->iterationKind; | - | ||||||
25 | - | |||||||
26 | if (!s
| 20-184 | ||||||
27 | QV4::Value undefined = Primitive::undefinedValue(); | - | ||||||
28 | return executed 20 times by 1 test: IteratorPrototype::createIterResultObject(scope.engine, undefined, true);return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); Executed by:
executed 20 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); Executed by:
| 20 | ||||||
29 | } | - | ||||||
30 | - | |||||||
31 | Value *arguments = scope.alloc(2); | - | ||||||
32 | - | |||||||
33 | while (index < s->d()->esTable->size()
| 48-134 | ||||||
34 | s->d()->esTable->iterate(index, &arguments[0], &arguments[1]); | - | ||||||
35 | thisObject->d()->setNextIndex = index + 1; | - | ||||||
36 | - | |||||||
37 | if (itemKind == KeyValueIteratorKind
| 12-124 | ||||||
38 | ScopedArrayObject resultArray(scope, scope.engine->newArrayObject()); | - | ||||||
39 | resultArray->arrayReserve(2); | - | ||||||
40 | resultArray->arrayPut(0, arguments[0]); | - | ||||||
41 | resultArray->arrayPut(1, arguments[0]); | - | ||||||
42 | resultArray->setArrayLengthUnchecked(2); | - | ||||||
43 | - | |||||||
44 | return executed 12 times by 1 test: IteratorPrototype::createIterResultObject(scope.engine, resultArray, false);return IteratorPrototype::createIterResultObject(scope.engine, resultArray, false); Executed by:
executed 12 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, resultArray, false); Executed by:
| 12 | ||||||
45 | } | - | ||||||
46 | - | |||||||
47 | return executed 124 times by 1 test: IteratorPrototype::createIterResultObject(scope.engine, arguments[0], false);return IteratorPrototype::createIterResultObject(scope.engine, arguments[0], false); Executed by:
executed 124 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, arguments[0], false); Executed by:
| 124 | ||||||
48 | } | - | ||||||
49 | - | |||||||
50 | thisObject->d()->iteratedSet.set(scope.engine, nullptr); | - | ||||||
51 | QV4::Value undefined = Primitive::undefinedValue(); | - | ||||||
52 | return executed 48 times by 1 test: IteratorPrototype::createIterResultObject(scope.engine, undefined, true);return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); Executed by:
executed 48 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); Executed by:
| 48 | ||||||
53 | } | - | ||||||
Switch to Source code | Preprocessed file |