| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4objectproto.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | using namespace QV4; | - | ||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | const QV4::VTable ObjectCtor::static_vtbl = { (std::is_same<ObjectCtor::SuperClass, Object>::value) ? nullptr : &ObjectCtor::SuperClass::static_vtbl, (sizeof(ObjectCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(ObjectCtor::Data) + (ObjectCtor::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(ObjectCtor::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), ObjectCtor::IsExecutionContext, ObjectCtor::IsString, ObjectCtor::IsObject, ObjectCtor::IsFunctionObject, ObjectCtor::IsErrorObject, ObjectCtor::IsArrayData, ObjectCtor::IsStringOrSymbol, ObjectCtor::MyType, { 0, 0, 0, 0 }, "ObjectCtor", ObjectCtor::virtualDestroy, ObjectCtor::Data::markObjects, ObjectCtor::virtualIsEqualTo, ObjectCtor::virtualGet, ObjectCtor::virtualPut, ObjectCtor::virtualDeleteProperty, ObjectCtor::virtualHasProperty, ObjectCtor::virtualGetOwnProperty, ObjectCtor::virtualDefineOwnProperty, ObjectCtor::virtualIsExtensible, ObjectCtor::virtualPreventExtensions, ObjectCtor::virtualGetPrototypeOf, ObjectCtor::virtualSetPrototypeOf, ObjectCtor::virtualGetLength, ObjectCtor::virtualAdvanceIterator, ObjectCtor::virtualInstanceOf, ObjectCtor::virtualCall, ObjectCtor::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | void Heap::ObjectCtor::init(QV4::ExecutionContext *scope) | - | ||||||||||||||||||||||||
| 12 | { | - | ||||||||||||||||||||||||
| 13 | Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "Object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98774 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 98774 times by 153 tests: }()));return qstring_literal_temp;Executed by:
| 98774 | ||||||||||||||||||||||||
| 14 | } executed 98895 times by 153 tests: end of blockExecuted by:
| 98895 | ||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | ReturnedValue ObjectCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) | - | ||||||||||||||||||||||||
| 17 | { | - | ||||||||||||||||||||||||
| 18 | ExecutionEngine *v4 = f->engine(); | - | ||||||||||||||||||||||||
| 19 | const ObjectCtor *nt = static_cast<const ObjectCtor *>(newTarget); | - | ||||||||||||||||||||||||
| 20 | if (!argc
| 16-1931 | ||||||||||||||||||||||||
| 21 | Scope scope(v4); | - | ||||||||||||||||||||||||
| 22 | ScopedObject obj(scope, scope.engine->newObject()); | - | ||||||||||||||||||||||||
| 23 | ScopedObject proto(scope, nt->get(scope.engine->id_prototype())); | - | ||||||||||||||||||||||||
| 24 | if (!!proto
| 0-1976 | ||||||||||||||||||||||||
| 25 | obj->setPrototypeOf(proto); executed 1975 times by 10 tests: obj->setPrototypeOf(proto);Executed by:
| 1975 | ||||||||||||||||||||||||
| 26 | return executed 1980 times by 10 tests: obj.asReturnedValue();return obj.asReturnedValue();Executed by:
executed 1980 times by 10 tests: return obj.asReturnedValue();Executed by:
| 1980 | ||||||||||||||||||||||||
| 27 | } else { | - | ||||||||||||||||||||||||
| 28 | return executed 250 times by 2 tests: argv[0].toObject(v4)->asReturnedValue();return argv[0].toObject(v4)->asReturnedValue();Executed by:
executed 250 times by 2 tests: return argv[0].toObject(v4)->asReturnedValue();Executed by:
| 250 | ||||||||||||||||||||||||
| 29 | } | - | ||||||||||||||||||||||||
| 30 | } | - | ||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||
| 32 | ReturnedValue ObjectCtor::virtualCall(const FunctionObject *m, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 33 | { | - | ||||||||||||||||||||||||
| 34 | ExecutionEngine *v4 = m->engine(); | - | ||||||||||||||||||||||||
| 35 | if (!argc
| 8-483 | ||||||||||||||||||||||||
| 36 | return executed 36 times by 3 tests: v4->newObject()->asReturnedValue();return v4->newObject()->asReturnedValue();Executed by:
executed 36 times by 3 tests: return v4->newObject()->asReturnedValue();Executed by:
| 36 | ||||||||||||||||||||||||
| 37 | } else { | - | ||||||||||||||||||||||||
| 38 | return executed 463 times by 1 test: argv[0].toObject(v4)->asReturnedValue();return argv[0].toObject(v4)->asReturnedValue();Executed by:
executed 463 times by 1 test: return argv[0].toObject(v4)->asReturnedValue();Executed by:
| 463 | ||||||||||||||||||||||||
| 39 | } | - | ||||||||||||||||||||||||
| 40 | } | - | ||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | void ObjectPrototype::init(ExecutionEngine *v4, Object *ctor) | - | ||||||||||||||||||||||||
| 43 | { | - | ||||||||||||||||||||||||
| 44 | Scope scope(v4); | - | ||||||||||||||||||||||||
| 45 | ScopedObject o(scope, this); | - | ||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||
| 47 | ctor->defineReadonlyProperty(v4->id_prototype(), o); | - | ||||||||||||||||||||||||
| 48 | ctor->defineReadonlyConfigurableProperty(v4->id_length(), Primitive::fromInt32(1)); | - | ||||||||||||||||||||||||
| 49 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getPrototypeOf")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getPrototypeOf" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98420 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 98420 times by 153 tests: }()), method_getPrototypeOf, 1);return qstring_literal_temp;Executed by:
| 98420 | ||||||||||||||||||||||||
| 50 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getOwnPropertyDescriptor")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getOwnPropertyDescriptor" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98975 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 98975 times by 153 tests: }()), method_getOwnPropertyDescriptor, 2);return qstring_literal_temp;Executed by:
| 98975 | ||||||||||||||||||||||||
| 51 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getOwnPropertyNames")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getOwnPropertyNames" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99071 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99071 times by 153 tests: }()), method_getOwnPropertyNames, 1);return qstring_literal_temp;Executed by:
| 99071 | ||||||||||||||||||||||||
| 52 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "getOwnPropertySymbols")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "getOwnPropertySymbols" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99078 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99078 times by 153 tests: }()), method_getOwnPropertySymbols, 1);return qstring_literal_temp;Executed by:
| 99078 | ||||||||||||||||||||||||
| 53 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "assign")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "assign" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99054 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99054 times by 153 tests: }()), method_assign, 2);return qstring_literal_temp;Executed by:
| 99054 | ||||||||||||||||||||||||
| 54 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "create")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "create" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99021 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99021 times by 153 tests: }()), method_create, 2);return qstring_literal_temp;Executed by:
| 99021 | ||||||||||||||||||||||||
| 55 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "defineProperty")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "defineProperty" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98845 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 98845 times by 153 tests: }()), method_defineProperty, 3);return qstring_literal_temp;Executed by:
| 98845 | ||||||||||||||||||||||||
| 56 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "defineProperties")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "defineProperties" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99044 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99044 times by 153 tests: }()), method_defineProperties, 2);return qstring_literal_temp;Executed by:
| 99044 | ||||||||||||||||||||||||
| 57 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "seal")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "seal" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99040 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99040 times by 153 tests: }()), method_seal, 1);return qstring_literal_temp;Executed by:
| 99040 | ||||||||||||||||||||||||
| 58 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "freeze")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "freeze" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99087 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99087 times by 153 tests: }()), method_freeze, 1);return qstring_literal_temp;Executed by:
| 99087 | ||||||||||||||||||||||||
| 59 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "preventExtensions")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "preventExtensions" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99104 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99104 times by 153 tests: }()), method_preventExtensions, 1);return qstring_literal_temp;Executed by:
| 99104 | ||||||||||||||||||||||||
| 60 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "is")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "is" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99111 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99111 times by 153 tests: }()), method_is, 2);return qstring_literal_temp;Executed by:
| 99111 | ||||||||||||||||||||||||
| 61 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "isSealed")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "isSealed" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99120 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99120 times by 153 tests: }()), method_isSealed, 1);return qstring_literal_temp;Executed by:
| 99120 | ||||||||||||||||||||||||
| 62 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "isFrozen")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "isFrozen" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99101 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99101 times by 153 tests: }()), method_isFrozen, 1);return qstring_literal_temp;Executed by:
| 99101 | ||||||||||||||||||||||||
| 63 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "isExtensible")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "isExtensible" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98908 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 98908 times by 153 tests: }()), method_isExtensible, 1);return qstring_literal_temp;Executed by:
| 98908 | ||||||||||||||||||||||||
| 64 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "keys")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "keys" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99121 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99121 times by 153 tests: }()), method_keys, 1);return qstring_literal_temp;Executed by:
| 99121 | ||||||||||||||||||||||||
| 65 | ctor->defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "setPrototypeOf")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "setPrototypeOf" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99106 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99106 times by 153 tests: }()), method_setPrototypeOf, 2);return qstring_literal_temp;Executed by:
| 99106 | ||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||
| 67 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "constructor")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "constructor" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98899 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 98899 times by 153 tests: }()), (o = ctor));return qstring_literal_temp;Executed by:
| 98899 | ||||||||||||||||||||||||
| 68 | defineDefaultProperty(v4->id_toString(), method_toString, 0); | - | ||||||||||||||||||||||||
| 69 | 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 99038 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99038 times by 153 tests: }()), method_toLocaleString, 0);return qstring_literal_temp;Executed by:
| 99038 | ||||||||||||||||||||||||
| 70 | defineDefaultProperty(v4->id_valueOf(), method_valueOf, 0); | - | ||||||||||||||||||||||||
| 71 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "hasOwnProperty")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "hasOwnProperty" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99020 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99020 times by 153 tests: }()), method_hasOwnProperty, 1);return qstring_literal_temp;Executed by:
| 99020 | ||||||||||||||||||||||||
| 72 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "isPrototypeOf")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "isPrototypeOf" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99080 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99080 times by 153 tests: }()), method_isPrototypeOf, 1);return qstring_literal_temp;Executed by:
| 99080 | ||||||||||||||||||||||||
| 73 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "propertyIsEnumerable")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "propertyIsEnumerable" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99057 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99057 times by 153 tests: }()), method_propertyIsEnumerable, 1);return qstring_literal_temp;Executed by:
| 99057 | ||||||||||||||||||||||||
| 74 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "__defineGetter__")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "__defineGetter__" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 98847 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 98847 times by 153 tests: }()), method_defineGetter, 2);return qstring_literal_temp;Executed by:
| 98847 | ||||||||||||||||||||||||
| 75 | defineDefaultProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "__defineSetter__")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "__defineSetter__" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 99032 times by 153 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 99032 times by 153 tests: }()), method_defineSetter, 2);return qstring_literal_temp;Executed by:
| 99032 | ||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||
| 77 | defineAccessorProperty(v4->id___proto__(), method_get_proto, method_set_proto); | - | ||||||||||||||||||||||||
| 78 | } executed 98848 times by 153 tests: end of blockExecuted by:
| 98848 | ||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | ReturnedValue ObjectPrototype::method_getPrototypeOf(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 81 | { | - | ||||||||||||||||||||||||
| 82 | Scope scope(b); | - | ||||||||||||||||||||||||
| 83 | if (argc < 1
| 4-7771 | ||||||||||||||||||||||||
| 84 | return executed 4 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError();Executed by:
executed 4 times by 1 test: return scope.engine->throwTypeError();Executed by:
| 4 | ||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | ScopedObject o(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 87 | if (scope.engine->hasException
| 12-7756 | ||||||||||||||||||||||||
| 88 | return executed 12 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 12 times by 1 test: return QV4::Encode::undefined();Executed by:
| 12 | ||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | ScopedObject p(scope, o->getPrototypeOf()); | - | ||||||||||||||||||||||||
| 91 | return executed 7756 times by 2 tests: (!!p ? p->asReturnedValue() : Encode::null());return (!!p ? p->asReturnedValue() : Encode::null());Executed by:
executed 7756 times by 2 tests: return (!!p ? p->asReturnedValue() : Encode::null());Executed by:
| 7756 | ||||||||||||||||||||||||
| 92 | } | - | ||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||
| 94 | ReturnedValue ObjectPrototype::method_is(const FunctionObject *, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 95 | { | - | ||||||||||||||||||||||||
| 96 | if (!argc
| 4-340 | ||||||||||||||||||||||||
| 97 | return executed 4 times by 1 test: Encode(true);return Encode(true);Executed by:
executed 4 times by 1 test: return Encode(true);Executed by:
| 4 | ||||||||||||||||||||||||
| 98 | if (argc == 1
| 12-328 | ||||||||||||||||||||||||
| 99 | return executed 12 times by 1 test: Encode((argv[0].isUndefined() ? true : false));return Encode((argv[0].isUndefined() ? true : false));Executed by:
executed 12 times by 1 test: return Encode((argv[0].isUndefined() ? true : false));Executed by:
| 12 | ||||||||||||||||||||||||
| 100 | return executed 328 times by 1 test: Encode(argv[0].sameValue(argv[1]));return Encode(argv[0].sameValue(argv[1]));Executed by:
executed 328 times by 1 test: return Encode(argv[0].sameValue(argv[1]));Executed by:
| 328 | ||||||||||||||||||||||||
| 101 | } | - | ||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||
| 103 | ReturnedValue ObjectPrototype::method_getOwnPropertyDescriptor(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 104 | { | - | ||||||||||||||||||||||||
| 105 | Scope scope(b); | - | ||||||||||||||||||||||||
| 106 | if (argc < 1
| 0-25145 | ||||||||||||||||||||||||
| 107 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||
| 109 | ScopedObject O(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 110 | if (scope.engine->hasException
| 16-25078 | ||||||||||||||||||||||||
| 111 | return executed 16 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 16 times by 1 test: return QV4::Encode::undefined();Executed by:
| 16 | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | if (ArgumentsObject::isNonStrictArgumentsObject(O)
| 771-24367 | ||||||||||||||||||||||||
| 114 | static_cast< executed 769 times by 1 test: ArgumentsObject *>(O.getPointer())->fullyCreate();static_cast<ArgumentsObject *>(O.getPointer())->fullyCreate();Executed by:
executed 769 times by 1 test: static_cast<ArgumentsObject *>(O.getPointer())->fullyCreate();Executed by:
| 769 | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | ScopedValue v(scope, argc > 1 ? argv[1] : Primitive::undefinedValue()); | - | ||||||||||||||||||||||||
| 117 | ScopedPropertyKey name(scope, v->toPropertyKey(scope.engine)); | - | ||||||||||||||||||||||||
| 118 | if (scope.engine->hasException
| 8-25160 | ||||||||||||||||||||||||
| 119 | return executed 8 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 1 test: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||
| 121 | ScopedProperty desc(scope); | - | ||||||||||||||||||||||||
| 122 | PropertyAttributes attrs = O->getOwnProperty(name, desc); | - | ||||||||||||||||||||||||
| 123 | return executed 25131 times by 1 test: fromPropertyDescriptor(scope.engine, desc, attrs);return fromPropertyDescriptor(scope.engine, desc, attrs);Executed by:
executed 25131 times by 1 test: return fromPropertyDescriptor(scope.engine, desc, attrs);Executed by:
| 25131 | ||||||||||||||||||||||||
| 124 | } | - | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | ReturnedValue ObjectPrototype::method_getOwnPropertyNames(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 127 | { | - | ||||||||||||||||||||||||
| 128 | Scope scope(b); | - | ||||||||||||||||||||||||
| 129 | if (argc < 1
| 0-268 | ||||||||||||||||||||||||
| 130 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||
| 132 | ScopedObject O(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 133 | if (scope.engine->hasException
| 8-260 | ||||||||||||||||||||||||
| 134 | return executed 8 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 1 test: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||
| 136 | return executed 261 times by 2 tests: Encode(getOwnPropertyNames(scope.engine, argv[0]));return Encode(getOwnPropertyNames(scope.engine, argv[0]));Executed by:
executed 261 times by 2 tests: return Encode(getOwnPropertyNames(scope.engine, argv[0]));Executed by:
| 261 | ||||||||||||||||||||||||
| 137 | } | - | ||||||||||||||||||||||||
| 138 | - | |||||||||||||||||||||||||
| 139 | ReturnedValue ObjectPrototype::method_getOwnPropertySymbols(const FunctionObject *f, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 140 | { | - | ||||||||||||||||||||||||
| 141 | Scope scope(f); | - | ||||||||||||||||||||||||
| 142 | if (!argc
| 0-24 | ||||||||||||||||||||||||
| 143 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 144 | - | |||||||||||||||||||||||||
| 145 | ScopedObject O(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 146 | if (!O
| 0-24 | ||||||||||||||||||||||||
| 147 | return never executed: Encode::undefined();return Encode::undefined();never executed: return Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 148 | Heap::InternalClass *ic = O->d()->internalClass; | - | ||||||||||||||||||||||||
| 149 | ScopedValue n(scope); | - | ||||||||||||||||||||||||
| 150 | ScopedArrayObject array(scope, scope.engine->newArrayObject()); | - | ||||||||||||||||||||||||
| 151 | for (uint i = 0; i < ic->size
| 24-60 | ||||||||||||||||||||||||
| 152 | PropertyKey id = ic->nameMap.at(i); | - | ||||||||||||||||||||||||
| 153 | n = id.asStringOrSymbol(); | - | ||||||||||||||||||||||||
| 154 | if (!n
| 0-60 | ||||||||||||||||||||||||
| 155 | continue; executed 28 times by 1 test: continue;Executed by:
| 28 | ||||||||||||||||||||||||
| 156 | array->push_back(n); | - | ||||||||||||||||||||||||
| 157 | } executed 32 times by 1 test: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||
| 158 | return executed 24 times by 1 test: array->asReturnedValue();return array->asReturnedValue();Executed by:
executed 24 times by 1 test: return array->asReturnedValue();Executed by:
| 24 | ||||||||||||||||||||||||
| 159 | } | - | ||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||
| 162 | ReturnedValue ObjectPrototype::method_assign(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 163 | { | - | ||||||||||||||||||||||||
| 164 | Scope scope(b); | - | ||||||||||||||||||||||||
| 165 | if (argc < 1
| 0-84 | ||||||||||||||||||||||||
| 166 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 167 | - | |||||||||||||||||||||||||
| 168 | ScopedObject to(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 169 | if (scope.engine->hasException
| 8-76 | ||||||||||||||||||||||||
| 170 | return executed 8 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 1 test: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||
| 172 | if (argc == 1
| 4-72 | ||||||||||||||||||||||||
| 173 | return executed 4 times by 1 test: to.asReturnedValue();return to.asReturnedValue();Executed by:
executed 4 times by 1 test: return to.asReturnedValue();Executed by:
| 4 | ||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||
| 175 | for (int i = 1, ei = argc; i < ei
| 56-120 | ||||||||||||||||||||||||
| 176 | if (argv[i].isUndefined()
| 8-112 | ||||||||||||||||||||||||
| 177 | continue; executed 16 times by 1 test: continue;Executed by:
| 16 | ||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||
| 179 | ScopedObject from(scope, argv[i].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 180 | if (scope.engine->hasException
| 0-104 | ||||||||||||||||||||||||
| 181 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 182 | QV4::ScopedArrayObject keys(scope, QV4::ObjectPrototype::getOwnPropertyNames(scope.engine, from)); | - | ||||||||||||||||||||||||
| 183 | quint32 length = keys->getLength(); | - | ||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||
| 185 | ScopedString nextKey(scope); | - | ||||||||||||||||||||||||
| 186 | ScopedValue propValue(scope); | - | ||||||||||||||||||||||||
| 187 | for (quint32 i = 0; i < length
| 88-144 | ||||||||||||||||||||||||
| 188 | nextKey = Value::fromReturnedValue(keys->get(i)).toString(scope.engine); | - | ||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||
| 190 | ScopedProperty prop(scope); | - | ||||||||||||||||||||||||
| 191 | PropertyAttributes attrs = from->getOwnProperty(nextKey->toPropertyKey(), prop); | - | ||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||
| 193 | if (attrs == PropertyFlag::Attr_Invalid
| 0-144 | ||||||||||||||||||||||||
| 194 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||
| 196 | if (!attrs.isEnumerable()
| 24-120 | ||||||||||||||||||||||||
| 197 | continue; executed 24 times by 1 test: continue;Executed by:
| 24 | ||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||
| 199 | propValue = from->get(nextKey); | - | ||||||||||||||||||||||||
| 200 | to->set(nextKey, propValue, Object::DoThrowOnRejection); | - | ||||||||||||||||||||||||
| 201 | if (scope.engine->hasException
| 16-104 | ||||||||||||||||||||||||
| 202 | return executed 16 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 16 times by 1 test: return QV4::Encode::undefined();Executed by:
| 16 | ||||||||||||||||||||||||
| 203 | } executed 104 times by 1 test: end of blockExecuted by:
| 104 | ||||||||||||||||||||||||
| 204 | } executed 88 times by 1 test: end of blockExecuted by:
| 88 | ||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||
| 206 | return executed 56 times by 1 test: to.asReturnedValue();return to.asReturnedValue();Executed by:
executed 56 times by 1 test: return to.asReturnedValue();Executed by:
| 56 | ||||||||||||||||||||||||
| 207 | } | - | ||||||||||||||||||||||||
| 208 | - | |||||||||||||||||||||||||
| 209 | ReturnedValue ObjectPrototype::method_create(const FunctionObject *builtin, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 210 | { | - | ||||||||||||||||||||||||
| 211 | Scope scope(builtin); | - | ||||||||||||||||||||||||
| 212 | if (!argc
| 0-1587 | ||||||||||||||||||||||||
| 213 | return executed 16 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError();Executed by:
executed 16 times by 1 test: return scope.engine->throwTypeError();Executed by:
| 16 | ||||||||||||||||||||||||
| 214 | - | |||||||||||||||||||||||||
| 215 | ScopedObject O(scope, argv[0]); | - | ||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | ScopedObject newObject(scope, scope.engine->newObject()); | - | ||||||||||||||||||||||||
| 218 | newObject->setPrototypeOf(O); | - | ||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||
| 220 | - | |||||||||||||||||||||||||
| 221 | if (argc > 1
| 4-1215 | ||||||||||||||||||||||||
| 222 | Value *arguments = scope.alloc(argc); | - | ||||||||||||||||||||||||
| 223 | arguments[0] = newObject; | - | ||||||||||||||||||||||||
| 224 | memcpy(arguments + 1, argv + 1, (argc - 1)*sizeof(Value)); | - | ||||||||||||||||||||||||
| 225 | return executed 1206 times by 1 test: method_defineProperties(builtin, thisObject, arguments, argc);return method_defineProperties(builtin, thisObject, arguments, argc);Executed by:
executed 1206 times by 1 test: return method_defineProperties(builtin, thisObject, arguments, argc);Executed by:
| 1206 | ||||||||||||||||||||||||
| 226 | } | - | ||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | return executed 370 times by 2 tests: newObject.asReturnedValue();return newObject.asReturnedValue();Executed by:
executed 370 times by 2 tests: return newObject.asReturnedValue();Executed by:
| 370 | ||||||||||||||||||||||||
| 229 | } | - | ||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 | ReturnedValue ObjectPrototype::method_defineProperty(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 232 | { | - | ||||||||||||||||||||||||
| 233 | Scope scope(b); | - | ||||||||||||||||||||||||
| 234 | if (!argc
| 0-16110 | ||||||||||||||||||||||||
| 235 | return executed 20 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError();Executed by:
executed 20 times by 1 test: return scope.engine->throwTypeError();Executed by:
| 20 | ||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||
| 237 | ScopedObject O(scope, argv[0]); | - | ||||||||||||||||||||||||
| 238 | ScopedPropertyKey name(scope, (argc > 1 ? argv[1] : Primitive::undefinedValue()).toPropertyKey(scope.engine)); | - | ||||||||||||||||||||||||
| 239 | if (scope.engine->hasException
| 4-16112 | ||||||||||||||||||||||||
| 240 | 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 | ||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||
| 242 | ScopedValue attributes(scope, argc > 2 ? argv[2] : Primitive::undefinedValue()); | - | ||||||||||||||||||||||||
| 243 | ScopedProperty pd(scope); | - | ||||||||||||||||||||||||
| 244 | PropertyAttributes attrs; | - | ||||||||||||||||||||||||
| 245 | toPropertyDescriptor(scope.engine, attributes, pd, &attrs); | - | ||||||||||||||||||||||||
| 246 | if (scope.engine->hasException
| 76-16080 | ||||||||||||||||||||||||
| 247 | return executed 76 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 76 times by 1 test: return QV4::Encode::undefined();Executed by:
| 76 | ||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||
| 249 | if (!O->defineOwnProperty(name, pd, attrs)
| 989-15073 | ||||||||||||||||||||||||
| 250 | return executed 989 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError();Executed by:
executed 989 times by 1 test: return scope.engine->throwTypeError();Executed by:
| 989 | ||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | return executed 15058 times by 3 tests: O.asReturnedValue();return O.asReturnedValue();Executed by:
executed 15058 times by 3 tests: return O.asReturnedValue();Executed by:
| 15058 | ||||||||||||||||||||||||
| 253 | } | - | ||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||
| 255 | ReturnedValue ObjectPrototype::method_defineProperties(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 256 | { | - | ||||||||||||||||||||||||
| 257 | Scope scope(b); | - | ||||||||||||||||||||||||
| 258 | if (argc < 2
| 0-3680 | ||||||||||||||||||||||||
| 259 | return executed 20 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError();Executed by:
executed 20 times by 1 test: return scope.engine->throwTypeError();Executed by:
| 20 | ||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 | ScopedObject O(scope, argv[0]); | - | ||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||
| 263 | ScopedObject o(scope, argv[1].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 264 | if (scope.engine->hasException
| 12-3644 | ||||||||||||||||||||||||
| 265 | return executed 12 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 12 times by 1 test: return QV4::Encode::undefined();Executed by:
| 12 | ||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||
| 267 | ScopedValue val(scope); | - | ||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | ObjectIterator it(scope, o, ObjectIterator::EnumerableOnly); | - | ||||||||||||||||||||||||
| 270 | ScopedStringOrSymbol name(scope); | - | ||||||||||||||||||||||||
| 271 | ScopedProperty pd(scope); | - | ||||||||||||||||||||||||
| 272 | ScopedProperty n(scope); | - | ||||||||||||||||||||||||
| 273 | while (1) { | - | ||||||||||||||||||||||||
| 274 | uint index; | - | ||||||||||||||||||||||||
| 275 | PropertyAttributes attrs; | - | ||||||||||||||||||||||||
| 276 | it.next(name.getRef(), &index, pd, &attrs); | - | ||||||||||||||||||||||||
| 277 | if (attrs.isEmpty()
| 2952-3688 | ||||||||||||||||||||||||
| 278 | break; executed 2953 times by 1 test: break;Executed by:
| 2953 | ||||||||||||||||||||||||
| 279 | PropertyAttributes nattrs; | - | ||||||||||||||||||||||||
| 280 | val = o->getValue(pd->value, attrs); | - | ||||||||||||||||||||||||
| 281 | toPropertyDescriptor(scope.engine, val, n, &nattrs); | - | ||||||||||||||||||||||||
| 282 | if (scope.engine->hasException
| 169-3528 | ||||||||||||||||||||||||
| 283 | return executed 167 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 167 times by 1 test: return QV4::Encode::undefined();Executed by:
| 167 | ||||||||||||||||||||||||
| 284 | bool ok; | - | ||||||||||||||||||||||||
| 285 | if (name
| 466-3055 | ||||||||||||||||||||||||
| 286 | ok = O->defineOwnProperty(name->toPropertyKey(), n, nattrs); executed 3054 times by 1 test: ok = O->defineOwnProperty(name->toPropertyKey(), n, nattrs);Executed by:
| 3054 | ||||||||||||||||||||||||
| 287 | else | - | ||||||||||||||||||||||||
| 288 | ok = O->defineOwnProperty(PropertyKey::fromArrayIndex(index), n, nattrs); executed 466 times by 1 test: ok = O->defineOwnProperty(PropertyKey::fromArrayIndex(index), n, nattrs);Executed by:
| 466 | ||||||||||||||||||||||||
| 289 | if (!ok
| 531-2992 | ||||||||||||||||||||||||
| 290 | return executed 531 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError();Executed by:
executed 531 times by 1 test: return scope.engine->throwTypeError();Executed by:
| 531 | ||||||||||||||||||||||||
| 291 | } executed 2993 times by 1 test: end of blockExecuted by:
| 2993 | ||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||
| 293 | return executed 2939 times by 1 test: O.asReturnedValue();return O.asReturnedValue();Executed by:
executed 2939 times by 1 test: return O.asReturnedValue();Executed by:
| 2939 | ||||||||||||||||||||||||
| 294 | } | - | ||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||
| 296 | ReturnedValue ObjectPrototype::method_seal(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 297 | { | - | ||||||||||||||||||||||||
| 298 | const Value a = argc
| 0-173 | ||||||||||||||||||||||||
| 299 | if (!a.isObject()
| 20-154 | ||||||||||||||||||||||||
| 300 | - | |||||||||||||||||||||||||
| 301 | return executed 20 times by 1 test: a.asReturnedValue();return a.asReturnedValue();Executed by:
executed 20 times by 1 test: return a.asReturnedValue();Executed by:
| 20 | ||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||
| 303 | Scope scope(b); | - | ||||||||||||||||||||||||
| 304 | ScopedObject o(scope, a); | - | ||||||||||||||||||||||||
| 305 | o->setInternalClass(o->internalClass()->sealed()); | - | ||||||||||||||||||||||||
| 306 | - | |||||||||||||||||||||||||
| 307 | if (o->arrayData()
| 8-148 | ||||||||||||||||||||||||
| 308 | ArrayData::ensureAttributes(o); | - | ||||||||||||||||||||||||
| 309 | for (uint i = 0; i < o->d()->arrayData->values.alloc
| 8-64 | ||||||||||||||||||||||||
| 310 | if (!o->arrayData()->isEmpty(i)
| 8-56 | ||||||||||||||||||||||||
| 311 | o->d()->arrayData->attrs[i].setConfigurable(false); executed 8 times by 1 test: o->d()->arrayData->attrs[i].setConfigurable(false);Executed by:
| 8 | ||||||||||||||||||||||||
| 312 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||
| 313 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||
| 315 | return executed 155 times by 1 test: o.asReturnedValue();return o.asReturnedValue();Executed by:
executed 155 times by 1 test: return o.asReturnedValue();Executed by:
| 155 | ||||||||||||||||||||||||
| 316 | } | - | ||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||
| 318 | ReturnedValue ObjectPrototype::method_freeze(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 319 | { | - | ||||||||||||||||||||||||
| 320 | const Value a = argc
| 0-236 | ||||||||||||||||||||||||
| 321 | if (!a.isObject()
| 24-212 | ||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | return executed 24 times by 1 test: a.asReturnedValue();return a.asReturnedValue();Executed by:
executed 24 times by 1 test: return a.asReturnedValue();Executed by:
| 24 | ||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||
| 325 | Scope scope(b); | - | ||||||||||||||||||||||||
| 326 | ScopedObject o(scope, a); | - | ||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||
| 328 | if (ArgumentsObject::isNonStrictArgumentsObject(o)
| 6-206 | ||||||||||||||||||||||||
| 329 | static_cast< executed 6 times by 1 test: ArgumentsObject *>(o.getPointer())->fullyCreate();static_cast<ArgumentsObject *>(o.getPointer())->fullyCreate();Executed by:
executed 6 times by 1 test: static_cast<ArgumentsObject *>(o.getPointer())->fullyCreate();Executed by:
| 6 | ||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||
| 331 | o->setInternalClass(o->internalClass()->frozen()); | - | ||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||
| 333 | if (o->arrayData()
| 36-176 | ||||||||||||||||||||||||
| 334 | ArrayData::ensureAttributes(o); | - | ||||||||||||||||||||||||
| 335 | for (uint i = 0; i < o->arrayData()->values.alloc
| 36-4352 | ||||||||||||||||||||||||
| 336 | if (!o->arrayData()->isEmpty(i)
| 72-4280 | ||||||||||||||||||||||||
| 337 | o->arrayData()->attrs[i].setConfigurable(false); executed 72 times by 1 test: o->arrayData()->attrs[i].setConfigurable(false);Executed by:
| 72 | ||||||||||||||||||||||||
| 338 | if (o->arrayData()->attrs[i].isData()
| 264-4088 | ||||||||||||||||||||||||
| 339 | o->arrayData()->attrs[i].setWritable(false); executed 4088 times by 1 test: o->arrayData()->attrs[i].setWritable(false);Executed by:
| 4088 | ||||||||||||||||||||||||
| 340 | } executed 4352 times by 1 test: end of blockExecuted by:
| 4352 | ||||||||||||||||||||||||
| 341 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 342 | return executed 212 times by 2 tests: o.asReturnedValue();return o.asReturnedValue();Executed by:
executed 212 times by 2 tests: return o.asReturnedValue();Executed by:
| 212 | ||||||||||||||||||||||||
| 343 | } | - | ||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||
| 345 | ReturnedValue ObjectPrototype::method_preventExtensions(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 346 | { | - | ||||||||||||||||||||||||
| 347 | Scope scope(b); | - | ||||||||||||||||||||||||
| 348 | if (!argc
| 0-863 | ||||||||||||||||||||||||
| 349 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 350 | - | |||||||||||||||||||||||||
| 351 | ScopedObject o(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 352 | if (!o
| 8-856 | ||||||||||||||||||||||||
| 353 | return executed 8 times by 1 test: argv[0].asReturnedValue();return argv[0].asReturnedValue();Executed by:
executed 8 times by 1 test: return argv[0].asReturnedValue();Executed by:
| 8 | ||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 | o->preventExtensions(); | - | ||||||||||||||||||||||||
| 356 | return executed 855 times by 1 test: o.asReturnedValue();return o.asReturnedValue();Executed by:
executed 855 times by 1 test: return o.asReturnedValue();Executed by:
| 855 | ||||||||||||||||||||||||
| 357 | } | - | ||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||
| 359 | ReturnedValue ObjectPrototype::method_isSealed(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 360 | { | - | ||||||||||||||||||||||||
| 361 | Scope scope(b); | - | ||||||||||||||||||||||||
| 362 | if (!argc
| 0-163 | ||||||||||||||||||||||||
| 363 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 364 | - | |||||||||||||||||||||||||
| 365 | ScopedObject o(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 366 | if (!o
| 0-162 | ||||||||||||||||||||||||
| 367 | return never executed: Encode(true);return Encode(true);never executed: return Encode(true); | 0 | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | if (o->isExtensible()
| 48-116 | ||||||||||||||||||||||||
| 370 | return executed 115 times by 1 test: Encode(false);return Encode(false);Executed by:
executed 115 times by 1 test: return Encode(false);Executed by:
| 115 | ||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||
| 372 | if (o->internalClass() != o->internalClass()->sealed()
| 0-48 | ||||||||||||||||||||||||
| 373 | return never executed: Encode(false);return Encode(false);never executed: return Encode(false); | 0 | ||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||
| 375 | if (!o->arrayData()
| 2-42 | ||||||||||||||||||||||||
| 376 | return executed 44 times by 1 test: Encode(true);return Encode(true);Executed by:
executed 44 times by 1 test: return Encode(true);Executed by:
| 44 | ||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||
| 378 | ((o->arrayData() && o->arrayData()->length()) ? static_cast<void>(0) : qt_assert("o->arrayData() && o->arrayData()->length()", __FILE__, 428)); | - | ||||||||||||||||||||||||
| 379 | if (!o->arrayData()->attrs
| 0-4 | ||||||||||||||||||||||||
| 380 | return never executed: Encode(false);return Encode(false);never executed: return Encode(false); | 0 | ||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||
| 382 | for (uint i = 0; i < o->arrayData()->values.alloc
| 4-32 | ||||||||||||||||||||||||
| 383 | if (!o->arrayData()->isEmpty(i)
| 8-24 | ||||||||||||||||||||||||
| 384 | if (o->arrayData()->attributes(i).isConfigurable()
| 0-8 | ||||||||||||||||||||||||
| 385 | return never executed: Encode(false);return Encode(false);never executed: return Encode(false); | 0 | ||||||||||||||||||||||||
| 386 | } executed 32 times by 1 test: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||
| 387 | - | |||||||||||||||||||||||||
| 388 | return executed 4 times by 1 test: Encode(true);return Encode(true);Executed by:
executed 4 times by 1 test: return Encode(true);Executed by:
| 4 | ||||||||||||||||||||||||
| 389 | } | - | ||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||
| 391 | ReturnedValue ObjectPrototype::method_isFrozen(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 392 | { | - | ||||||||||||||||||||||||
| 393 | Scope scope(b); | - | ||||||||||||||||||||||||
| 394 | if (!argc
| 0-272 | ||||||||||||||||||||||||
| 395 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||
| 397 | ScopedObject o(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 398 | if (!o
| 8-263 | ||||||||||||||||||||||||
| 399 | return executed 8 times by 1 test: Encode(true);return Encode(true);Executed by:
executed 8 times by 1 test: return Encode(true);Executed by:
| 8 | ||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | if (o->isExtensible()
| 127-136 | ||||||||||||||||||||||||
| 402 | return executed 127 times by 1 test: Encode(false);return Encode(false);Executed by:
executed 127 times by 1 test: return Encode(false);Executed by:
| 127 | ||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||
| 404 | if (o->internalClass() != o->internalClass()->frozen()
| 60-76 | ||||||||||||||||||||||||
| 405 | return executed 60 times by 1 test: Encode(false);return Encode(false);Executed by:
executed 60 times by 1 test: return Encode(false);Executed by:
| 60 | ||||||||||||||||||||||||
| 406 | - | |||||||||||||||||||||||||
| 407 | if (!o->arrayData()
| 4-56 | ||||||||||||||||||||||||
| 408 | return executed 60 times by 1 test: Encode(true);return Encode(true);Executed by:
executed 60 times by 1 test: return Encode(true);Executed by:
| 60 | ||||||||||||||||||||||||
| 409 | - | |||||||||||||||||||||||||
| 410 | ((o->arrayData() && o->arrayData()->length()) ? static_cast<void>(0) : qt_assert("o->arrayData() && o->arrayData()->length()", __FILE__, 460)); | - | ||||||||||||||||||||||||
| 411 | if (!o->arrayData()->attrs
| 0-16 | ||||||||||||||||||||||||
| 412 | return never executed: Encode(false);return Encode(false);never executed: return Encode(false); | 0 | ||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | for (uint i = 0; i < o->arrayData()->values.alloc
| 16-4192 | ||||||||||||||||||||||||
| 415 | if (!o->arrayData()->isEmpty(i)
| 40-4152 | ||||||||||||||||||||||||
| 416 | if (o->arrayData()->attributes(i).isConfigurable()
| 0-40 | ||||||||||||||||||||||||
| 417 | return never executed: Encode(false);return Encode(false);never executed: return Encode(false); | 0 | ||||||||||||||||||||||||
| 418 | } executed 4192 times by 1 test: end of blockExecuted by:
| 4192 | ||||||||||||||||||||||||
| 419 | - | |||||||||||||||||||||||||
| 420 | return executed 16 times by 1 test: Encode(true);return Encode(true);Executed by:
executed 16 times by 1 test: return Encode(true);Executed by:
| 16 | ||||||||||||||||||||||||
| 421 | } | - | ||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||
| 423 | ReturnedValue ObjectPrototype::method_isExtensible(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 424 | { | - | ||||||||||||||||||||||||
| 425 | Scope scope(b); | - | ||||||||||||||||||||||||
| 426 | if (!argc
| 0-844 | ||||||||||||||||||||||||
| 427 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 428 | - | |||||||||||||||||||||||||
| 429 | ScopedObject o(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 430 | if (!o
| 8-837 | ||||||||||||||||||||||||
| 431 | return executed 8 times by 1 test: Encode(false);return Encode(false);Executed by:
executed 8 times by 1 test: return Encode(false);Executed by:
| 8 | ||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||
| 433 | return executed 835 times by 1 test: Encode((bool)o->isExtensible());return Encode((bool)o->isExtensible());Executed by:
executed 835 times by 1 test: return Encode((bool)o->isExtensible());Executed by:
| 835 | ||||||||||||||||||||||||
| 434 | } | - | ||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||
| 436 | ReturnedValue ObjectPrototype::method_keys(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 437 | { | - | ||||||||||||||||||||||||
| 438 | Scope scope(b); | - | ||||||||||||||||||||||||
| 439 | if (!argc
| 0-378 | ||||||||||||||||||||||||
| 440 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||
| 442 | ScopedObject o(scope, argv[0].toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 443 | if (scope.engine->hasException
| 8-371 | ||||||||||||||||||||||||
| 444 | return executed 6 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 6 times by 1 test: return QV4::Encode::undefined();Executed by:
| 6 | ||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||
| 446 | ScopedArrayObject a(scope, scope.engine->newArrayObject()); | - | ||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||
| 448 | ObjectIterator it(scope, o, ObjectIterator::EnumerableOnly); | - | ||||||||||||||||||||||||
| 449 | ScopedValue name(scope); | - | ||||||||||||||||||||||||
| 450 | while (1) { | - | ||||||||||||||||||||||||
| 451 | name = it.nextPropertyNameAsString(); | - | ||||||||||||||||||||||||
| 452 | if (name->isNull()
| 372-636 | ||||||||||||||||||||||||
| 453 | break; executed 372 times by 1 test: break;Executed by:
| 372 | ||||||||||||||||||||||||
| 454 | a->push_back(name); | - | ||||||||||||||||||||||||
| 455 | } executed 633 times by 1 test: end of blockExecuted by:
| 633 | ||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||
| 457 | return executed 372 times by 1 test: a.asReturnedValue();return a.asReturnedValue();Executed by:
executed 372 times by 1 test: return a.asReturnedValue();Executed by:
| 372 | ||||||||||||||||||||||||
| 458 | } | - | ||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||
| 460 | ReturnedValue ObjectPrototype::method_setPrototypeOf(const FunctionObject *f, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 461 | { | - | ||||||||||||||||||||||||
| 462 | Scope scope(f->engine()); | - | ||||||||||||||||||||||||
| 463 | if (argc < 2
| 0-264 | ||||||||||||||||||||||||
| 464 | return executed 32 times by 1 test: scope.engine->throwTypeError();return scope.engine->throwTypeError();Executed by:
executed 32 times by 1 test: return scope.engine->throwTypeError();Executed by:
| 32 | ||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||
| 466 | if (!argv[0].isObject()
| 16-228 | ||||||||||||||||||||||||
| 467 | return executed 16 times by 1 test: argv[0].asReturnedValue();return argv[0].asReturnedValue();Executed by:
executed 16 times by 1 test: return argv[0].asReturnedValue();Executed by:
| 16 | ||||||||||||||||||||||||
| 468 | - | |||||||||||||||||||||||||
| 469 | ScopedObject o(scope, argv[0]); | - | ||||||||||||||||||||||||
| 470 | const Object *p = argv[1].isNull()
| 20-208 | ||||||||||||||||||||||||
| 471 | bool ok = o->setPrototypeOf(p); | - | ||||||||||||||||||||||||
| 472 | if (!ok
| 48-180 | ||||||||||||||||||||||||
| 473 | return executed 48 times by 1 test: scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Could not change prototype.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Could not change prototype." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Could not change prototype.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Could not change prototype." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));Executed by:
executed 48 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 48 times by 1 test: }()));return qstring_literal_temp;Executed by:
executed 48 times by 1 test: return scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Could not change prototype.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Could not change prototype." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));Executed by:
| 48 | ||||||||||||||||||||||||
| 474 | return executed 180 times by 1 test: o->asReturnedValue();return o->asReturnedValue();Executed by:
executed 180 times by 1 test: return o->asReturnedValue();Executed by:
| 180 | ||||||||||||||||||||||||
| 475 | } | - | ||||||||||||||||||||||||
| 476 | - | |||||||||||||||||||||||||
| 477 | ReturnedValue ObjectPrototype::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int) | - | ||||||||||||||||||||||||
| 478 | { | - | ||||||||||||||||||||||||
| 479 | ExecutionEngine *v4 = b->engine(); | - | ||||||||||||||||||||||||
| 480 | QString string; | - | ||||||||||||||||||||||||
| 481 | if (thisObject->isUndefined()
| 12-4722 | ||||||||||||||||||||||||
| 482 | string = ([]() noexcept -> QString { enum { Size = sizeof(u"" "[object Undefined]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "[object Undefined]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||
| 483 | } executed 12 times by 1 test: else if (thisObject->isNull()end of blockExecuted by:
| 4-4727 | ||||||||||||||||||||||||
| 484 | string = ([]() noexcept -> QString { enum { Size = sizeof(u"" "[object Null]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "[object Null]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()); | - | ||||||||||||||||||||||||
| 485 | } executed 4 times by 1 test: else {end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 486 | const Object *o = thisObject->as<Object>(); | - | ||||||||||||||||||||||||
| 487 | if (!o
| 36-4679 | ||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||
| 489 | if (thisObject->isBoolean()
| 12-24 | ||||||||||||||||||||||||
| 490 | o = v4->booleanPrototype(); executed 12 times by 1 test: o = v4->booleanPrototype();Executed by:
| 12 | ||||||||||||||||||||||||
| 491 | else if (thisObject->isNumber()
| 12 | ||||||||||||||||||||||||
| 492 | o = v4->numberPrototype(); executed 12 times by 1 test: o = v4->numberPrototype();Executed by:
| 12 | ||||||||||||||||||||||||
| 493 | else if (thisObject->isString()
| 0-12 | ||||||||||||||||||||||||
| 494 | o = v4->stringPrototype(); executed 12 times by 1 test: o = v4->stringPrototype();Executed by:
| 12 | ||||||||||||||||||||||||
| 495 | else if (thisObject->isSymbol()
| 0 | ||||||||||||||||||||||||
| 496 | o = v4->symbolPrototype(); never executed: o = v4->symbolPrototype(); | 0 | ||||||||||||||||||||||||
| 497 | ((o) ? static_cast<void>(0) : qt_assert("o", __FILE__, 547)); | - | ||||||||||||||||||||||||
| 498 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 499 | QString name = o->className(); | - | ||||||||||||||||||||||||
| 500 | Scope scope(v4); | - | ||||||||||||||||||||||||
| 501 | ScopedString toStringTag(scope, o->get(v4->symbol_toStringTag())); | - | ||||||||||||||||||||||||
| 502 | if (toStringTag
| 1836-2871 | ||||||||||||||||||||||||
| 503 | name = toStringTag->toQString(); executed 1837 times by 1 test: name = toStringTag->toQString();Executed by:
| 1837 | ||||||||||||||||||||||||
| 504 | string = ([]() noexcept -> QString { enum { Size = sizeof(u"" "[object %1]")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "[object %1]" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()).arg(name); | - | ||||||||||||||||||||||||
| 505 | } executed 4709 times by 5 tests: end of blockExecuted by:
| 4709 | ||||||||||||||||||||||||
| 506 | return executed 4747 times by 5 tests: Encode(v4->newString(string));return Encode(v4->newString(string));Executed by:
executed 4747 times by 5 tests: return Encode(v4->newString(string));Executed by:
| 4747 | ||||||||||||||||||||||||
| 507 | } | - | ||||||||||||||||||||||||
| 508 | - | |||||||||||||||||||||||||
| 509 | ReturnedValue ObjectPrototype::method_toLocaleString(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 510 | { | - | ||||||||||||||||||||||||
| 511 | Scope scope(b); | - | ||||||||||||||||||||||||
| 512 | ScopedObject o(scope, thisObject->toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 513 | if (!o
| 20-144 | ||||||||||||||||||||||||
| 514 | return executed 20 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 20 times by 1 test: return QV4::Encode::undefined();Executed by:
| 20 | ||||||||||||||||||||||||
| 515 | - | |||||||||||||||||||||||||
| 516 | ScopedFunctionObject f(scope, o->get(scope.engine->id_toString())); | - | ||||||||||||||||||||||||
| 517 | if (!f
| 0-144 | ||||||||||||||||||||||||
| 518 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||
| 520 | return executed 144 times by 1 test: f->call(thisObject, argv, argc);return f->call(thisObject, argv, argc);Executed by:
executed 144 times by 1 test: return f->call(thisObject, argv, argc);Executed by:
| 144 | ||||||||||||||||||||||||
| 521 | } | - | ||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||
| 523 | ReturnedValue ObjectPrototype::method_valueOf(const FunctionObject *b, const Value *thisObject, const Value *, int) | - | ||||||||||||||||||||||||
| 524 | { | - | ||||||||||||||||||||||||
| 525 | return executed 4505 times by 6 tests: Encode(thisObject->toObject(b->engine()));return Encode(thisObject->toObject(b->engine()));Executed by:
executed 4505 times by 6 tests: return Encode(thisObject->toObject(b->engine()));Executed by:
| 4505 | ||||||||||||||||||||||||
| 526 | } | - | ||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||
| 528 | ReturnedValue ObjectPrototype::method_hasOwnProperty(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 529 | { | - | ||||||||||||||||||||||||
| 530 | Scope scope(b); | - | ||||||||||||||||||||||||
| 531 | ScopedPropertyKey P(scope, (argc ? argv[0] : Primitive::undefinedValue()).toPropertyKey(scope.engine)); | - | ||||||||||||||||||||||||
| 532 | if (scope.engine->hasException
| 0-26800 | ||||||||||||||||||||||||
| 533 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 534 | ScopedObject O(scope, thisObject->toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 535 | if (scope.engine->hasException
| 8-26861 | ||||||||||||||||||||||||
| 536 | return executed 8 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 1 test: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 537 | bool r = O->getOwnProperty(P) != Attr_Invalid; | - | ||||||||||||||||||||||||
| 538 | return executed 26890 times by 5 tests: Encode(r);return Encode(r);Executed by:
executed 26890 times by 5 tests: return Encode(r);Executed by:
| 26890 | ||||||||||||||||||||||||
| 539 | } | - | ||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||
| 541 | ReturnedValue ObjectPrototype::method_isPrototypeOf(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 542 | { | - | ||||||||||||||||||||||||
| 543 | Scope scope(b); | - | ||||||||||||||||||||||||
| 544 | if (!argc
| 0-546 | ||||||||||||||||||||||||
| 545 | return never executed: Encode(false);return Encode(false);never executed: return Encode(false); | 0 | ||||||||||||||||||||||||
| 546 | - | |||||||||||||||||||||||||
| 547 | ScopedObject V(scope, argv[0]); | - | ||||||||||||||||||||||||
| 548 | ScopedObject O(scope, thisObject->toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 549 | if (scope.engine->hasException
| 8-539 | ||||||||||||||||||||||||
| 550 | return executed 8 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 1 test: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 551 | ScopedObject proto(scope, V->getPrototypeOf()); | - | ||||||||||||||||||||||||
| 552 | while (proto
| 12-568 | ||||||||||||||||||||||||
| 553 | if (O->d() == proto->d()
| 40-528 | ||||||||||||||||||||||||
| 554 | return executed 527 times by 1 test: Encode(true);return Encode(true);Executed by:
executed 527 times by 1 test: return Encode(true);Executed by:
| 527 | ||||||||||||||||||||||||
| 555 | proto = proto->getPrototypeOf(); | - | ||||||||||||||||||||||||
| 556 | } executed 40 times by 1 test: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||
| 557 | return executed 12 times by 1 test: Encode(false);return Encode(false);Executed by:
executed 12 times by 1 test: return Encode(false);Executed by:
| 12 | ||||||||||||||||||||||||
| 558 | } | - | ||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||
| 560 | ReturnedValue ObjectPrototype::method_propertyIsEnumerable(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 561 | { | - | ||||||||||||||||||||||||
| 562 | Scope scope(b); | - | ||||||||||||||||||||||||
| 563 | ScopedPropertyKey p(scope, (argc ? argv[0] : Primitive::undefinedValue()).toPropertyKey(scope.engine)); | - | ||||||||||||||||||||||||
| 564 | if (scope.engine->hasException
| 0-1661 | ||||||||||||||||||||||||
| 565 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||
| 567 | ScopedObject o(scope, thisObject->toObject(scope.engine)); | - | ||||||||||||||||||||||||
| 568 | if (scope.engine->hasException
| 8-1657 | ||||||||||||||||||||||||
| 569 | return executed 8 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 1 test: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 570 | PropertyAttributes attrs = o->getOwnProperty(p); | - | ||||||||||||||||||||||||
| 571 | return executed 1659 times by 1 test: Encode(attrs.isEnumerable());return Encode(attrs.isEnumerable());Executed by:
executed 1659 times by 1 test: return Encode(attrs.isEnumerable());Executed by:
| 1659 | ||||||||||||||||||||||||
| 572 | } | - | ||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||
| 574 | ReturnedValue ObjectPrototype::method_defineGetter(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 575 | { | - | ||||||||||||||||||||||||
| 576 | Scope scope(b); | - | ||||||||||||||||||||||||
| 577 | if (argc < 2
| 0-8 | ||||||||||||||||||||||||
| 578 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 579 | - | |||||||||||||||||||||||||
| 580 | ScopedFunctionObject f(scope, argv[1]); | - | ||||||||||||||||||||||||
| 581 | if (!f
| 0-8 | ||||||||||||||||||||||||
| 582 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 583 | - | |||||||||||||||||||||||||
| 584 | ScopedString prop(scope, argv[0], ScopedString::Convert); | - | ||||||||||||||||||||||||
| 585 | if (scope.engine->hasException
| 0-8 | ||||||||||||||||||||||||
| 586 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||
| 588 | ScopedObject o(scope, thisObject); | - | ||||||||||||||||||||||||
| 589 | if (!o
| 2-6 | ||||||||||||||||||||||||
| 590 | if (!thisObject->isUndefined()
| 0-2 | ||||||||||||||||||||||||
| 591 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 592 | o = scope.engine->globalObject; | - | ||||||||||||||||||||||||
| 593 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||
| 595 | ScopedProperty pd(scope); | - | ||||||||||||||||||||||||
| 596 | pd->value = f; | - | ||||||||||||||||||||||||
| 597 | pd->set = Primitive::emptyValue(); | - | ||||||||||||||||||||||||
| 598 | bool ok = o->defineOwnProperty(prop->toPropertyKey(), pd, Attr_Accessor); | - | ||||||||||||||||||||||||
| 599 | if (!ok
| 0-8 | ||||||||||||||||||||||||
| 600 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 601 | return executed 8 times by 2 tests: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 2 tests: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 602 | } | - | ||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||
| 604 | ReturnedValue ObjectPrototype::method_defineSetter(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 605 | { | - | ||||||||||||||||||||||||
| 606 | Scope scope(b); | - | ||||||||||||||||||||||||
| 607 | if (argc < 2
| 0-8 | ||||||||||||||||||||||||
| 608 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||
| 610 | ScopedFunctionObject f(scope, argv[1]); | - | ||||||||||||||||||||||||
| 611 | if (!f
| 0-8 | ||||||||||||||||||||||||
| 612 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||
| 614 | ScopedString prop(scope, argv[0], ScopedString::Convert); | - | ||||||||||||||||||||||||
| 615 | if (scope.engine->hasException
| 0-8 | ||||||||||||||||||||||||
| 616 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||
| 618 | ScopedObject o(scope, thisObject); | - | ||||||||||||||||||||||||
| 619 | if (!o
| 2-6 | ||||||||||||||||||||||||
| 620 | if (!thisObject->isUndefined()
| 0-2 | ||||||||||||||||||||||||
| 621 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 622 | o = scope.engine->globalObject; | - | ||||||||||||||||||||||||
| 623 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 624 | - | |||||||||||||||||||||||||
| 625 | ScopedProperty pd(scope); | - | ||||||||||||||||||||||||
| 626 | pd->value = Primitive::emptyValue(); | - | ||||||||||||||||||||||||
| 627 | pd->set = f; | - | ||||||||||||||||||||||||
| 628 | bool ok = o->defineOwnProperty(prop->toPropertyKey(), pd, Attr_Accessor); | - | ||||||||||||||||||||||||
| 629 | if (!ok
| 0-8 | ||||||||||||||||||||||||
| 630 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 631 | return executed 8 times by 2 tests: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 2 tests: return QV4::Encode::undefined();Executed by:
| 8 | ||||||||||||||||||||||||
| 632 | } | - | ||||||||||||||||||||||||
| 633 | - | |||||||||||||||||||||||||
| 634 | ReturnedValue ObjectPrototype::method_get_proto(const FunctionObject *b, const Value *thisObject, const Value *, int) | - | ||||||||||||||||||||||||
| 635 | { | - | ||||||||||||||||||||||||
| 636 | Scope scope(b); | - | ||||||||||||||||||||||||
| 637 | ScopedObject o(scope, thisObject->as<Object>()); | - | ||||||||||||||||||||||||
| 638 | if (!o
| 0-2 | ||||||||||||||||||||||||
| 639 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 640 | - | |||||||||||||||||||||||||
| 641 | return executed 2 times by 1 test: Encode(o->getPrototypeOf());return Encode(o->getPrototypeOf());Executed by:
executed 2 times by 1 test: return Encode(o->getPrototypeOf());Executed by:
| 2 | ||||||||||||||||||||||||
| 642 | } | - | ||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||
| 644 | ReturnedValue ObjectPrototype::method_set_proto(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 645 | { | - | ||||||||||||||||||||||||
| 646 | Scope scope(b); | - | ||||||||||||||||||||||||
| 647 | ScopedObject o(scope, thisObject); | - | ||||||||||||||||||||||||
| 648 | if (!o
| 0-46 | ||||||||||||||||||||||||
| 649 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 650 | - | |||||||||||||||||||||||||
| 651 | const Object *p = argv[0].isNull()
| 0-46 | ||||||||||||||||||||||||
| 652 | bool ok = o->setPrototypeOf(p); | - | ||||||||||||||||||||||||
| 653 | if (!ok
| 6-40 | ||||||||||||||||||||||||
| 654 | return executed 6 times by 2 tests: scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Could not change prototype.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Could not change prototype." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Could not change prototype.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Could not change prototype." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));Executed by:
executed 6 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 6 times by 2 tests: }()));return qstring_literal_temp;Executed by:
executed 6 times by 2 tests: return scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Could not change prototype.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Could not change prototype." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));Executed by:
| 6 | ||||||||||||||||||||||||
| 655 | return executed 40 times by 3 tests: Encode::undefined();return Encode::undefined();Executed by:
executed 40 times by 3 tests: return Encode::undefined();Executed by:
| 40 | ||||||||||||||||||||||||
| 656 | return dead code: QV4::Encode::undefined();return QV4::Encode::undefined();dead code: return QV4::Encode::undefined(); | - | ||||||||||||||||||||||||
| 657 | } | - | ||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||
| 659 | void ObjectPrototype::toPropertyDescriptor(ExecutionEngine *engine, const Value &v, Property *desc, PropertyAttributes *attrs) | - | ||||||||||||||||||||||||
| 660 | { | - | ||||||||||||||||||||||||
| 661 | Scope scope(engine); | - | ||||||||||||||||||||||||
| 662 | ScopedObject o(scope, v); | - | ||||||||||||||||||||||||
| 663 | if (!o
| 74-20786 | ||||||||||||||||||||||||
| 664 | engine->throwTypeError(); | - | ||||||||||||||||||||||||
| 665 | return; executed 75 times by 1 test: return;Executed by:
| 75 | ||||||||||||||||||||||||
| 666 | } | - | ||||||||||||||||||||||||
| 667 | - | |||||||||||||||||||||||||
| 668 | attrs->clear(); | - | ||||||||||||||||||||||||
| 669 | desc->value = Primitive::emptyValue(); | - | ||||||||||||||||||||||||
| 670 | desc->set = Primitive::emptyValue(); | - | ||||||||||||||||||||||||
| 671 | ScopedValue tmp(scope); | - | ||||||||||||||||||||||||
| 672 | - | |||||||||||||||||||||||||
| 673 | if (o->hasProperty(engine->id_enumerable()->toPropertyKey())
| 4506-16350 | ||||||||||||||||||||||||
| 674 | attrs->setEnumerable((tmp = o->get(engine->id_enumerable()))->toBoolean()); executed 4490 times by 2 tests: attrs->setEnumerable((tmp = o->get(engine->id_enumerable()))->toBoolean());Executed by:
| 4490 | ||||||||||||||||||||||||
| 675 | - | |||||||||||||||||||||||||
| 676 | if (o->hasProperty(engine->id_configurable()->toPropertyKey())
| 9280-11586 | ||||||||||||||||||||||||
| 677 | attrs->setConfigurable((tmp = o->get(engine->id_configurable()))->toBoolean()); executed 9255 times by 1 test: attrs->setConfigurable((tmp = o->get(engine->id_configurable()))->toBoolean());Executed by:
| 9255 | ||||||||||||||||||||||||
| 678 | - | |||||||||||||||||||||||||
| 679 | if (o->hasProperty(engine->id_get()->toPropertyKey())
| 9628-11248 | ||||||||||||||||||||||||
| 680 | ScopedValue get(scope, o->get(engine->id_get())); | - | ||||||||||||||||||||||||
| 681 | FunctionObject *f = get->as<FunctionObject>(); | - | ||||||||||||||||||||||||
| 682 | if (f
| 59-9067 | ||||||||||||||||||||||||
| 683 | desc->value = get; | - | ||||||||||||||||||||||||
| 684 | } executed 9520 times by 2 tests: else {end of blockExecuted by:
| 9520 | ||||||||||||||||||||||||
| 685 | engine->throwTypeError(); | - | ||||||||||||||||||||||||
| 686 | return; executed 59 times by 1 test: return;Executed by:
| 59 | ||||||||||||||||||||||||
| 687 | } | - | ||||||||||||||||||||||||
| 688 | attrs->setType(PropertyAttributes::Accessor); | - | ||||||||||||||||||||||||
| 689 | } executed 9528 times by 2 tests: end of blockExecuted by:
| 9528 | ||||||||||||||||||||||||
| 690 | - | |||||||||||||||||||||||||
| 691 | if (o->hasProperty(engine->id_set()->toPropertyKey())
| 3604-17196 | ||||||||||||||||||||||||
| 692 | ScopedValue set(scope, o->get(engine->id_set())); | - | ||||||||||||||||||||||||
| 693 | FunctionObject *f = set->as<FunctionObject>(); | - | ||||||||||||||||||||||||
| 694 | if (f
| 64-3040 | ||||||||||||||||||||||||
| 695 | desc->set = set; | - | ||||||||||||||||||||||||
| 696 | } executed 3522 times by 1 test: else {end of blockExecuted by:
| 3522 | ||||||||||||||||||||||||
| 697 | engine->throwTypeError(); | - | ||||||||||||||||||||||||
| 698 | return; executed 64 times by 1 test: return;Executed by:
| 64 | ||||||||||||||||||||||||
| 699 | } | - | ||||||||||||||||||||||||
| 700 | attrs->setType(PropertyAttributes::Accessor); | - | ||||||||||||||||||||||||
| 701 | } executed 3528 times by 1 test: end of blockExecuted by:
| 3528 | ||||||||||||||||||||||||
| 702 | - | |||||||||||||||||||||||||
| 703 | if (o->hasProperty(engine->id_writable()->toPropertyKey())
| 2998-17749 | ||||||||||||||||||||||||
| 704 | if (attrs->isAccessor()
| 24-2974 | ||||||||||||||||||||||||
| 705 | engine->throwTypeError(); | - | ||||||||||||||||||||||||
| 706 | return; executed 23 times by 1 test: return;Executed by:
| 23 | ||||||||||||||||||||||||
| 707 | } | - | ||||||||||||||||||||||||
| 708 | attrs->setWritable((tmp = o->get(engine->id_writable()))->toBoolean()); | - | ||||||||||||||||||||||||
| 709 | - | |||||||||||||||||||||||||
| 710 | desc->value = Primitive::undefinedValue(); | - | ||||||||||||||||||||||||
| 711 | } executed 2962 times by 1 test: end of blockExecuted by:
| 2962 | ||||||||||||||||||||||||
| 712 | - | |||||||||||||||||||||||||
| 713 | if (o->hasProperty(engine->id_value()->toPropertyKey())
| 5760-14963 | ||||||||||||||||||||||||
| 714 | if (attrs->isAccessor()
| 24-5721 | ||||||||||||||||||||||||
| 715 | engine->throwTypeError(); | - | ||||||||||||||||||||||||
| 716 | return; executed 24 times by 1 test: return;Executed by:
| 24 | ||||||||||||||||||||||||
| 717 | } | - | ||||||||||||||||||||||||
| 718 | desc->value = o->get(engine->id_value()); | - | ||||||||||||||||||||||||
| 719 | attrs->setType(PropertyAttributes::Data); | - | ||||||||||||||||||||||||
| 720 | } executed 5725 times by 2 tests: end of blockExecuted by:
| 5725 | ||||||||||||||||||||||||
| 721 | - | |||||||||||||||||||||||||
| 722 | if (attrs->isGeneric()
| 2651-18012 | ||||||||||||||||||||||||
| 723 | desc->value = Primitive::emptyValue(); executed 2649 times by 1 test: desc->value = Primitive::emptyValue();Executed by:
| 2649 | ||||||||||||||||||||||||
| 724 | } executed 20629 times by 3 tests: end of blockExecuted by:
| 20629 | ||||||||||||||||||||||||
| 725 | - | |||||||||||||||||||||||||
| 726 | - | |||||||||||||||||||||||||
| 727 | ReturnedValue ObjectPrototype::fromPropertyDescriptor(ExecutionEngine *engine, const Property *desc, PropertyAttributes attrs) | - | ||||||||||||||||||||||||
| 728 | { | - | ||||||||||||||||||||||||
| 729 | if (attrs.isEmpty()
| 1253-23840 | ||||||||||||||||||||||||
| 730 | return executed 1253 times by 1 test: Encode::undefined();return Encode::undefined();Executed by:
executed 1253 times by 1 test: return Encode::undefined();Executed by:
| 1253 | ||||||||||||||||||||||||
| 731 | - | |||||||||||||||||||||||||
| 732 | Scope scope(engine); | - | ||||||||||||||||||||||||
| 733 | - | |||||||||||||||||||||||||
| 734 | - | |||||||||||||||||||||||||
| 735 | ScopedObject o(scope, engine->newObject()); | - | ||||||||||||||||||||||||
| 736 | ScopedString s(scope); | - | ||||||||||||||||||||||||
| 737 | ScopedValue v(scope); | - | ||||||||||||||||||||||||
| 738 | - | |||||||||||||||||||||||||
| 739 | if (attrs.isData()
| 4550-19307 | ||||||||||||||||||||||||
| 740 | s = engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "value")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "value" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 19293 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 19293 times by 1 test: }()));return qstring_literal_temp;Executed by:
| 19293 | ||||||||||||||||||||||||
| 741 | o->put(s, desc->value); | - | ||||||||||||||||||||||||
| 742 | v = Primitive::fromBoolean(attrs.isWritable()); | - | ||||||||||||||||||||||||
| 743 | s = engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "writable")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "writable" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 19312 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 19312 times by 1 test: }()));return qstring_literal_temp;Executed by:
| 19312 | ||||||||||||||||||||||||
| 744 | o->put(s, v); | - | ||||||||||||||||||||||||
| 745 | } executed 19343 times by 1 test: else {end of blockExecuted by:
| 19343 | ||||||||||||||||||||||||
| 746 | v = desc->getter()
| 1146-3407 | ||||||||||||||||||||||||
| 747 | s = engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "get")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "get" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 4552 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 4552 times by 1 test: }()));return qstring_literal_temp;Executed by:
| 4552 | ||||||||||||||||||||||||
| 748 | o->put(s, v); | - | ||||||||||||||||||||||||
| 749 | v = desc->setter()
| 1801-2764 | ||||||||||||||||||||||||
| 750 | s = engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "set")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "set" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 4570 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 4570 times by 1 test: }()));return qstring_literal_temp;Executed by:
| 4570 | ||||||||||||||||||||||||
| 751 | o->put(s, v); | - | ||||||||||||||||||||||||
| 752 | } executed 4575 times by 1 test: end of blockExecuted by:
| 4575 | ||||||||||||||||||||||||
| 753 | v = Primitive::fromBoolean(attrs.isEnumerable()); | - | ||||||||||||||||||||||||
| 754 | s = engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "enumerable")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "enumerable" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 23891 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 23891 times by 1 test: }()));return qstring_literal_temp;Executed by:
| 23891 | ||||||||||||||||||||||||
| 755 | o->put(s, v); | - | ||||||||||||||||||||||||
| 756 | v = Primitive::fromBoolean(attrs.isConfigurable()); | - | ||||||||||||||||||||||||
| 757 | s = engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "configurable")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "configurable" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 23890 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 23890 times by 1 test: }()));return qstring_literal_temp;Executed by:
| 23890 | ||||||||||||||||||||||||
| 758 | o->put(s, v); | - | ||||||||||||||||||||||||
| 759 | - | |||||||||||||||||||||||||
| 760 | return executed 23961 times by 1 test: o.asReturnedValue();return o.asReturnedValue();Executed by:
executed 23961 times by 1 test: return o.asReturnedValue();Executed by:
| 23961 | ||||||||||||||||||||||||
| 761 | } | - | ||||||||||||||||||||||||
| 762 | - | |||||||||||||||||||||||||
| 763 | - | |||||||||||||||||||||||||
| 764 | Heap::ArrayObject *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const Value &o) | - | ||||||||||||||||||||||||
| 765 | { | - | ||||||||||||||||||||||||
| 766 | Scope scope(v4); | - | ||||||||||||||||||||||||
| 767 | ScopedArrayObject array(scope, v4->newArrayObject()); | - | ||||||||||||||||||||||||
| 768 | ScopedObject O(scope, o.toObject(v4)); | - | ||||||||||||||||||||||||
| 769 | if (O
| 0-2237 | ||||||||||||||||||||||||
| 770 | ObjectIterator it(scope, O, ObjectIterator::NoFlags); | - | ||||||||||||||||||||||||
| 771 | ScopedValue name(scope); | - | ||||||||||||||||||||||||
| 772 | while (1) { | - | ||||||||||||||||||||||||
| 773 | name = it.nextPropertyNameAsString(); | - | ||||||||||||||||||||||||
| 774 | if (name->isNull()
| 2236-4776 | ||||||||||||||||||||||||
| 775 | break; executed 2235 times by 6 tests: break;Executed by:
| 2235 | ||||||||||||||||||||||||
| 776 | array->push_back(name); | - | ||||||||||||||||||||||||
| 777 | } executed 4775 times by 6 tests: end of blockExecuted by:
| 4775 | ||||||||||||||||||||||||
| 778 | } executed 2235 times by 6 tests: end of blockExecuted by:
| 2235 | ||||||||||||||||||||||||
| 779 | return executed 2235 times by 6 tests: array->d();return array->d();Executed by:
executed 2235 times by 6 tests: return array->d();Executed by:
| 2235 | ||||||||||||||||||||||||
| 780 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |