OpenCoverage

qv4arraybuffer.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4arraybuffer.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3using namespace QV4;-
4-
5const QV4::VTable ArrayBufferCtor::static_vtbl = { (std::is_same<ArrayBufferCtor::SuperClass, Object>::value) ? nullptr : &ArrayBufferCtor::SuperClass::static_vtbl, (sizeof(ArrayBufferCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ArrayBufferCtor::Data) + (ArrayBufferCtor::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ArrayBufferCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ArrayBufferCtor::IsExecutionContext, ArrayBufferCtor::IsString, ArrayBufferCtor::IsObject, ArrayBufferCtor::IsFunctionObject, ArrayBufferCtor::IsErrorObject, ArrayBufferCtor::IsArrayData, ArrayBufferCtor::IsStringOrSymbol, ArrayBufferCtor::MyType, { 0, 0, 0, 0 }, "ArrayBufferCtor", ArrayBufferCtor::virtualDestroy, ArrayBufferCtor::Data::markObjects, ArrayBufferCtor::virtualIsEqualTo, ArrayBufferCtor::virtualGet, ArrayBufferCtor::virtualPut, ArrayBufferCtor::virtualDeleteProperty, ArrayBufferCtor::virtualHasProperty, ArrayBufferCtor::virtualGetOwnProperty, ArrayBufferCtor::virtualDefineOwnProperty, ArrayBufferCtor::virtualIsExtensible, ArrayBufferCtor::virtualPreventExtensions, ArrayBufferCtor::virtualGetPrototypeOf, ArrayBufferCtor::virtualSetPrototypeOf, ArrayBufferCtor::virtualGetLength, ArrayBufferCtor::virtualAdvanceIterator, ArrayBufferCtor::virtualInstanceOf, ArrayBufferCtor::virtualCall, ArrayBufferCtor::virtualCallAsConstructor, };-
6const QV4::VTable ArrayBuffer::static_vtbl = { (std::is_same<ArrayBuffer::SuperClass, Object>::value) ? nullptr : &ArrayBuffer::SuperClass::static_vtbl, (sizeof(ArrayBuffer::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ArrayBuffer::Data) + (ArrayBuffer::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ArrayBuffer::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ArrayBuffer::IsExecutionContext, ArrayBuffer::IsString, ArrayBuffer::IsObject, ArrayBuffer::IsFunctionObject, ArrayBuffer::IsErrorObject, ArrayBuffer::IsArrayData, ArrayBuffer::IsStringOrSymbol, ArrayBuffer::MyType, { 0, 0, 0, 0 }, "ArrayBuffer", ArrayBuffer::virtualDestroy, ArrayBuffer::Data::markObjects, ArrayBuffer::virtualIsEqualTo, ArrayBuffer::virtualGet, ArrayBuffer::virtualPut, ArrayBuffer::virtualDeleteProperty, ArrayBuffer::virtualHasProperty, ArrayBuffer::virtualGetOwnProperty, ArrayBuffer::virtualDefineOwnProperty, ArrayBuffer::virtualIsExtensible, ArrayBuffer::virtualPreventExtensions, ArrayBuffer::virtualGetPrototypeOf, ArrayBuffer::virtualSetPrototypeOf, ArrayBuffer::virtualGetLength, ArrayBuffer::virtualAdvanceIterator, ArrayBuffer::virtualInstanceOf, ArrayBuffer::virtualCall, ArrayBuffer::virtualCallAsConstructor, };-
7-
8void Heap::ArrayBufferCtor::init(QV4::ExecutionContext *scope)-
9{-
10 Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "ArrayBuffer")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ArrayBuffer" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98116 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 98116 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
  • ...
}()));
98116
11}
executed 98418 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
  • ...
