Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4booleanobject.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | using namespace QV4; | - | ||||||
4 | - | |||||||
5 | const 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, }; | - | ||||||
6 | const 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 | - | |||||||
8 | void 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: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98632 times by 153 tests: }()));return qstring_literal_temp; Executed by:
| 98632 | ||||||
11 | } executed 99154 times by 153 tests: end of block Executed by:
| 99154 | ||||||
12 | - | |||||||
13 | ReturnedValue BooleanCtor::virtualCallAsConstructor(const FunctionObject *that, const Value *argv, int argc, const Value *) | - | ||||||
14 | { | - | ||||||
15 | bool n = argc
| 212-2673 | ||||||
16 | return executed 2887 times by 2 tests: Encode(that->engine()->newBooleanObject(n));return Encode(that->engine()->newBooleanObject(n)); Executed by:
executed 2887 times by 2 tests: return Encode(that->engine()->newBooleanObject(n)); Executed by:
| 2887 | ||||||
17 | } | - | ||||||
18 | - | |||||||
19 | ReturnedValue BooleanCtor::virtualCall(const FunctionObject *, const Value *, const Value *argv, int argc) | - | ||||||
20 | { | - | ||||||
21 | bool value = argc
| 16-356 | ||||||
22 | return executed 372 times by 1 test: Encode(value);return Encode(value); Executed by:
executed 372 times by 1 test: return Encode(value); Executed by:
| 372 | ||||||
23 | } | - | ||||||
24 | - | |||||||
25 | void 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: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 98344 times by 153 tests: }()), (o = ctor));return qstring_literal_temp; Executed by:
| 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:
| 98956 | ||||||
35 | - | |||||||
36 | static bool value(const Value *thisObject, bool *exception) | - | ||||||
37 | { | - | ||||||
38 | *exception = false; | - | ||||||
39 | if (thisObject->isBoolean()
| 32-2362 | ||||||
40 | return executed 32 times by 1 test: thisObject->booleanValue();return thisObject->booleanValue(); Executed by:
executed 32 times by 1 test: return thisObject->booleanValue(); Executed by:
| 32 | ||||||
41 | } else { | - | ||||||
42 | const BooleanObject *that = thisObject->as<BooleanObject>(); | - | ||||||
43 | if (that
| 80-2280 | ||||||
44 | return executed 2281 times by 2 tests: that->value();return that->value(); Executed by:
executed 2281 times by 2 tests: return that->value(); Executed by:
| 2281 | ||||||
45 | } executed 80 times by 1 test: end of block Executed by:
| 80 | ||||||
46 | *exception = true; | - | ||||||
47 | return executed 80 times by 1 test: false;return false; Executed by:
executed 80 times by 1 test: return false; Executed by:
| 80 | ||||||
48 | } | - | ||||||
49 | - | |||||||
50 | ReturnedValue 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
| 40-268 | ||||||
56 | return executed 40 times by 1 test: v4->throwTypeError();return v4->throwTypeError(); Executed by:
executed 40 times by 1 test: return v4->throwTypeError(); Executed by:
| 40 | ||||||
57 | - | |||||||
58 | return executed 268 times by 1 test: Encode(result ? v4->id_true() : v4->id_false());return Encode(result ? v4->id_true() : v4->id_false()); Executed by:
executed 268 times by 1 test: return Encode(result ? v4->id_true() : v4->id_false()); Executed by:
| 268 | ||||||
59 | } | - | ||||||
60 | - | |||||||
61 | ReturnedValue 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
| 40-2048 | ||||||
66 | ExecutionEngine *v4 = b->engine(); | - | ||||||
67 | return executed 40 times by 1 test: v4->throwTypeError();return v4->throwTypeError(); Executed by:
executed 40 times by 1 test: return v4->throwTypeError(); Executed by:
| 40 | ||||||
68 | } | - | ||||||
69 | - | |||||||
70 | return executed 2048 times by 2 tests: Encode(result);return Encode(result); Executed by:
executed 2048 times by 2 tests: return Encode(result); Executed by:
| 2048 | ||||||
71 | } | - | ||||||
Switch to Source code | Preprocessed file |