OpenCoverage

qv4mapiterator.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4mapiterator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2using namespace QV4;-
3-
4const QV4::VTable MapIteratorObject::static_vtbl = { (std::is_same<MapIteratorObject::SuperClass, Object>::value) ? nullptr : &MapIteratorObject::SuperClass::static_vtbl, (sizeof(MapIteratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(MapIteratorObject::Data) + (MapIteratorObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(MapIteratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), MapIteratorObject::IsExecutionContext, MapIteratorObject::IsString, MapIteratorObject::IsObject, MapIteratorObject::IsFunctionObject, MapIteratorObject::IsErrorObject, MapIteratorObject::IsArrayData, MapIteratorObject::IsStringOrSymbol, MapIteratorObject::MyType, { 0, 0, 0, 0 }, "MapIteratorObject", MapIteratorObject::virtualDestroy, MapIteratorObject::Data::markObjects, MapIteratorObject::virtualIsEqualTo, MapIteratorObject::virtualGet, MapIteratorObject::virtualPut, MapIteratorObject::virtualDeleteProperty, MapIteratorObject::virtualHasProperty, MapIteratorObject::virtualGetOwnProperty, MapIteratorObject::virtualDefineOwnProperty, MapIteratorObject::virtualIsExtensible, MapIteratorObject::virtualPreventExtensions, MapIteratorObject::virtualGetPrototypeOf, MapIteratorObject::virtualSetPrototypeOf, MapIteratorObject::virtualGetLength, MapIteratorObject::virtualAdvanceIterator, MapIteratorObject::virtualInstanceOf, MapIteratorObject::virtualCall, MapIteratorObject::virtualCallAsConstructor, };-
5-
6void MapIteratorPrototype::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 98211 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
qstring_literal_temp;
executed 98211 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
}()), method_next, 0);
98211
9-
10 Scope scope(e);-
11 ScopedString val(scope, e->newString(QLatin1String("Map Iterator")));-
12 defineReadonlyConfigurableProperty(e->symbol_toStringTag(), val);-
13}
executed 99001 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99001
14-
15ReturnedValue MapIteratorPrototype::method_next(const FunctionObject *b, const Value *that, const Value *, int)-
16{-
17 Scope scope(b);-
18 const MapIteratorObject *thisObject = that->as<MapIteratorObject>();-
19 if (!thisObject
!thisObjectDescription
TRUEevaluated 128 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
128-208
20 return
executed 128 times by 1 test: return scope.engine->throwTypeError(QLatin1String("Not a Map Iterator instance"));
Executed by:
  • tst_ecmascripttests
scope.engine->throwTypeError(QLatin1String("Not a Map Iterator instance"));
executed 128 times by 1 test: return scope.engine->throwTypeError(QLatin1String("Not a Map Iterator instance"));
Executed by:
  • tst_ecmascripttests
128
21-
22 Scoped<MapObject> s(scope, thisObject->d()->iteratedMap);-
23 uint index = thisObject->d()->mapNextIndex;-
24 IteratorKind itemKind = thisObject->d()->iterationKind;-
25-
26 if (!s
!sDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 180 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
28-180
27 QV4::Value undefined = Primitive::undefinedValue();-
28 return
executed 28 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
executed 28 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
28
29 }-
30-
31 Value *arguments = scope.alloc(2);-
32-
33 while (index < s->d()->esTable->size()
index < s->d()...sTable->size()Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
80-100
34 s->d()->esTable->iterate(index, &arguments[0], &arguments[1]);-
35 thisObject->d()->mapNextIndex = index + 1;-
36-
37 ScopedValue result(scope);-
38-
39 if (itemKind == KeyIteratorKind
itemKind == KeyIteratorKindDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
12-88
40 result = arguments[0];-
41 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else if (itemKind == ValueIteratorKind
itemKind == ValueIteratorKindDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
12-76
42 result = arguments[1];-
43 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
12
44 ((itemKind == KeyValueIteratorKind) ? static_cast<void>(0) : qt_assert("itemKind == KeyValueIteratorKind", __FILE__, 88));-
45-
46 result = scope.engine->newArrayObject();-
47-
48 Scoped<ArrayObject> resultArray(scope, result);-
49 resultArray->arrayReserve(2);-
50 resultArray->arrayPut(0, arguments[0]);-
51 resultArray->arrayPut(1, arguments[1]);-
52 resultArray->setArrayLengthUnchecked(2);-
53 }
executed 76 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
76
54-
55 return
executed 100 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, result, false);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(scope.engine, result, false);
executed 100 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, result, false);
Executed by:
  • tst_ecmascripttests
100
56 }-
57-
58 thisObject->d()->iteratedMap.set(scope.engine, nullptr);-
59 QV4::Value undefined = Primitive::undefinedValue();-
60 return
executed 80 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
executed 80 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
80
61}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0