OpenCoverage

qv4booleanobject.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4booleanobject.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3using namespace QV4;-
4-
5const QV4::VTable BooleanCtor::static_vtbl = { (std::is_same<BooleanCtor::SuperClass, Object>::value) ? nullptr : &BooleanCtor::SuperClass::static_vtbl, (sizeof(BooleanCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(BooleanCtor::Data) + (BooleanCtor::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(BooleanCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), BooleanCtor::IsExecutionContext, BooleanCtor::IsString, BooleanCtor::IsObject, BooleanCtor::IsFunctionObject, BooleanCtor::IsErrorObject, BooleanCtor::IsArrayData, BooleanCtor::IsStringOrSymbol, BooleanCtor::MyType, { 0, 0, 0, 0 }, "BooleanCtor", BooleanCtor::virtualDestroy, BooleanCtor::Data::markObjects, BooleanCtor::virtualIsEqualTo, BooleanCtor::virtualGet, BooleanCtor::virtualPut, BooleanCtor::virtualDeleteProperty, BooleanCtor::virtualHasProperty, BooleanCtor::virtualGetOwnProperty, BooleanCtor::virtualDefineOwnProperty, BooleanCtor::virtualIsExtensible, BooleanCtor::virtualPreventExtensions, BooleanCtor::virtualGetPrototypeOf, BooleanCtor::virtualSetPrototypeOf, BooleanCtor::virtualGetLength, BooleanCtor::virtualAdvanceIterator, BooleanCtor::virtualInstanceOf, BooleanCtor::virtualCall, BooleanCtor::virtualCallAsConstructor, };-
6const QV4::VTable BooleanObject::static_vtbl = { (std::is_same<BooleanObject::SuperClass, Object>::value) ? nullptr : &BooleanObject::SuperClass::static_vtbl, (sizeof(BooleanObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(BooleanObject::Data) + (BooleanObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(BooleanObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), BooleanObject::IsExecutionContext, BooleanObject::IsString, BooleanObject::IsObject, BooleanObject::IsFunctionObject, BooleanObject::IsErrorObject, BooleanObject::IsArrayData, BooleanObject::IsStringOrSymbol, BooleanObject::MyType, { 0, 0, 0, 0 }, "BooleanObject", BooleanObject::virtualDestroy, BooleanObject::Data::markObjects, BooleanObject::virtualIsEqualTo, BooleanObject::virtualGet, BooleanObject::virtualPut, BooleanObject::virtualDeleteProperty, BooleanObject::virtualHasProperty, BooleanObject::virtualGetOwnProperty, BooleanObject::virtualDefineOwnProperty, BooleanObject::virtualIsExtensible, BooleanObject::virtualPreventExtensions, BooleanObject::virtualGetPrototypeOf, BooleanObject::virtualSetPrototypeOf, BooleanObject::virtualGetLength, BooleanObject::virtualAdvanceIterator, BooleanObject::virtualInstanceOf, BooleanObject::virtualCall, BooleanObject::virtualCallAsConstructor, };-
7-
8void Heap::BooleanCtor::init(QV4::ExecutionContext *scope)-
9{-
10 Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "Boolean")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Boolean" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98632 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 98632 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
  • ...
}()));
98632
11}
executed 99154 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
  • ...
99154
12-
13ReturnedValue BooleanCtor::virtualCallAsConstructor(const FunctionObject *that, const Value *argv, int argc, const Value *)-
14{-
15 bool n = argc
argcDescription
TRUEevaluated 2673 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
FALSEevaluated 212 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? argv[0].toBoolean() : false;
212-2673
16 return
executed 2887 times by 2 tests: return Encode(that->engine()->newBooleanObject(n));
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
Encode(that->engine()->newBooleanObject(n));
executed 2887 times by 2 tests: return Encode(that->engine()->newBooleanObject(n));
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
2887
17}-
18-
19ReturnedValue BooleanCtor::virtualCall(const FunctionObject *, const Value *, const Value *argv, int argc)-
20{-
21 bool value = argc
argcDescription
TRUEevaluated 356 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? argv[0].toBoolean() : 0;
16-356
22 return
executed 372 times by 1 test: return Encode(value);
Executed by:
  • tst_ecmascripttests
Encode(value);
executed 372 times by 1 test: return Encode(value);
Executed by:
  • tst_ecmascripttests
372
23}-
24-
25void BooleanPrototype::init(ExecutionEngine *engine, Object *ctor)-
26{-
27 Scope scope(engine);-
28 ScopedObject o(scope);-
29 ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1));-
30 ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));-
31 defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "constructor")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "constructor" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 98344 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 98344 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
  • ...
}()), (o = ctor));
98344
32 defineDefaultProperty(engine->id_toString(), method_toString);-
33 defineDefaultProperty(engine->id_valueOf(), method_valueOf);-
34}
executed 98956 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
  • ...
98956
35-
36static bool value(const Value *thisObject, bool *exception)-
37{-
38 *exception = false;-
39 if (thisObject->isBoolean()
thisObject->isBoolean()Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2362 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
) {
32-2362
40 return
executed 32 times by 1 test: return thisObject->booleanValue();
Executed by:
  • tst_ecmascripttests
thisObject->booleanValue();
executed 32 times by 1 test: return thisObject->booleanValue();
Executed by:
  • tst_ecmascripttests
32
41 } else {-
42 const BooleanObject *that = thisObject->as<BooleanObject>();-
43 if (that
thatDescription
TRUEevaluated 2280 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
80-2280
44 return
executed 2281 times by 2 tests: return that->value();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
that->value();
executed 2281 times by 2 tests: return that->value();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
2281
45 }
executed 80 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
80
46 *exception = true;-
47 return
executed 80 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
false;
executed 80 times by 1 test: return false;
Executed by:
  • tst_ecmascripttests
80
48}-
49-
50ReturnedValue BooleanPrototype::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int)-
51{-
52 bool exception;-
53 bool result = ::value(thisObject, &exception);-
54 ExecutionEngine *v4 = b->engine();-
55 if (exception
exceptionDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 268 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
40-268
56 return
executed 40 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
v4->throwTypeError();
executed 40 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
40
57-
58 return
executed 268 times by 1 test: return Encode(result ? v4->id_true() : v4->id_false());
Executed by:
  • tst_ecmascripttests
Encode(result ? v4->id_true() : v4->id_false());
executed 268 times by 1 test: return Encode(result ? v4->id_true() : v4->id_false());
Executed by:
  • tst_ecmascripttests
268
59}-
60-
61ReturnedValue BooleanPrototype::method_valueOf(const FunctionObject *b, const Value *thisObject, const Value *, int)-
62{-
63 bool exception;-
64 bool result = ::value(thisObject, &exception);-
65 if (exception
exceptionDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2048 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
) {
40-2048
66 ExecutionEngine *v4 = b->engine();-
67 return
executed 40 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
v4->throwTypeError();
executed 40 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
40
68 }-
69-
70 return
executed 2048 times by 2 tests: return Encode(result);
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
Encode(result);
executed 2048 times by 2 tests: return Encode(result);
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
2048
71}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0