98418
12-
13ReturnedValue ArrayBufferCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *)-
14{-
15 ExecutionEngine *v4 = f->engine();-
16 Scope scope(v4);-
17-
18 ScopedValue l(scope, argc ? argv[0] : Primitive::undefinedValue());-
19 double dl = l->toInteger();-
20 if (v4->hasException
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2308 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
8-2308
21 return
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
22 uint len = (uint)qBound(0., dl, (double)-
23 (0x7fffffff * 2U + 1U)-
24 );-
25 if (len != dl
len != dlDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2290 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
28-2290
26 return
executed 28 times by 1 test: return v4->throwRangeError(QLatin1String("ArrayBuffer constructor: invalid length"));
Executed by:
  • tst_ecmascripttests
v4->throwRangeError(QLatin1String("ArrayBuffer constructor: invalid length"));
executed 28 times by 1 test: return v4->throwRangeError(QLatin1String("ArrayBuffer constructor: invalid length"));
Executed by:
  • tst_ecmascripttests
28
27-
28 Scoped<ArrayBuffer> a(scope, v4->newArrayBuffer(len));-
29 if (scope.engine->hasException
scope.engine->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 2287 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-2287
30 return
never executed: return Encode::undefined();
Encode::undefined();
never executed: return Encode::undefined();
0
31-
32 return
executed 2280 times by 1 test: return a->asReturnedValue();
Executed by:
  • tst_ecmascripttests
a->asReturnedValue();
executed 2280 times by 1 test: return a->asReturnedValue();
Executed by:
  • tst_ecmascripttests
2280
33}-
34-
35-
36ReturnedValue ArrayBufferCtor::virtualCall(const FunctionObject *f, const Value *, const Value *argv, int argc)-
37{-
38 return
executed 4 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f);
Executed by:
  • tst_ecmascripttests
virtualCallAsConstructor(f, argv, argc, f);
executed 4 times by 1 test: return virtualCallAsConstructor(f, argv, argc, f);
Executed by:
  • tst_ecmascripttests
4
39}-
40-
41ReturnedValue ArrayBufferCtor::method_isView(const FunctionObject *, const Value *, const Value *argv, int argc)-
42{-
43 if (argc < 1
argc < 1Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 232 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
8-232
44 return
executed 8 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
Encode(false);
executed 8 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
8
45-
46 if (argv[0].as<TypedArray>()
argv[0].as<TypedArray>()Description
TRUEevaluated 108 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_ecmascripttests
||
108-124
47 argv[0].as<DataView>()
argv[0].as<DataView>()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
12-112
48 return
executed 120 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
Encode(true);
executed 120 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
120
49-
50 return
executed 112 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
Encode(false);
executed 112 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
112
51}-
52-
53-
54void Heap::ArrayBuffer::init(size_t length)-
55{-
56 Object::init();-
57 if (length <
length < (0x7f...fff * 2U + 1U)Description
TRUEevaluated 21446 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
36-21446
58 (0x7fffffff * 2U + 1U)
length < (0x7f...fff * 2U + 1U)Description
TRUEevaluated 21446 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
36-21446
59 )-
60 data = QTypedArrayData<char>::allocate(length + 1);
executed 21432 times by 2 tests: data = QTypedArrayData<char>::allocate(length + 1);
Executed by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
21432
61 if (!data
!dataDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 21444 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
) {
36-21444
62 internalClass->engine->throwRangeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "ArrayBuffer: out of memory")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ArrayBuffer: out of memory" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 36 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
qstring_literal_temp;
executed 36 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
}()));
36
63 return;
executed 36 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
36
64 }-
65 data->size = int(length);-
66 memset(data->data(), 0, length + 1);-
67}
executed 21443 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
21443
68-
69void Heap::ArrayBuffer::init(const QByteArray& array)-
70{-
71 Object::init();-
72 data = const_cast<QByteArray&>(array).data_ptr();-
73 data->ref.ref();-
74}
executed 6 times by 3 tests: end of block
Executed by:
  • tst_qjsvalue
  • tst_qqmlxmlhttprequest
  • tst_qquickdroparea
6
75-
76void Heap::ArrayBuffer::destroy()-
77{-
78 if (data
dataDescription
TRUEevaluated 21489 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlxmlhttprequest
  • tst_qquickdroparea
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& !data->ref.deref()
!data->ref.deref()Description
TRUEevaluated 21487 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
  • tst_qquickdroparea
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsvalue
)
2-21489
79 QTypedArrayData<char>::deallocate(data);
executed 21487 times by 3 tests: QTypedArrayData<char>::deallocate(data);
Executed by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
  • tst_qquickdroparea
21487
80 Object::destroy();-
81}
executed 21526 times by 4 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlxmlhttprequest
  • tst_qquickdroparea
21526
82-
83QByteArray ArrayBuffer::asByteArray() const-
84{-
85 QByteArrayDataPtr ba = { d()->data };-
86 ba.ptr->ref.ref();-
87 return
executed 6 times by 3 tests: return QByteArray(ba);
Executed by:
  • tst_qjsvalue
  • tst_qqmlxmlhttprequest
  • tst_qquickdroparea
QByteArray(ba);
executed 6 times by 3 tests: return QByteArray(ba);
Executed by:
  • tst_qjsvalue
  • tst_qqmlxmlhttprequest
  • tst_qquickdroparea
6
88}-
89-
90void ArrayBuffer::detach() {-
91 if (!d()->data->ref.isShared()
!d()->data->ref.isShared()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
92 return;
never executed: return;
0
93-
94 QTypedArrayData<char> *oldData = d()->data;-
95-
96 d()->data = QTypedArrayData<char>::allocate(oldData->size + 1);-
97 if (!d()->data
!d()->dataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
98 engine()->throwRangeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "ArrayBuffer: out of memory")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ArrayBuffer: out of memory" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()));
0
99 return;
never executed: return;
0
100 }-
101-
102 memcpy(d()->data->data(), oldData->data(), oldData->size + 1);-
103-
104 if (!oldData->ref.deref()
!oldData->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
105 QTypedArrayData<char>::deallocate(oldData);
never executed: QTypedArrayData<char>::deallocate(oldData);
0
106}
never executed: end of block
0
107-
108-
109void ArrayBufferPrototype::init(ExecutionEngine *engine, Object *ctor)-
110{-
111 Scope scope(engine);-
112 ScopedObject o(scope);-
113 ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1));-
114 ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));-
115 ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "isView")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "isView" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98432 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 98432 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
  • ...
}()), ArrayBufferCtor::method_isView, 1);
98432
116 ctor->addSymbolSpecies();-
117-
118 defineDefaultProperty(engine->id_constructor(), (o = ctor));-
119 defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "byteLength")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "byteLength" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 99005 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 99005 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_get_byteLength, nullptr);
99005
120 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "slice")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "slice" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98764 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 98764 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_slice, 2);
98764
121 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "toString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "toString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98980 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 98980 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_toString, 0);
98980
122 ScopedString name(scope, engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "ArrayBuffer")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ArrayBuffer" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98785 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 98785 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
  • ...
}())));
98785
123 defineReadonlyConfigurableProperty(scope.engine->symbol_toStringTag(), name);-
124}
executed 99039 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
  • ...
