| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmllocale.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | using namespace QV4; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | const QV4::VTable QQmlLocaleData::static_vtbl = { (std::is_same<QQmlLocaleData::SuperClass, Object>::value) ? nullptr : &QQmlLocaleData::SuperClass::static_vtbl, (sizeof(QQmlLocaleData::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQmlLocaleData::Data) + (QQmlLocaleData::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQmlLocaleData::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQmlLocaleData::IsExecutionContext, QQmlLocaleData::IsString, QQmlLocaleData::IsObject, QQmlLocaleData::IsFunctionObject, QQmlLocaleData::IsErrorObject, QQmlLocaleData::IsArrayData, QQmlLocaleData::IsStringOrSymbol, QQmlLocaleData::MyType, { 0, 0, 0, 0 }, "QQmlLocaleData", QQmlLocaleData::virtualDestroy, QQmlLocaleData::Data::markObjects, QQmlLocaleData::virtualIsEqualTo, QQmlLocaleData::virtualGet, QQmlLocaleData::virtualPut, QQmlLocaleData::virtualDeleteProperty, QQmlLocaleData::virtualHasProperty, QQmlLocaleData::virtualGetOwnProperty, QQmlLocaleData::virtualDefineOwnProperty, QQmlLocaleData::virtualIsExtensible, QQmlLocaleData::virtualPreventExtensions, QQmlLocaleData::virtualGetPrototypeOf, QQmlLocaleData::virtualSetPrototypeOf, QQmlLocaleData::virtualGetLength, QQmlLocaleData::virtualAdvanceIterator, QQmlLocaleData::virtualInstanceOf, QQmlLocaleData::virtualCall, QQmlLocaleData::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | static bool isLocaleObject(const QV4::Value &val) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | return executed 596 times by 2 tests: val.as<QQmlLocaleData>();return val.as<QQmlLocaleData>();Executed by:
executed 596 times by 2 tests: return val.as<QQmlLocaleData>();Executed by:
| 596 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | void QQmlDateExtension::registerExtension(QV4::ExecutionEngine *engine) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | engine->datePrototype()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "toLocaleString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "toLocaleString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_toLocaleString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | engine->datePrototype()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "toLocaleTimeString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "toLocaleTimeString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_toLocaleTimeString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | engine->datePrototype()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "toLocaleDateString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "toLocaleDateString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_toLocaleDateString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | engine->dateCtor()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fromLocaleString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fromLocaleString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_fromLocaleString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | engine->dateCtor()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fromLocaleTimeString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fromLocaleTimeString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_fromLocaleTimeString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | engine->dateCtor()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fromLocaleDateString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fromLocaleDateString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_fromLocaleDateString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | engine->dateCtor()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "timeZoneUpdated")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "timeZoneUpdated" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_timeZoneUpdated);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | } executed 8784 times by 148 tests: end of blockExecuted by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | ReturnedValue QQmlDateExtension::method_toLocaleString(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | if (argc > 2
| 0-204 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | return never executed: QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | const QV4::DateObject *date = thisObject->as<DateObject>(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | if (!date
| 0-204 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | return never executed: QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | QDateTime dt = date->toQDateTime(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | if (argc == 0
| 12-192 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | return executed 12 times by 1 test: QV4::Encode(scope.engine->newString(locale.toString(dt)));return QV4::Encode(scope.engine->newString(locale.toString(dt)));Executed by:
executed 12 times by 1 test: return QV4::Encode(scope.engine->newString(locale.toString(dt)));Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | if (!isLocaleObject(argv[0])
| 0-192 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | return never executed: QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-192 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | QLocale::FormatType enumFormat = QLocale::LongFormat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | QString formattedDt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | if (argc == 2
| 12-180 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | if (String *s = argv[1].stringValue()
| 36-144 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | QString format = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | formattedDt = r->d()->locale->toString(dt, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } executed 144 times by 1 test: else if (argv[1].isNumber()end of blockExecuted by:
| 0-144 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | quint32 intFormat = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | QLocale::FormatType format = QLocale::FormatType(intFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | formattedDt = r->d()->locale->toString(dt, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } executed 36 times by 1 test: else {end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.toLocaleString(): Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.toLocaleString(): Invalid datetime format"));never executed: } while (false);return scope.engine->throwError(QString::fromUtf8("Locale: Date.toLocaleString(): Invalid datetime format")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | formattedDt = r->d()->locale->toString(dt, enumFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | return executed 192 times by 1 test: QV4::Encode(scope.engine->newString(formattedDt));return QV4::Encode(scope.engine->newString(formattedDt));Executed by:
executed 192 times by 1 test: return QV4::Encode(scope.engine->newString(formattedDt));Executed by:
| 192 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | ReturnedValue QQmlDateExtension::method_toLocaleTimeString(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | if (argc > 2
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | return never executed: QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | const QV4::DateObject *date = thisObject->as<DateObject>(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | if (!date
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | return never executed: QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | QDateTime dt = date->toQDateTime(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | QTime time = dt.time(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | if (argc == 0
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | return never executed: QV4::Encode(scope.engine->newString(locale.toString(time)));return QV4::Encode(scope.engine->newString(locale.toString(time)));never executed: return QV4::Encode(scope.engine->newString(locale.toString(time))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | if (!isLocaleObject(argv[0])
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | return never executed: QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleTimeString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | QLocale::FormatType enumFormat = QLocale::LongFormat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | QString formattedTime; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | if (argc == 2
| 16-36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | if (String *s = argv[1].stringValue()
| 0-36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | QString format = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | formattedTime = r->d()->locale->toString(time, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } never executed: else if (argv[1].isNumber()end of block
| 0-36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | quint32 intFormat = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | QLocale::FormatType format = QLocale::FormatType(intFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | formattedTime = r->d()->locale->toString(time, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | } executed 36 times by 1 test: else {end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.toLocaleTimeString(): Invalid time format"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.toLocaleTimeString(): Invalid time format"));never executed: } while (false);return scope.engine->throwError(QString::fromUtf8("Locale: Date.toLocaleTimeString(): Invalid time format")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | formattedTime = r->d()->locale->toString(time, enumFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | return executed 52 times by 2 tests: QV4::Encode(scope.engine->newString(formattedTime));return QV4::Encode(scope.engine->newString(formattedTime));Executed by:
executed 52 times by 2 tests: return QV4::Encode(scope.engine->newString(formattedTime));Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ReturnedValue QQmlDateExtension::method_toLocaleDateString(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | if (argc > 2
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | return never executed: QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | const QV4::DateObject *dateObj = thisObject->as<DateObject>(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | if (!dateObj
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | return never executed: QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | QDateTime dt = dateObj->toQDateTime(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | QDate date = dt.date(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | if (argc == 0
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | return never executed: QV4::Encode(scope.engine->newString(locale.toString(date)));return QV4::Encode(scope.engine->newString(locale.toString(date)));never executed: return QV4::Encode(scope.engine->newString(locale.toString(date))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | if (!isLocaleObject(argv[0])
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | return never executed: QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc);return QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc);never executed: return QV4::DatePrototype::method_toLocaleDateString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | QLocale::FormatType enumFormat = QLocale::LongFormat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | QString formattedDate; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | if (argc == 2
| 16-36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | if (String *s = argv[1].stringValue()
| 0-36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | QString format = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | formattedDate = r->d()->locale->toString(date, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } never executed: else if (argv[1].isNumber()end of block
| 0-36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | quint32 intFormat = argv[1].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | QLocale::FormatType format = QLocale::FormatType(intFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | formattedDate = r->d()->locale->toString(date, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } executed 36 times by 1 test: else {end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.loLocaleDateString(): Invalid date format"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.loLocaleDateString(): Invalid date format"));never executed: } while (false);return scope.engine->throwError(QString::fromUtf8("Locale: Date.loLocaleDateString(): Invalid date format")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | formattedDate = r->d()->locale->toString(date, enumFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | return executed 52 times by 2 tests: QV4::Encode(scope.engine->newString(formattedDate));return QV4::Encode(scope.engine->newString(formattedDate));Executed by:
executed 52 times by 2 tests: return QV4::Encode(scope.engine->newString(formattedDate));Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | ReturnedValue QQmlDateExtension::method_fromLocaleString(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | QV4::ExecutionEngine * const engine = scope.engine; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | if (argc == 1
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | if (String *s = argv[0].stringValue()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | QString dateString = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | QDateTime dt = locale.toDateTime(dateString); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | return never executed: QV4::Encode(engine->newDateObject(dt));return QV4::Encode(engine->newDateObject(dt));never executed: return QV4::Encode(engine->newDateObject(dt)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | if (argc < 1
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | QLocale::FormatType enumFormat = QLocale::LongFormat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | QDateTime dt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | QString dateString = argv[1].toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | if (argc == 3
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | if (String *s = argv[2].stringValue()
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | QString format = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | dt = r->d()->locale->toDateTime(dateString, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | } executed 18 times by 1 test: else if (argv[2].isNumber()end of blockExecuted by:
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | quint32 intFormat = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | QLocale::FormatType format = QLocale::FormatType(intFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | dt = r->d()->locale->toDateTime(dateString, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleString(): Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleString(): Invalid datetime format"));never executed: } while (false);return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleString(): Invalid datetime format")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | dt = r->d()->locale->toDateTime(dateString, enumFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | return executed 18 times by 1 test: QV4::Encode(engine->newDateObject(dt));return QV4::Encode(engine->newDateObject(dt));Executed by:
executed 18 times by 1 test: return QV4::Encode(engine->newDateObject(dt));Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | ReturnedValue QQmlDateExtension::method_fromLocaleTimeString(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | QV4::ExecutionEngine * const engine = scope.engine; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | if (argc == 1
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | if (String *s = argv[0].stringValue()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | QString timeString = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | QTime time = locale.toTime(timeString); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | QDateTime dt = QDateTime::currentDateTime(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | dt.setTime(time); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | return never executed: QV4::Encode(engine->newDateObject(dt));return QV4::Encode(engine->newDateObject(dt));never executed: return QV4::Encode(engine->newDateObject(dt)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | if (argc < 1
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleTimeString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleTimeString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleTimeString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | QLocale::FormatType enumFormat = QLocale::LongFormat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | QTime tm; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | QString dateString = argv[1].toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | if (argc == 3
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | if (String *s = argv[2].stringValue()
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | QString format = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | tm = r->d()->locale->toTime(dateString, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } executed 18 times by 1 test: else if (argv[2].isNumber()end of blockExecuted by:
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | quint32 intFormat = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | QLocale::FormatType format = QLocale::FormatType(intFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | tm = r->d()->locale->toTime(dateString, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleTimeString(): Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleTimeString(): Invalid datetime format"));never executed: } while (false);return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleTimeString(): Invalid datetime format")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | tm = r->d()->locale->toTime(dateString, enumFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | QDateTime dt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | if (tm.isValid()
| 6-12 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | dt = QDateTime::currentDateTime(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | dt.setTime(tm); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | return executed 18 times by 1 test: QV4::Encode(engine->newDateObject(dt));return QV4::Encode(engine->newDateObject(dt));Executed by:
executed 18 times by 1 test: return QV4::Encode(engine->newDateObject(dt));Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | ReturnedValue QQmlDateExtension::method_fromLocaleDateString(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | QV4::ExecutionEngine * const engine = scope.engine; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | if (argc == 1
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | if (String *s = argv[0].stringValue()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | QString dateString = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | QDate date = locale.toDate(dateString); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | return never executed: QV4::Encode(engine->newDateObject(QDateTime(date)));return QV4::Encode(engine->newDateObject(QDateTime(date)));never executed: return QV4::Encode(engine->newDateObject(QDateTime(date))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | if (argc < 1
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleDateString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleDateString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleDateString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | QLocale::FormatType enumFormat = QLocale::LongFormat; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | QDate dt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | QString dateString = argv[1].toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | if (argc == 3
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | if (String *s = argv[2].stringValue()
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | QString format = s->toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | dt = r->d()->locale->toDate(dateString, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | } executed 18 times by 1 test: else if (argv[2].isNumber()end of blockExecuted by:
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | quint32 intFormat = argv[2].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | QLocale::FormatType format = QLocale::FormatType(intFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | dt = r->d()->locale->toDate(dateString, format); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleDateString(): Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleDateString(): Invalid datetime format"));never executed: } while (false);return scope.engine->throwError(QString::fromUtf8("Locale: Date.fromLocaleDateString(): Invalid datetime format")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | dt = r->d()->locale->toDate(dateString, enumFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | return executed 18 times by 1 test: QV4::Encode(engine->newDateObject(QDateTime(dt)));return QV4::Encode(engine->newDateObject(QDateTime(dt)));Executed by:
executed 18 times by 1 test: return QV4::Encode(engine->newDateObject(QDateTime(dt)));Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | ReturnedValue QQmlDateExtension::method_timeZoneUpdated(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | if (argc != 0
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Date.timeZoneUpdated(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Date.timeZoneUpdated(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Date.timeZoneUpdated(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | QV4::DatePrototype::timezoneUpdated(scope.engine); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | return executed 4 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 4 times by 1 test: return QV4::Encode::undefined();Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | void QQmlNumberExtension::registerExtension(QV4::ExecutionEngine *engine) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | engine->numberPrototype()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "toLocaleString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "toLocaleString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_toLocaleString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | engine->numberPrototype()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "toLocaleCurrencyString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "toLocaleCurrencyString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_toLocaleCurrencyString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | engine->numberCtor()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "fromLocaleString")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "fromLocaleString" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_fromLocaleString);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | } executed 8784 times by 148 tests: end of blockExecuted by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | QV4::ReturnedValue QQmlNumberExtension::method_toLocaleString(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | if (argc > 3
| 0-212 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | double number = thisObject->toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | if (argc == 0
| 0-212 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | return never executed: QV4::Encode(scope.engine->newString(locale.toString(number)));return QV4::Encode(scope.engine->newString(locale.toString(number)));never executed: return QV4::Encode(scope.engine->newString(locale.toString(number))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | if (!isLocaleObject(argv[0])
| 0-212 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | return never executed: QV4::NumberPrototype::method_toLocaleString(b, thisObject, argv, argc);return QV4::NumberPrototype::method_toLocaleString(b, thisObject, argv, argc);never executed: return QV4::NumberPrototype::method_toLocaleString(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-212 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | quint16 format = 'f'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | if (argc > 1
| 16-196 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | if (!argv[1].isString()
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | QString fs = argv[1].toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | if (fs.length()
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | format = fs.at(0).unicode(); executed 16 times by 1 test: format = fs.at(0).unicode();Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | int prec = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | if (argc > 2
| 14-198 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | if (!argv[2].isNumber()
| 0-14 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | prec = argv[2].toInt32(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | return executed 212 times by 2 tests: QV4::Encode(scope.engine->newString(r->d()->locale->toString(number, (char)format, prec)));return QV4::Encode(scope.engine->newString(r->d()->locale->toString(number, (char)format, prec)));Executed by:
executed 212 times by 2 tests: return QV4::Encode(scope.engine->newString(r->d()->locale->toString(number, (char)format, prec)));Executed by:
| 212 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | ReturnedValue QQmlNumberExtension::method_toLocaleCurrencyString(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | if (argc > 2
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleCurrencyString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleCurrencyString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleCurrencyString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | double number = thisObject->toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | if (argc == 0
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | return never executed: QV4::Encode(scope.engine->newString(locale.toString(number)));return QV4::Encode(scope.engine->newString(locale.toString(number)));never executed: return QV4::Encode(scope.engine->newString(locale.toString(number))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | if (!isLocaleObject(argv[0])
| 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleCurrencyString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleCurrencyString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleCurrencyString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | QString symbol; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | if (argc > 1
| 2-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | if (!argv[1].isString()
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.toLocaleString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | symbol = argv[1].toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | return executed 18 times by 2 tests: QV4::Encode(scope.engine->newString(r->d()->locale->toCurrencyString(number, symbol)));return QV4::Encode(scope.engine->newString(r->d()->locale->toCurrencyString(number, symbol)));Executed by:
executed 18 times by 2 tests: return QV4::Encode(scope.engine->newString(r->d()->locale->toCurrencyString(number, symbol)));Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | ReturnedValue QQmlNumberExtension::method_fromLocaleString(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | if (argc < 1
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | int numberIdx = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | QLocale locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | if (argc == 2
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | if (!isLocaleObject(argv[0])
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | QV4::Scoped<QQmlLocaleData> r(scope, argv[0].as<QQmlLocaleData>()); if (!r
never executed: scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: }return scope.engine->throwError(QString::fromUtf8("Not a valid Locale object"));never executed: while (false);end of block | 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | locale = *r->d()->locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | numberIdx = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | QString ns = argv[numberIdx].toQString(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | if (!ns.length()
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | return never executed: QV4::Encode(QV4::Encode((::qQNaN())));return QV4::Encode(QV4::Encode((::qQNaN())));never executed: return QV4::Encode(QV4::Encode((::qQNaN()))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | bool ok = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | double val = locale.toDouble(ns, &ok); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | if (!ok
| 0-16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid format"));return scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid format"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Number.fromLocaleString(): Invalid format"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | return executed 16 times by 1 test: QV4::Encode(QV4::Encode(val));return QV4::Encode(QV4::Encode(val));Executed by:
executed 16 times by 1 test: return QV4::Encode(QV4::Encode(val));Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | ReturnedValue QQmlLocaleData::method_get_firstDayOfWeek(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | const QLocale *locale = getThisLocale(scope, thisObject); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | if (!locale
| 0-416 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | int fdow = int(locale->firstDayOfWeek()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | if (fdow == 7
| 34-382 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | fdow = 0; executed 382 times by 3 tests: fdow = 0;Executed by:
| 382 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | return executed 416 times by 3 tests: QV4::Encode(fdow);return QV4::Encode(fdow);Executed by:
executed 416 times by 3 tests: return QV4::Encode(fdow);Executed by:
| 416 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | ReturnedValue QQmlLocaleData::method_get_measurementSystem(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | const QLocale *locale = getThisLocale(scope, thisObject); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | if (!locale
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | return executed 412 times by 2 tests: QV4::Encode(locale->measurementSystem());return QV4::Encode(locale->measurementSystem());Executed by:
executed 412 times by 2 tests: return QV4::Encode(locale->measurementSystem());Executed by:
| 412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | ReturnedValue QQmlLocaleData::method_get_textDirection(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | const QLocale *locale = getThisLocale(scope, thisObject); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | if (!locale
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | return executed 412 times by 2 tests: QV4::Encode(locale->textDirection());return QV4::Encode(locale->textDirection());Executed by:
executed 412 times by 2 tests: return QV4::Encode(locale->textDirection());Executed by:
| 412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | ReturnedValue QQmlLocaleData::method_get_weekDays(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | const QLocale *locale = getThisLocale(scope, thisObject); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | if (!locale
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | QList<Qt::DayOfWeek> days = locale->weekdays(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | QV4::ScopedArrayObject result(scope, scope.engine->newArrayObject()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | result->arrayReserve(days.size()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | for (int i = 0; i < days.size()
| 412-2094 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | int day = days.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | if (day == 7
| 34-2060 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | day = 0; executed 34 times by 1 test: day = 0;Executed by:
| 34 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | result->arrayPut(i, QV4::Primitive::fromInt32(day)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | } executed 2094 times by 2 tests: end of blockExecuted by:
| 2094 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | result->setArrayLengthUnchecked(days.size()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | return executed 412 times by 2 tests: result.asReturnedValue();return result.asReturnedValue();Executed by:
executed 412 times by 2 tests: return result.asReturnedValue();Executed by:
| 412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | ReturnedValue QQmlLocaleData::method_get_uiLanguages(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | const QLocale *locale = getThisLocale(scope, thisObject); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | if (!locale
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | QStringList langs = locale->uiLanguages(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | QV4::ScopedArrayObject result(scope, scope.engine->newArrayObject()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | result->arrayReserve(langs.size()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | QV4::ScopedValue v(scope); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | for (int i = 0; i < langs.size()
| 412-994 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | result->arrayPut(i, (v = scope.engine->newString(langs.at(i)))); executed 994 times by 2 tests: result->arrayPut(i, (v = scope.engine->newString(langs.at(i))));Executed by:
| 994 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | result->setArrayLengthUnchecked(langs.size()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | return executed 412 times by 2 tests: result.asReturnedValue();return result.asReturnedValue();Executed by:
executed 412 times by 2 tests: return result.asReturnedValue();Executed by:
| 412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | ReturnedValue QQmlLocaleData::method_currencySymbol(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | const QLocale *locale = getThisLocale(scope, thisObject); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | if (!locale
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | if (argc > 1
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | do { return never executed: scope.engine->throwError(QString::fromUtf8("Locale: currencySymbol(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: currencySymbol(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: currencySymbol(): Invalid arguments"));never executed: while (false);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | QLocale::CurrencySymbolFormat format = QLocale::CurrencySymbol; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | if (argc == 1
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | quint32 intFormat = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | format = QLocale::CurrencySymbolFormat(intFormat); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | } executed 48 times by 1 test: end of blockExecuted by:
| 48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | return executed 48 times by 1 test: QV4::Encode(scope.engine->newString(locale->currencySymbol(format)));return QV4::Encode(scope.engine->newString(locale->currencySymbol(format)));Executed by:
executed 48 times by 1 test: return QV4::Encode(scope.engine->newString(locale->currencySymbol(format)));Executed by:
| 48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | ReturnedValue QQmlLocaleData::method_dateTimeFormat (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) { QV4::Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: if (argc > 1return Encode::undefined();
never executed: scope.engine->throwError(QString::fromUtf8("Locale: " "dateTimeFormat" "(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: " "dateTimeFormat" "(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: " "dateTimeFormat" "(): Invalid arguments"));never executed: while (false); QLocale::FormatType format = QLocale::LongFormat; if (argc == 1end of block
executed 36 times by 1 test: returnend of blockExecuted by:
executed 48 times by 1 test: QV4::Encode(scope.engine->newString(locale-> dateTimeFormat (format)));return QV4::Encode(scope.engine->newString(locale-> dateTimeFormat (format)));Executed by:
executed 48 times by 1 test: }return QV4::Encode(scope.engine->newString(locale-> dateTimeFormat (format)));Executed by:
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | ReturnedValue QQmlLocaleData::method_timeFormat (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) { QV4::Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: if (argc > 1return Encode::undefined();
never executed: scope.engine->throwError(QString::fromUtf8("Locale: " "timeFormat" "(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: " "timeFormat" "(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: " "timeFormat" "(): Invalid arguments"));never executed: while (false); QLocale::FormatType format = QLocale::LongFormat; if (argc == 1end of block
executed 36 times by 1 test: returnend of blockExecuted by:
executed 48 times by 1 test: QV4::Encode(scope.engine->newString(locale-> timeFormat (format)));return QV4::Encode(scope.engine->newString(locale-> timeFormat (format)));Executed by:
executed 48 times by 1 test: }return QV4::Encode(scope.engine->newString(locale-> timeFormat (format)));Executed by:
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | ReturnedValue QQmlLocaleData::method_dateFormat (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) { QV4::Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: if (argc > 1return Encode::undefined();
never executed: scope.engine->throwError(QString::fromUtf8("Locale: " "dateFormat" "(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: " "dateFormat" "(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: " "dateFormat" "(): Invalid arguments"));never executed: while (false); QLocale::FormatType format = QLocale::LongFormat; if (argc == 1end of block
executed 36 times by 1 test: returnend of blockExecuted by:
executed 48 times by 1 test: QV4::Encode(scope.engine->newString(locale-> dateFormat (format)));return QV4::Encode(scope.engine->newString(locale-> dateFormat (format)));Executed by:
executed 48 times by 1 test: }return QV4::Encode(scope.engine->newString(locale-> dateFormat (format)));Executed by:
| 0-48 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | ReturnedValue QQmlLocaleData::method_monthName (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: if (argc < 1return Encode::undefined();
never executed: scope.engine->throwError(QString::fromUtf8("Locale: " "monthName" "(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: " "monthName" "(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: " "monthName" "(): Invalid arguments"));never executed: while (false); QLocale::FormatType enumFormat = QLocale::LongFormat; int idx = argv[0].toInt32() + 1; if (idx < 1end of block
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid month"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid month"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid month"));never executed: while (false); QString name; if (argc == 2end of block
executed 576 times by 1 test: else { do { returnend of blockExecuted by:
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } while (false); }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } else { name = locale-> monthName(idx, enumFormat); }end of blocknever executed: returnend of blockexecuted 576 times by 1 test: QV4::Encode(scope.engine->newString(name));return QV4::Encode(scope.engine->newString(name));Executed by:
executed 576 times by 1 test: }return QV4::Encode(scope.engine->newString(name));Executed by:
| 0-576 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | ReturnedValue QQmlLocaleData::method_standaloneMonthName (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: if (argc < 1return Encode::undefined();
never executed: scope.engine->throwError(QString::fromUtf8("Locale: " "standaloneMonthName" "(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: " "standaloneMonthName" "(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: " "standaloneMonthName" "(): Invalid arguments"));never executed: while (false); QLocale::FormatType enumFormat = QLocale::LongFormat; int idx = argv[0].toInt32() + 1; if (idx < 1end of block
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid month"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid month"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid month"));never executed: while (false); QString name; if (argc == 2end of block
executed 576 times by 1 test: else { do { returnend of blockExecuted by:
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } while (false); }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } else { name = locale-> standaloneMonthName(idx, enumFormat); }end of blocknever executed: returnend of blockexecuted 576 times by 1 test: QV4::Encode(scope.engine->newString(name));return QV4::Encode(scope.engine->newString(name));Executed by:
executed 576 times by 1 test: }return QV4::Encode(scope.engine->newString(name));Executed by:
| 0-576 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | ReturnedValue QQmlLocaleData::method_dayName (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: if (argc < 1return Encode::undefined();
never executed: scope.engine->throwError(QString::fromUtf8("Locale: " "dayName" "(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: " "dayName" "(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: " "dayName" "(): Invalid arguments"));never executed: while (false); QLocale::FormatType enumFormat = QLocale::LongFormat; int idx = argv[0].toInt32(); if (idx < 0end of block
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid day"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid day"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid day"));never executed: while (false); if (idx == 0end of block
never executed: QString name; if (argc == 2idx = 7;
executed 336 times by 1 test: else { do { returnend of blockExecuted by:
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } while (false); }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } else { name = locale-> dayName(idx, enumFormat); }end of blocknever executed: returnend of blockexecuted 336 times by 1 test: QV4::Encode(scope.engine->newString(name));return QV4::Encode(scope.engine->newString(name));Executed by:
executed 336 times by 1 test: }return QV4::Encode(scope.engine->newString(name));Executed by:
| 0-336 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | ReturnedValue QQmlLocaleData::method_standaloneDayName (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: if (argc < 1return Encode::undefined();
never executed: scope.engine->throwError(QString::fromUtf8("Locale: " "standaloneDayName" "(): Invalid arguments"));return scope.engine->throwError(QString::fromUtf8("Locale: " "standaloneDayName" "(): Invalid arguments"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: " "standaloneDayName" "(): Invalid arguments"));never executed: while (false); QLocale::FormatType enumFormat = QLocale::LongFormat; int idx = argv[0].toInt32(); if (idx < 0end of block
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid day"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid day"));never executed: }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid day"));never executed: while (false); if (idx == 0end of block
executed 4 times by 1 test: QString name; if (argc == 2idx = 7;Executed by:
executed 336 times by 1 test: else { do { returnend of blockExecuted by:
never executed: scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } while (false); }return scope.engine->throwError(QString::fromUtf8("Locale: Invalid datetime format"));never executed: } else { name = locale-> standaloneDayName(idx, enumFormat); }end of blockexecuted 4 times by 1 test: returnend of blockExecuted by:
executed 340 times by 2 tests: QV4::Encode(scope.engine->newString(name));return QV4::Encode(scope.engine->newString(name));Executed by:
executed 340 times by 2 tests: }return QV4::Encode(scope.engine->newString(name));Executed by:
| 0-340 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | ReturnedValue QQmlLocaleData::method_get_name (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 434 times by 3 tests: QV4::Encode(scope.engine->newString(locale-> name()));return QV4::Encode(scope.engine->newString(locale-> name()));Executed by:
executed 434 times by 3 tests: }return QV4::Encode(scope.engine->newString(locale-> name()));Executed by:
| 0-434 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | ReturnedValue QQmlLocaleData::method_get_nativeLanguageName (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 434 times by 3 tests: QV4::Encode(scope.engine->newString(locale-> nativeLanguageName()));return QV4::Encode(scope.engine->newString(locale-> nativeLanguageName()));Executed by:
executed 434 times by 3 tests: }return QV4::Encode(scope.engine->newString(locale-> nativeLanguageName()));Executed by:
| 0-434 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | ReturnedValue QQmlLocaleData::method_get_nativeCountryName (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 434 times by 3 tests: QV4::Encode(scope.engine->newString(locale-> nativeCountryName()));return QV4::Encode(scope.engine->newString(locale-> nativeCountryName()));Executed by:
executed 434 times by 3 tests: }return QV4::Encode(scope.engine->newString(locale-> nativeCountryName()));Executed by:
| 0-434 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | ReturnedValue QQmlLocaleData::method_get_decimalPoint (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> decimalPoint()));return QV4::Encode(scope.engine->newString(locale-> decimalPoint()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> decimalPoint()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | ReturnedValue QQmlLocaleData::method_get_groupSeparator (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> groupSeparator()));return QV4::Encode(scope.engine->newString(locale-> groupSeparator()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> groupSeparator()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | ReturnedValue QQmlLocaleData::method_get_percent (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> percent()));return QV4::Encode(scope.engine->newString(locale-> percent()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> percent()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | ReturnedValue QQmlLocaleData::method_get_zeroDigit (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> zeroDigit()));return QV4::Encode(scope.engine->newString(locale-> zeroDigit()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> zeroDigit()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | ReturnedValue QQmlLocaleData::method_get_negativeSign (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> negativeSign()));return QV4::Encode(scope.engine->newString(locale-> negativeSign()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> negativeSign()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | ReturnedValue QQmlLocaleData::method_get_positiveSign (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> positiveSign()));return QV4::Encode(scope.engine->newString(locale-> positiveSign()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> positiveSign()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | ReturnedValue QQmlLocaleData::method_get_exponential (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> exponential()));return QV4::Encode(scope.engine->newString(locale-> exponential()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> exponential()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | ReturnedValue QQmlLocaleData::method_get_amText (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> amText()));return QV4::Encode(scope.engine->newString(locale-> amText()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> amText()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | ReturnedValue QQmlLocaleData::method_get_pmText (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { Scope scope(b); const QLocale *locale = getThisLocale(scope, thisObject); if (!locale
never executed: Encode::undefined();return Encode::undefined();never executed: returnreturn Encode::undefined();executed 412 times by 2 tests: QV4::Encode(scope.engine->newString(locale-> pmText()));return QV4::Encode(scope.engine->newString(locale-> pmText()));Executed by:
executed 412 times by 2 tests: }return QV4::Encode(scope.engine->newString(locale-> pmText()));Executed by:
| 0-412 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | class QV4LocaleDataDeletable : public QV8Engine::Deletable | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | public: | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | QV4LocaleDataDeletable(QV4::ExecutionEngine *engine); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | ~QV4LocaleDataDeletable(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | QV4::PersistentValue prototype; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | QV4LocaleDataDeletable::QV4LocaleDataDeletable(QV4::ExecutionEngine *engine) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | QV4::Scope scope(engine); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | QV4::Scoped<QV4::Object> o(scope, engine->newObject()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "dateFormat")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "dateFormat" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_dateFormat, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "standaloneDayName")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "standaloneDayName" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_standaloneDayName, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "standaloneMonthName")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "standaloneMonthName" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_standaloneMonthName, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "dayName")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "dayName" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_dayName, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "timeFormat")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "timeFormat" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_timeFormat, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "monthName")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "monthName" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_monthName, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "currencySymbol")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "currencySymbol" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_currencySymbol, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | o->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "dateTimeFormat")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "dateTimeFormat" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_dateTimeFormat, 0);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "name")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "name" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_name, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "positiveSign")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "positiveSign" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_positiveSign, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "uiLanguages")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "uiLanguages" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_uiLanguages, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "firstDayOfWeek")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "firstDayOfWeek" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_firstDayOfWeek, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "pmText")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "pmText" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_pmText, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "percent")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "percent" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_percent, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "textDirection")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "textDirection" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_textDirection, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "weekDays")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "weekDays" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_weekDays, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "negativeSign")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "negativeSign" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_negativeSign, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "groupSeparator")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "groupSeparator" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_groupSeparator, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "decimalPoint")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "decimalPoint" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_decimalPoint, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "nativeLanguageName")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "nativeLanguageName" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_nativeLanguageName, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "nativeCountryName")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "nativeCountryName" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_nativeCountryName, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "zeroDigit")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "zeroDigit" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_zeroDigit, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "amText")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "amText" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_amText, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "measurementSystem")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "measurementSystem" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_measurementSystem, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | o->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "exponential")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "exponential" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 6 times by 3 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 3 tests: }()), QQmlLocaleData::method_get_exponential, nullptr);return qstring_literal_temp;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | prototype.set(engine, o); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | } executed 6 times by 3 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | QV4LocaleDataDeletable::~QV4LocaleDataDeletable() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | static inline QV4LocaleDataDeletable *localeV4Data(QV4::ExecutionEngine *engine) { static int extensionId = -1; if (extensionId == -1
executed 6 times by 3 tests: QV8Engine::registrationMutex()->unlock(); }extensionId = QV8Engine::registerExtension();Executed by:
executed 6 times by 3 tests: QV4LocaleDataDeletable *rv = (QV4LocaleDataDeletable *)engine->v8Engine->extensionData(extensionId); if (!rvend of blockExecuted by:
executed 6 times by 3 tests: returnend of blockExecuted by:
executed 2086 times by 3 tests: rv;return rv;Executed by:
executed 2086 times by 3 tests: };return rv;Executed by:
| 0-2086 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | QQmlLocale::QQmlLocale() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | QQmlLocale::~QQmlLocale() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | QV4::ReturnedValue QQmlLocale::locale(ExecutionEngine *engine, const QString &localeName) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | QLocale qlocale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | if (!localeName.isEmpty()
| 992-1058 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | qlocale = localeName; executed 1058 times by 2 tests: qlocale = localeName;Executed by:
| 1058 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | return executed 2050 times by 2 tests: wrap(engine, qlocale);return wrap(engine, qlocale);Executed by:
executed 2050 times by 2 tests: return wrap(engine, qlocale);Executed by:
| 2050 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | QV4::ReturnedValue QQmlLocale::wrap(ExecutionEngine *v4, const QLocale &locale) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | QV4LocaleDataDeletable *d = localeV4Data(scope.engine); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | QV4::Scoped<QQmlLocaleData> wrapper(scope, v4->memoryManager->allocate<QQmlLocaleData>()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | *wrapper->d()->locale = locale; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | QV4::ScopedObject p(scope, d->prototype.value()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | wrapper->setPrototypeOf(p); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | return executed 2086 times by 3 tests: wrapper.asReturnedValue();return wrapper.asReturnedValue();Executed by:
executed 2086 times by 3 tests: return wrapper.asReturnedValue();Executed by:
| 2086 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | void QQmlLocale::registerStringLocaleCompare(QV4::ExecutionEngine *engine) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | engine->stringPrototype()->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "localeCompare")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "localeCompare" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 8784 times by 148 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 8784 times by 148 tests: }()), method_localeCompare);return qstring_literal_temp;Executed by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | } executed 8784 times by 148 tests: end of blockExecuted by:
| 8784 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | ReturnedValue QQmlLocale::method_localeCompare(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | if (argc != 1
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | return never executed: QV4::StringPrototype::method_localeCompare(b, thisObject, argv, argc);return QV4::StringPrototype::method_localeCompare(b, thisObject, argv, argc);never executed: return QV4::StringPrototype::method_localeCompare(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | if (!thisObject->isString()
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | return never executed: QV4::StringPrototype::method_localeCompare(b, thisObject, argv, argc);return QV4::StringPrototype::method_localeCompare(b, thisObject, argv, argc);never executed: return QV4::StringPrototype::method_localeCompare(b, thisObject, argv, argc); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | QString thisString = thisObject->toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | QString thatString = argv[0].toQStringNoThrow(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | return executed 52 times by 1 test: QV4::Encode(QString::localeAwareCompare(thisString, thatString));return QV4::Encode(QString::localeAwareCompare(thisString, thatString));Executed by:
executed 52 times by 1 test: return QV4::Encode(QString::localeAwareCompare(thisString, thatString));Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |