OpenCoverage

qv4stringiterator.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4stringiterator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2using namespace QV4;-
3-
4const QV4::VTable StringIteratorObject::static_vtbl = { (std::is_same<StringIteratorObject::SuperClass, Object>::value) ? nullptr : &StringIteratorObject::SuperClass::static_vtbl, (sizeof(StringIteratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(StringIteratorObject::Data) + (StringIteratorObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(StringIteratorObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), StringIteratorObject::IsExecutionContext, StringIteratorObject::IsString, StringIteratorObject::IsObject, StringIteratorObject::IsFunctionObject, StringIteratorObject::IsErrorObject, StringIteratorObject::IsArrayData, StringIteratorObject::IsStringOrSymbol, StringIteratorObject::MyType, { 0, 0, 0, 0 }, "StringIteratorObject", StringIteratorObject::virtualDestroy, StringIteratorObject::Data::markObjects, StringIteratorObject::virtualIsEqualTo, StringIteratorObject::virtualGet, StringIteratorObject::virtualPut, StringIteratorObject::virtualDeleteProperty, StringIteratorObject::virtualHasProperty, StringIteratorObject::virtualGetOwnProperty, StringIteratorObject::virtualDefineOwnProperty, StringIteratorObject::virtualIsExtensible, StringIteratorObject::virtualPreventExtensions, StringIteratorObject::virtualGetPrototypeOf, StringIteratorObject::virtualSetPrototypeOf, StringIteratorObject::virtualGetLength, StringIteratorObject::virtualAdvanceIterator, StringIteratorObject::virtualInstanceOf, StringIteratorObject::virtualCall, StringIteratorObject::virtualCallAsConstructor, };-
5-
6void StringIteratorPrototype::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 98176 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 98176 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);
98176
9-
10 Scope scope(e);-
11 ScopedString val(scope, e->newString(QLatin1String("String Iterator")));-
12 defineReadonlyConfigurableProperty(e->symbol_toStringTag(), val);-
13}
executed 99061 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
  • ...
99061
14-
15ReturnedValue StringIteratorPrototype::method_next(const FunctionObject *b, const Value *that, const Value *, int)-
16{-
17 Scope scope(b);-
18 const StringIteratorObject *thisObject = that->as<StringIteratorObject>();-
19 if (!thisObject
!thisObjectDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 162 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-162
20 return
executed 4 times by 1 test: return scope.engine->throwTypeError(QLatin1String("Not an String Iterator instance"));
Executed by:
  • tst_ecmascripttests
scope.engine->throwTypeError(QLatin1String("Not an String Iterator instance"));
executed 4 times by 1 test: return scope.engine->throwTypeError(QLatin1String("Not an String Iterator instance"));
Executed by:
  • tst_ecmascripttests
4
21-
22 ScopedString s(scope, thisObject->d()->iteratedString);-
23 if (!s
!sDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 154 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
8-154
24 QV4::Value undefined = Primitive::undefinedValue();-
25 return
executed 8 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
executed 8 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
8
26 }-
27-
28 quint32 index = thisObject->d()->nextIndex;-
29-
30 QString str = s->toQString();-
31 quint32 len = str.length();-
32-
33 if (index >= len
index >= lenDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 116 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
38-116
34 thisObject->d()->iteratedString.set(scope.engine, nullptr);-
35 QV4::Value undefined = Primitive::undefinedValue();-
36 return
executed 38 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
executed 38 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, undefined, true);
Executed by:
  • tst_ecmascripttests
38
37 }-
38-
39 QChar ch = str.at(index);-
40 int num = 1;-
41 if (ch.unicode() >= 0xd800
ch.unicode() >= 0xd800Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& ch.unicode() <= 0xdbff
ch.unicode() <= 0xdbffDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& index + 1 != len
index + 1 != lenDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
4-80
42 ch = str.at(index + 1);-
43 if (ch.unicode() >= 0xdc00
ch.unicode() >= 0xdc00Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& ch.unicode() <= 0xdfff
ch.unicode() <= 0xdfffDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
)
0-16
44 num = 2;
executed 16 times by 1 test: num = 2;
Executed by:
  • tst_ecmascripttests
16
45 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
46-
47 thisObject->d()->nextIndex += num;-
48-
49 ScopedString resultString(scope, scope.engine->newString(s->toQString().mid(index, num)));-
50 return
executed 116 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, resultString, false);
Executed by:
  • tst_ecmascripttests
IteratorPrototype::createIterResultObject(scope.engine, resultString, false);
executed 116 times by 1 test: return IteratorPrototype::createIterResultObject(scope.engine, resultString, false);
Executed by:
  • tst_ecmascripttests
116
51}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0