99039
125-
126ReturnedValue ArrayBufferPrototype::method_get_byteLength(const FunctionObject *b, const Value *thisObject, const Value *, int)-
127{-
128 const ArrayBuffer *a = thisObject->as<ArrayBuffer>();-
129 if (!a
!aDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 86 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickdroparea
)
52-86
130 return
executed 52 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
b->engine()->throwTypeError();
executed 52 times by 1 test: return b->engine()->throwTypeError();
Executed by:
  • tst_ecmascripttests
52
131-
132 return
executed 86 times by 2 tests: return Encode(a->d()->data->size);
Executed by:
  • tst_ecmascripttests
  • tst_qquickdroparea
Encode(a->d()->data->size);
executed 86 times by 2 tests: return Encode(a->d()->data->size);
Executed by:
  • tst_ecmascripttests
  • tst_qquickdroparea
86
133}-
134-
135ReturnedValue ArrayBufferPrototype::method_slice(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
136{-
137 ExecutionEngine *v4 = b->engine();-
138 const ArrayBuffer *a = thisObject->as<ArrayBuffer>();-
139 if (!a
!aDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 121 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
32-121
140 return
executed 32 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
v4->throwTypeError();
executed 32 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
32
141-
142 double start = argc > 0
argc > 0Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 77 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? argv[0].toInteger() : 0;
45-77
143 double end = (argc < 2
argc < 2Description
TRUEevaluated 79 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 43 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| argv[1].isUndefined()
argv[1].isUndefined()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) ?
4-79
144 a->d()->data->size : argv[1].toInteger();-
145 if (v4->hasException
v4->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-124
146 return
never executed: return QV4::Encode::undefined();
QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
147-
148 double first = (
(start < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 121 times by 1 test
Evaluated by:
  • tst_ecmascripttests
start < 0)
(start < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 121 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? qMax(a->d()->data->size + start, 0.) : qMin(start, (double)a->d()->data->size);
4-121
149 double final = (
(end < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 123 times by 1 test
Evaluated by:
  • tst_ecmascripttests
end < 0)
(end < 0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 123 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? qMax(a->d()->data->size + end, 0.) : qMin(end, (double)a->d()->data->size);
4-123
150-
151 Scope scope(v4);-
152 ScopedFunctionObject constructor(scope, a->get(scope.engine->id_constructor()));-
153 if (!constructor
!constructorDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
52-74
154 return
executed 73 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
v4->throwTypeError();
executed 73 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
73
155-
156 double newLen = qMax(final - first, 0.);-
157 ScopedValue argument(scope, QV4::Encode(newLen));-
158 QV4::Scoped<ArrayBuffer> newBuffer(scope, constructor->callAsConstructor(argument, 1));-
159 if (!newBuffer
!newBufferDescription
TRUEnever evaluated
FALSEevaluated 51 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| newBuffer->d()->data->size < (int)newLen
newBuffer->d()... < (int)newLenDescription
TRUEnever evaluated
FALSEevaluated 51 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-51
160 return
never executed: return v4->throwTypeError();
v4->throwTypeError();
never executed: return v4->throwTypeError();
0
161-
162 memcpy(newBuffer->d()->data->data(), a->d()->data->data() + (uint)first, newLen);-
163 return
executed 52 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 52 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
52
164}-
165-
166ReturnedValue ArrayBufferPrototype::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int)-
167{-
168 ExecutionEngine *v4 = b->engine();-
169 const ArrayBuffer *a = thisObject->as<ArrayBuffer>();-
170 if (!a
!aDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsvalue
)
2-12
171 return
executed 12 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
QV4::Encode::undefined();
executed 12 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
172 return
executed 2 times by 1 test: return Encode(v4->newString(QString::fromUtf8(a->asByteArray())));
Executed by:
  • tst_qjsvalue
Encode(v4->newString(QString::fromUtf8(a->asByteArray())));
executed 2 times by 1 test: return Encode(v4->newString(QString::fromUtf8(a->asByteArray())));
Executed by:
  • tst_qjsvalue
2
173}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0