OpenCoverage

qv4objectproto.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4objectproto.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2017 Crimson AS <info@crimson.no>-
4** Copyright (C) 2016 The Qt Company Ltd.-
5** Contact: https://www.qt.io/licensing/-
6**-
7** This file is part of the QtQml module of the Qt Toolkit.-
8**-
9** $QT_BEGIN_LICENSE:LGPL$-
10** Commercial License Usage-
11** Licensees holding valid commercial Qt licenses may use this file in-
12** accordance with the commercial license agreement provided with the-
13** Software or, alternatively, in accordance with the terms contained in-
14** a written agreement between you and The Qt Company. For licensing terms-
15** and conditions see https://www.qt.io/terms-conditions. For further-
16** information use the contact form at https://www.qt.io/contact-us.-
17**-
18** GNU Lesser General Public License Usage-
19** Alternatively, this file may be used under the terms of the GNU Lesser-
20** General Public License version 3 as published by the Free Software-
21** Foundation and appearing in the file LICENSE.LGPL3 included in the-
22** packaging of this file. Please review the following information to-
23** ensure the GNU Lesser General Public License version 3 requirements-
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
25**-
26** GNU General Public License Usage-
27** Alternatively, this file may be used under the terms of the GNU-
28** General Public License version 2.0 or (at your option) the GNU General-
29** Public license version 3 or any later version approved by the KDE Free-
30** Qt Foundation. The licenses are as published by the Free Software-
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
32** included in the packaging of this file. Please review the following-
33** information to ensure the GNU General Public License requirements will-
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
35** https://www.gnu.org/licenses/gpl-3.0.html.-
36**-
37** $QT_END_LICENSE$-
38**-
39****************************************************************************/-
40-
41-
42#include "qv4objectproto_p.h"-
43#include "qv4argumentsobject_p.h"-
44#include <private/qv4mm_p.h>-
45#include "qv4scopedvalue_p.h"-
46#include "qv4runtime_p.h"-
47#include "qv4objectiterator_p.h"-
48#include "qv4string_p.h"-
49#include "qv4jscall_p.h"-
50#include "qv4symbol_p.h"-
51#include "qv4propertykey_p.h"-
52-
53#include <QtCore/QDateTime>-
54#include <QtCore/QStringList>-
55-
56using namespace QV4;-
57-
58-
59DEFINE_OBJECT_VTABLE(ObjectCtor);-
60-
61void Heap::ObjectCtor::init(QV4::ExecutionContext *scope)-
62{-
63 Heap::FunctionObject::init(scope, QStringLiteral("Object"));
executed 98774 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98774
64}
executed 98895 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98895
65-
66ReturnedValue ObjectCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget)-
67{-
68 ExecutionEngine *v4 = f->engine();-
69 const ObjectCtor *nt = static_cast<const ObjectCtor *>(newTarget);-
70 if (!argc || argv[0].isUndefined() || argv[0].isNull()) {
!argcDescription
TRUEevaluated 1931 times by 10 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
FALSEevaluated 295 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
argv[0].isUndefined()Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 266 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
argv[0].isNull()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 250 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
16-1931
71 Scope scope(v4);-
72 ScopedObject obj(scope, scope.engine->newObject());-
73 ScopedObject proto(scope, nt->get(scope.engine->id_prototype()));-
74 if (!!proto)
!!protoDescription
TRUEevaluated 1976 times by 10 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
FALSEnever evaluated
0-1976
75 obj->setPrototypeOf(proto);
executed 1975 times by 10 tests: obj->setPrototypeOf(proto);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
1975
76 return obj.asReturnedValue();
executed 1980 times by 10 tests: return obj.asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
1980
77 } else {-
78 return argv[0].toObject(v4)->asReturnedValue();
executed 250 times by 2 tests: return argv[0].toObject(v4)->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
250
79 }-
80}-
81-
82ReturnedValue ObjectCtor::virtualCall(const FunctionObject *m, const Value *, const Value *argv, int argc)-
83{-
84 ExecutionEngine *v4 = m->engine();-
85 if (!argc || argv[0].isUndefined() || argv[0].isNull()) {
!argcDescription
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlqt
FALSEevaluated 483 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[0].isUndefined()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 471 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[0].isNull()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 464 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-483
86 return v4->newObject()->asReturnedValue();
executed 36 times by 3 tests: return v4->newObject()->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlqt
36
87 } else {-
88 return argv[0].toObject(v4)->asReturnedValue();
executed 463 times by 1 test: return argv[0].toObject(v4)->asReturnedValue();
Executed by:
  • tst_ecmascripttests
463
89 }-
90}-
91-
92void ObjectPrototype::init(ExecutionEngine *v4, Object *ctor)-
93{-
94 Scope scope(v4);-
95 ScopedObject o(scope, this);-
96-
97 ctor->defineReadonlyProperty(v4->id_prototype(), o);-
98 ctor->defineReadonlyConfigurableProperty(v4->id_length(), Primitive::fromInt32(1));-
99 ctor->defineDefaultProperty(QStringLiteral("getPrototypeOf"), method_getPrototypeOf, 1);
executed 98420 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98420
100 ctor->defineDefaultProperty(QStringLiteral("getOwnPropertyDescriptor"), method_getOwnPropertyDescriptor, 2);
executed 98975 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98975
101 ctor->defineDefaultProperty(QStringLiteral("getOwnPropertyNames"), method_getOwnPropertyNames, 1);
executed 99071 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99071
102 ctor->defineDefaultProperty(QStringLiteral("getOwnPropertySymbols"), method_getOwnPropertySymbols, 1);
executed 99078 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99078
103 ctor->defineDefaultProperty(QStringLiteral("assign"), method_assign, 2);
executed 99054 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99054
104 ctor->defineDefaultProperty(QStringLiteral("create"), method_create, 2);
executed 99021 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99021
105 ctor->defineDefaultProperty(QStringLiteral("defineProperty"), method_defineProperty, 3);
executed 98845 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98845
106 ctor->defineDefaultProperty(QStringLiteral("defineProperties"), method_defineProperties, 2);
executed 99044 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99044
107 ctor->defineDefaultProperty(QStringLiteral("seal"), method_seal, 1);
executed 99040 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99040
108 ctor->defineDefaultProperty(QStringLiteral("freeze"), method_freeze, 1);
executed 99087 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99087
109 ctor->defineDefaultProperty(QStringLiteral("preventExtensions"), method_preventExtensions, 1);
executed 99104 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99104
110 ctor->defineDefaultProperty(QStringLiteral("is"), method_is, 2);
executed 99111 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99111
111 ctor->defineDefaultProperty(QStringLiteral("isSealed"), method_isSealed, 1);
executed 99120 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99120
112 ctor->defineDefaultProperty(QStringLiteral("isFrozen"), method_isFrozen, 1);
executed 99101 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99101
113 ctor->defineDefaultProperty(QStringLiteral("isExtensible"), method_isExtensible, 1);
executed 98908 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98908
114 ctor->defineDefaultProperty(QStringLiteral("keys"), method_keys, 1);
executed 99121 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99121
115 ctor->defineDefaultProperty(QStringLiteral("setPrototypeOf"), method_setPrototypeOf, 2);
executed 99106 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99106
116-
117 defineDefaultProperty(QStringLiteral("constructor"), (o = ctor));
executed 98899 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98899
118 defineDefaultProperty(v4->id_toString(), method_toString, 0);-
119 defineDefaultProperty(QStringLiteral("toLocaleString"), method_toLocaleString, 0);
executed 99038 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99038
120 defineDefaultProperty(v4->id_valueOf(), method_valueOf, 0);-
121 defineDefaultProperty(QStringLiteral("hasOwnProperty"), method_hasOwnProperty, 1);
executed 99020 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99020
122 defineDefaultProperty(QStringLiteral("isPrototypeOf"), method_isPrototypeOf, 1);
executed 99080 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99080
123 defineDefaultProperty(QStringLiteral("propertyIsEnumerable"), method_propertyIsEnumerable, 1);
executed 99057 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99057
124 defineDefaultProperty(QStringLiteral("__defineGetter__"), method_defineGetter, 2);
executed 98847 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98847
125 defineDefaultProperty(QStringLiteral("__defineSetter__"), method_defineSetter, 2);
executed 99032 times by 153 tests: return qstring_literal_temp;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99032
126-
127 defineAccessorProperty(v4->id___proto__(), method_get_proto, method_set_proto);-
128}
executed 98848 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
98848
129-
130ReturnedValue ObjectPrototype::method_getPrototypeOf(const FunctionObject *b, const Value *, const Value *argv, int argc)-
131{-
132 Scope scope(b);-
133 if (argc < 1)
argc < 1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 7771 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
4-7771
134 return scope.engine->throwTypeError();
executed 4 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
4
135-
136 ScopedObject o(scope, argv[0].toObject(scope.engine));-
137 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 7756 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
12-7756
138 return QV4::Encode::undefined();
executed 12 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
139-
140 ScopedObject p(scope, o->getPrototypeOf());-
141 return (!!p ? p->asReturnedValue() : Encode::null());
executed 7756 times by 2 tests: return (!!p ? p->asReturnedValue() : Encode::null());
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
7756
142}-
143-
144ReturnedValue ObjectPrototype::method_is(const FunctionObject *, const Value *, const Value *argv, int argc)-
145{-
146 if (!argc)
!argcDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 340 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-340
147 return Encode(true);
executed 4 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
4
148 if (argc == 1)
argc == 1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 328 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-328
149 return Encode((argv[0].isUndefined() ? true : false));
executed 12 times by 1 test: return Encode((argv[0].isUndefined() ? true : false));
Executed by:
  • tst_ecmascripttests
12
150 return Encode(argv[0].sameValue(argv[1]));
executed 328 times by 1 test: return Encode(argv[0].sameValue(argv[1]));
Executed by:
  • tst_ecmascripttests
328
151}-
152-
153ReturnedValue ObjectPrototype::method_getOwnPropertyDescriptor(const FunctionObject *b, const Value *, const Value *argv, int argc)-
154{-
155 Scope scope(b);-
156 if (argc < 1)
argc < 1Description
TRUEnever evaluated
FALSEevaluated 25145 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-25145
157 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
158-
159 ScopedObject O(scope, argv[0].toObject(scope.engine));-
160 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 25078 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-25078
161 return QV4::Encode::undefined();
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
162-
163 if (ArgumentsObject::isNonStrictArgumentsObject(O))
ArgumentsObjec...mentsObject(O)Description
TRUEevaluated 771 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24367 times by 1 test
Evaluated by:
  • tst_ecmascripttests
771-24367
164 static_cast<ArgumentsObject *>(O.getPointer())->fullyCreate();
executed 769 times by 1 test: static_cast<ArgumentsObject *>(O.getPointer())->fullyCreate();
Executed by:
  • tst_ecmascripttests
769
165-
166 ScopedValue v(scope, argc > 1 ? argv[1] : Primitive::undefinedValue());-
167 ScopedPropertyKey name(scope, v->toPropertyKey(scope.engine));-
168 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 25160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-25160
169 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
170-
171 ScopedProperty desc(scope);-
172 PropertyAttributes attrs = O->getOwnProperty(name, desc);-
173 return fromPropertyDescriptor(scope.engine, desc, attrs);
executed 25131 times by 1 test: return fromPropertyDescriptor(scope.engine, desc, attrs);
Executed by:
  • tst_ecmascripttests
25131
174}-
175-
176ReturnedValue ObjectPrototype::method_getOwnPropertyNames(const FunctionObject *b, const Value *, const Value *argv, int argc)-
177{-
178 Scope scope(b);-
179 if (argc < 1)
argc < 1Description
TRUEnever evaluated
FALSEevaluated 268 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
0-268
180 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
181-
182 ScopedObject O(scope, argv[0].toObject(scope.engine));-
183 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 260 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
8-260
184 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
185-
186 return Encode(getOwnPropertyNames(scope.engine, argv[0]));
executed 261 times by 2 tests: return Encode(getOwnPropertyNames(scope.engine, argv[0]));
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
261
187}-
188-
189ReturnedValue ObjectPrototype::method_getOwnPropertySymbols(const FunctionObject *f, const Value *, const Value *argv, int argc)-
190{-
191 Scope scope(f);-
192 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-24
193 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
194-
195 ScopedObject O(scope, argv[0].toObject(scope.engine));-
196 if (!O)
!ODescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-24
197 return Encode::undefined();
never executed: return Encode::undefined();
0
198 Heap::InternalClass *ic = O->d()->internalClass;-
199 ScopedValue n(scope);-
200 ScopedArrayObject array(scope, scope.engine->newArrayObject());-
201 for (uint i = 0; i < ic->size; ++i) {
i < ic->sizeDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
24-60
202 PropertyKey id = ic->nameMap.at(i);-
203 n = id.asStringOrSymbol();-
204 if (!n || !n->isSymbol())
!nDescription
TRUEnever evaluated
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!n->isSymbol()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-60
205 continue;
executed 28 times by 1 test: continue;
Executed by:
  • tst_ecmascripttests
28
206 array->push_back(n);-
207 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
32
208 return array->asReturnedValue();
executed 24 times by 1 test: return array->asReturnedValue();
Executed by:
  • tst_ecmascripttests
24
209}-
210-
211// 19.1.2.1-
212ReturnedValue ObjectPrototype::method_assign(const FunctionObject *b, const Value *, const Value *argv, int argc)-
213{-
214 Scope scope(b);-
215 if (argc < 1)
argc < 1Description
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-84
216 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
217-
218 ScopedObject to(scope, argv[0].toObject(scope.engine));-
219 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-76
220 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
221-
222 if (argc == 1)
argc == 1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-72
223 return to.asReturnedValue();
executed 4 times by 1 test: return to.asReturnedValue();
Executed by:
  • tst_ecmascripttests
4
224-
225 for (int i = 1, ei = argc; i < ei; ++i) {
i < eiDescription
TRUEevaluated 120 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
56-120
226 if (argv[i].isUndefined() || argv[i].isNull())
argv[i].isUndefined()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[i].isNull()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 104 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-112
227 continue;
executed 16 times by 1 test: continue;
Executed by:
  • tst_ecmascripttests
16
228-
229 ScopedObject from(scope, argv[i].toObject(scope.engine));-
230 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-104
231 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
232 QV4::ScopedArrayObject keys(scope, QV4::ObjectPrototype::getOwnPropertyNames(scope.engine, from));-
233 quint32 length = keys->getLength();-
234-
235 ScopedString nextKey(scope);-
236 ScopedValue propValue(scope);-
237 for (quint32 i = 0; i < length; ++i) {
i < lengthDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
88-144
238 nextKey = Value::fromReturnedValue(keys->get(i)).toString(scope.engine);-
239-
240 ScopedProperty prop(scope);-
241 PropertyAttributes attrs = from->getOwnProperty(nextKey->toPropertyKey(), prop);-
242-
243 if (attrs == PropertyFlag::Attr_Invalid)
attrs == Prope...::Attr_InvalidDescription
TRUEnever evaluated
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-144
244 continue;
never executed: continue;
0
245-
246 if (!attrs.isEnumerable())
!attrs.isEnumerable()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_ecmascripttests
24-120
247 continue;
executed 24 times by 1 test: continue;
Executed by:
  • tst_ecmascripttests
24
248-
249 propValue = from->get(nextKey);-
250 to->set(nextKey, propValue, Object::DoThrowOnRejection);-
251 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 104 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-104
252 return QV4::Encode::undefined();
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
253 }
executed 104 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
104
254 }
executed 88 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
88
255-
256 return to.asReturnedValue();
executed 56 times by 1 test: return to.asReturnedValue();
Executed by:
  • tst_ecmascripttests
56
257}-
258-
259ReturnedValue ObjectPrototype::method_create(const FunctionObject *builtin, const Value *thisObject, const Value *argv, int argc)-
260{-
261 Scope scope(builtin);-
262 if (!argc || (!argv[0].isObject() && !argv[0].isNull()))
!argcDescription
TRUEnever evaluated
FALSEevaluated 1587 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
!argv[0].isObject()Description
TRUEevaluated 92 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1500 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
!argv[0].isNull()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-1587
263 return scope.engine->throwTypeError();
executed 16 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
16
264-
265 ScopedObject O(scope, argv[0]);-
266-
267 ScopedObject newObject(scope, scope.engine->newObject());-
268 newObject->setPrototypeOf(O);-
269-
270-
271 if (argc > 1 && !argv[1].isUndefined()) {
argc > 1Description
TRUEevaluated 1215 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 366 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
!argv[1].isUndefined()Description
TRUEevaluated 1211 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-1215
272 Value *arguments = scope.alloc(argc);-
273 arguments[0] = newObject;-
274 memcpy(arguments + 1, argv + 1, (argc - 1)*sizeof(Value));-
275 return method_defineProperties(builtin, thisObject, arguments, argc);
executed 1206 times by 1 test: return method_defineProperties(builtin, thisObject, arguments, argc);
Executed by:
  • tst_ecmascripttests
1206
276 }-
277-
278 return newObject.asReturnedValue();
executed 370 times by 2 tests: return newObject.asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
370
279}-
280-
281ReturnedValue ObjectPrototype::method_defineProperty(const FunctionObject *b, const Value *, const Value *argv, int argc)-
282{-
283 Scope scope(b);-
284 if (!argc || !argv[0].isObject())
!argcDescription
TRUEnever evaluated
FALSEevaluated 16095 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
!argv[0].isObject()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16110 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
0-16110
285 return scope.engine->throwTypeError();
executed 20 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
20
286-
287 ScopedObject O(scope, argv[0]);-
288 ScopedPropertyKey name(scope, (argc > 1 ? argv[1] : Primitive::undefinedValue()).toPropertyKey(scope.engine));-
289 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16112 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
4-16112
290 return QV4::Encode::undefined();
executed 4 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
4
291-
292 ScopedValue attributes(scope, argc > 2 ? argv[2] : Primitive::undefinedValue());-
293 ScopedProperty pd(scope);-
294 PropertyAttributes attrs;-
295 toPropertyDescriptor(scope.engine, attributes, pd, &attrs);-
296 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16080 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
76-16080
297 return QV4::Encode::undefined();
executed 76 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
76
298-
299 if (!O->defineOwnProperty(name, pd, attrs))
!O->defineOwnP...me, pd, attrs)Description
TRUEevaluated 989 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 15073 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
989-15073
300 THROW_TYPE_ERROR();
executed 989 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
989
301-
302 return O.asReturnedValue();
executed 15058 times by 3 tests: return O.asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
15058
303}-
304-
305ReturnedValue ObjectPrototype::method_defineProperties(const FunctionObject *b, const Value *, const Value *argv, int argc)-
306{-
307 Scope scope(b);-
308 if (argc < 2 || !argv[0].isObject())
argc < 2Description
TRUEnever evaluated
FALSEevaluated 3680 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!argv[0].isObject()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3659 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-3680
309 return scope.engine->throwTypeError();
executed 20 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
20
310-
311 ScopedObject O(scope, argv[0]);-
312-
313 ScopedObject o(scope, argv[1].toObject(scope.engine));-
314 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3644 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-3644
315 return QV4::Encode::undefined();
executed 12 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
316-
317 ScopedValue val(scope);-
318-
319 ObjectIterator it(scope, o, ObjectIterator::EnumerableOnly);-
320 ScopedStringOrSymbol name(scope);-
321 ScopedProperty pd(scope);-
322 ScopedProperty n(scope);-
323 while (1) {-
324 uint index;-
325 PropertyAttributes attrs;-
326 it.next(name.getRef(), &index, pd, &attrs);-
327 if (attrs.isEmpty())
attrs.isEmpty()Description
TRUEevaluated 2952 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3688 times by 1 test
Evaluated by:
  • tst_ecmascripttests
2952-3688
328 break;
executed 2953 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
2953
329 PropertyAttributes nattrs;-
330 val = o->getValue(pd->value, attrs);-
331 toPropertyDescriptor(scope.engine, val, n, &nattrs);-
332 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 169 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3528 times by 1 test
Evaluated by:
  • tst_ecmascripttests
169-3528
333 return QV4::Encode::undefined();
executed 167 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
167
334 bool ok;-
335 if (name)
nameDescription
TRUEevaluated 3055 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 466 times by 1 test
Evaluated by:
  • tst_ecmascripttests
466-3055
336 ok = O->defineOwnProperty(name->toPropertyKey(), n, nattrs);
executed 3054 times by 1 test: ok = O->defineOwnProperty(name->toPropertyKey(), n, nattrs);
Executed by:
  • tst_ecmascripttests
3054
337 else-
338 ok = O->defineOwnProperty(PropertyKey::fromArrayIndex(index), n, nattrs);
executed 466 times by 1 test: ok = O->defineOwnProperty(PropertyKey::fromArrayIndex(index), n, nattrs);
Executed by:
  • tst_ecmascripttests
466
339 if (!ok)
!okDescription
TRUEevaluated 531 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2992 times by 1 test
Evaluated by:
  • tst_ecmascripttests
531-2992
340 THROW_TYPE_ERROR();
executed 531 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
531
341 }
executed 2993 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2993
342-
343 return O.asReturnedValue();
executed 2939 times by 1 test: return O.asReturnedValue();
Executed by:
  • tst_ecmascripttests
2939
344}-
345-
346ReturnedValue ObjectPrototype::method_seal(const FunctionObject *b, const Value *, const Value *argv, int argc)-
347{-
348 const Value a = argc ? argv[0] : Primitive::undefinedValue();
argcDescription
TRUEevaluated 173 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-173
349 if (!a.isObject())
!a.isObject()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 154 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-154
350 // 19.1.2.17, 1-
351 return a.asReturnedValue();
executed 20 times by 1 test: return a.asReturnedValue();
Executed by:
  • tst_ecmascripttests
20
352-
353 Scope scope(b);-
354 ScopedObject o(scope, a);-
355 o->setInternalClass(o->internalClass()->sealed());-
356-
357 if (o->arrayData()) {
o->arrayData()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-148
358 ArrayData::ensureAttributes(o);-
359 for (uint i = 0; i < o->d()->arrayData->values.alloc; ++i) {
i < o->d()->ar...->values.allocDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-64
360 if (!o->arrayData()->isEmpty(i))
!o->arrayData()->isEmpty(i)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-56
361 o->d()->arrayData->attrs[i].setConfigurable(false);
executed 8 times by 1 test: o->d()->arrayData->attrs[i].setConfigurable(false);
Executed by:
  • tst_ecmascripttests
8
362 }
executed 64 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
64
363 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
8
364-
365 return o.asReturnedValue();
executed 155 times by 1 test: return o.asReturnedValue();
Executed by:
  • tst_ecmascripttests
155
366}-
367-
368ReturnedValue ObjectPrototype::method_freeze(const FunctionObject *b, const Value *, const Value *argv, int argc)-
369{-
370 const Value a = argc ? argv[0] : Primitive::undefinedValue();
argcDescription
TRUEevaluated 236 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
FALSEnever evaluated
0-236
371 if (!a.isObject())
!a.isObject()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 212 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
24-212
372 // 19.1.2.5, 1-
373 return a.asReturnedValue();
executed 24 times by 1 test: return a.asReturnedValue();
Executed by:
  • tst_ecmascripttests
24
374-
375 Scope scope(b);-
376 ScopedObject o(scope, a);-
377-
378 if (ArgumentsObject::isNonStrictArgumentsObject(o))
ArgumentsObjec...mentsObject(o)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
6-206
379 static_cast<ArgumentsObject *>(o.getPointer())->fullyCreate();
executed 6 times by 1 test: static_cast<ArgumentsObject *>(o.getPointer())->fullyCreate();
Executed by:
  • tst_ecmascripttests
6
380-
381 o->setInternalClass(o->internalClass()->frozen());-
382-
383 if (o->arrayData()) {
o->arrayData()Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
36-176
384 ArrayData::ensureAttributes(o);-
385 for (uint i = 0; i < o->arrayData()->values.alloc; ++i) {
i < o->arrayDa...->values.allocDescription
TRUEevaluated 4352 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
36-4352
386 if (!o->arrayData()->isEmpty(i))
!o->arrayData()->isEmpty(i)Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4280 times by 1 test
Evaluated by:
  • tst_ecmascripttests
72-4280
387 o->arrayData()->attrs[i].setConfigurable(false);
executed 72 times by 1 test: o->arrayData()->attrs[i].setConfigurable(false);
Executed by:
  • tst_ecmascripttests
72
388 if (o->arrayData()->attrs[i].isData())
o->arrayData()...rs[i].isData()Description
TRUEevaluated 4088 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 264 times by 1 test
Evaluated by:
  • tst_ecmascripttests
264-4088
389 o->arrayData()->attrs[i].setWritable(false);
executed 4088 times by 1 test: o->arrayData()->attrs[i].setWritable(false);
Executed by:
  • tst_ecmascripttests
4088
390 }
executed 4352 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
4352
391 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
36
392 return o.asReturnedValue();
executed 212 times by 2 tests: return o.asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
212
393}-
394-
395ReturnedValue ObjectPrototype::method_preventExtensions(const FunctionObject *b, const Value *, const Value *argv, int argc)-
396{-
397 Scope scope(b);-
398 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 863 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-863
399 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
400-
401 ScopedObject o(scope, argv[0].toObject(scope.engine));-
402 if (!o)
!oDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 856 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-856
403 return argv[0].asReturnedValue();
executed 8 times by 1 test: return argv[0].asReturnedValue();
Executed by:
  • tst_ecmascripttests
8
404-
405 o->preventExtensions();-
406 return o.asReturnedValue();
executed 855 times by 1 test: return o.asReturnedValue();
Executed by:
  • tst_ecmascripttests
855
407}-
408-
409ReturnedValue ObjectPrototype::method_isSealed(const FunctionObject *b, const Value *, const Value *argv, int argc)-
410{-
411 Scope scope(b);-
412 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 163 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-163
413 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
414-
415 ScopedObject o(scope, argv[0].toObject(scope.engine));-
416 if (!o)
!oDescription
TRUEnever evaluated
FALSEevaluated 162 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-162
417 return Encode(true);
never executed: return Encode(true);
0
418-
419 if (o->isExtensible())
o->isExtensible()Description
TRUEevaluated 116 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-116
420 return Encode(false);
executed 115 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
115
421-
422 if (o->internalClass() != o->internalClass()->sealed())
o->internalCla...ss()->sealed()Description
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-48
423 return Encode(false);
never executed: return Encode(false);
0
424-
425 if (!o->arrayData() || !o->arrayData()->length())
!o->arrayData()Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!o->arrayData()->length()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
2-42
426 return Encode(true);
executed 44 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
44
427-
428 Q_ASSERT(o->arrayData() && o->arrayData()->length());-
429 if (!o->arrayData()->attrs)
!o->arrayData()->attrsDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-4
430 return Encode(false);
never executed: return Encode(false);
0
431-
432 for (uint i = 0; i < o->arrayData()->values.alloc; ++i) {
i < o->arrayDa...->values.allocDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-32
433 if (!o->arrayData()->isEmpty(i))
!o->arrayData()->isEmpty(i)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-24
434 if (o->arrayData()->attributes(i).isConfigurable())
o->arrayData()...Configurable()Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-8
435 return Encode(false);
never executed: return Encode(false);
0
436 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
32
437-
438 return Encode(true);
executed 4 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
4
439}-
440-
441ReturnedValue ObjectPrototype::method_isFrozen(const FunctionObject *b, const Value *, const Value *argv, int argc)-
442{-
443 Scope scope(b);-
444 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 272 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-272
445 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
446-
447 ScopedObject o(scope, argv[0].toObject(scope.engine));-
448 if (!o)
!oDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 263 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-263
449 return Encode(true);
executed 8 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
8
450-
451 if (o->isExtensible())
o->isExtensible()Description
TRUEevaluated 127 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 136 times by 1 test
Evaluated by:
  • tst_ecmascripttests
127-136
452 return Encode(false);
executed 127 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
127
453-
454 if (o->internalClass() != o->internalClass()->frozen())
o->internalCla...ss()->frozen()Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
60-76
455 return Encode(false);
executed 60 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
60
456-
457 if (!o->arrayData() || !o->arrayData()->length())
!o->arrayData()Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!o->arrayData()->length()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-56
458 return Encode(true);
executed 60 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
60
459-
460 Q_ASSERT(o->arrayData() && o->arrayData()->length());-
461 if (!o->arrayData()->attrs)
!o->arrayData()->attrsDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-16
462 return Encode(false);
never executed: return Encode(false);
0
463-
464 for (uint i = 0; i < o->arrayData()->values.alloc; ++i) {
i < o->arrayDa...->values.allocDescription
TRUEevaluated 4192 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-4192
465 if (!o->arrayData()->isEmpty(i))
!o->arrayData()->isEmpty(i)Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
40-4152
466 if (o->arrayData()->attributes(i).isConfigurable() || o->arrayData()->attributes(i).isWritable())
o->arrayData()...Configurable()Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
o->arrayData()...).isWritable()Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-40
467 return Encode(false);
never executed: return Encode(false);
0
468 }
executed 4192 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
4192
469-
470 return Encode(true);
executed 16 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
16
471}-
472-
473ReturnedValue ObjectPrototype::method_isExtensible(const FunctionObject *b, const Value *, const Value *argv, int argc)-
474{-
475 Scope scope(b);-
476 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 844 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-844
477 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
478-
479 ScopedObject o(scope, argv[0].toObject(scope.engine));-
480 if (!o)
!oDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 837 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-837
481 return Encode(false);
executed 8 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
8
482-
483 return Encode((bool)o->isExtensible());
executed 835 times by 1 test: return Encode((bool)o->isExtensible());
Executed by:
  • tst_ecmascripttests
835
484}-
485-
486ReturnedValue ObjectPrototype::method_keys(const FunctionObject *b, const Value *, const Value *argv, int argc)-
487{-
488 Scope scope(b);-
489 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 378 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-378
490 return scope.engine->throwTypeError();
never executed: return scope.engine->throwTypeError();
0
491-
492 ScopedObject o(scope, argv[0].toObject(scope.engine));-
493 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 371 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-371
494 return QV4::Encode::undefined();
executed 6 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
6
495-
496 ScopedArrayObject a(scope, scope.engine->newArrayObject());-
497-
498 ObjectIterator it(scope, o, ObjectIterator::EnumerableOnly);-
499 ScopedValue name(scope);-
500 while (1) {-
501 name = it.nextPropertyNameAsString();-
502 if (name->isNull())
name->isNull()Description
TRUEevaluated 372 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 636 times by 1 test
Evaluated by:
  • tst_ecmascripttests
372-636
503 break;
executed 372 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
372
504 a->push_back(name);-
505 }
executed 633 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
633
506-
507 return a.asReturnedValue();
executed 372 times by 1 test: return a.asReturnedValue();
Executed by:
  • tst_ecmascripttests
372
508}-
509-
510ReturnedValue ObjectPrototype::method_setPrototypeOf(const FunctionObject *f, const Value *, const Value *argv, int argc)-
511{-
512 Scope scope(f->engine());-
513 if (argc < 2 || argv[0].isNullOrUndefined() || !(argv[1].isObject() || argv[1].isNull()))
argc < 2Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 264 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[0].isNullOrUndefined()Description
TRUEnever evaluated
FALSEevaluated 264 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[1].isObject()Description
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[1].isNull()Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-264
514 return scope.engine->throwTypeError();
executed 32 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
32
515-
516 if (!argv[0].isObject())
!argv[0].isObject()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 228 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-228
517 return argv[0].asReturnedValue();
executed 16 times by 1 test: return argv[0].asReturnedValue();
Executed by:
  • tst_ecmascripttests
16
518-
519 ScopedObject o(scope, argv[0]);-
520 const Object *p = argv[1].isNull() ? nullptr : static_cast<const Object *>(argv + 1);
argv[1].isNull()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-208
521 bool ok = o->setPrototypeOf(p);-
522 if (!ok)
!okDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 180 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-180
523 return scope.engine->throwTypeError(QStringLiteral("Could not change prototype."));
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:
  • tst_ecmascripttests
executed 48 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
48
524 return o->asReturnedValue();
executed 180 times by 1 test: return o->asReturnedValue();
Executed by:
  • tst_ecmascripttests
180
525}-
526-
527ReturnedValue ObjectPrototype::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int)-
528{-
529 ExecutionEngine *v4 = b->engine();-
530 QString string;-
531 if (thisObject->isUndefined()) {
thisObject->isUndefined()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4722 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
12-4722
532 string = QStringLiteral("[object Undefined]");-
533 } else if (thisObject->isNull()) {
executed 12 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
thisObject->isNull()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4727 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
4-4727
534 string = QStringLiteral("[object Null]");-
535 } else {
executed 4 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
4
536 const Object *o = thisObject->as<Object>();-
537 if (!o) {
!oDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4679 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
36-4679
538 // primitive, get the proper prototype-
539 if (thisObject->isBoolean())
thisObject->isBoolean()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-24
540 o = v4->booleanPrototype();
executed 12 times by 1 test: o = v4->booleanPrototype();
Executed by:
  • tst_ecmascripttests
12
541 else if (thisObject->isNumber())
thisObject->isNumber()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12
542 o = v4->numberPrototype();
executed 12 times by 1 test: o = v4->numberPrototype();
Executed by:
  • tst_ecmascripttests
12
543 else if (thisObject->isString())
thisObject->isString()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-12
544 o = v4->stringPrototype();
executed 12 times by 1 test: o = v4->stringPrototype();
Executed by:
  • tst_ecmascripttests
12
545 else if (thisObject->isSymbol())
thisObject->isSymbol()Description
TRUEnever evaluated
FALSEnever evaluated
0
546 o = v4->symbolPrototype();
never executed: o = v4->symbolPrototype();
0
547 Q_ASSERT(o);-
548 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
36
549 QString name = o->className();-
550 Scope scope(v4);-
551 ScopedString toStringTag(scope, o->get(v4->symbol_toStringTag()));-
552 if (toStringTag)
toStringTagDescription
TRUEevaluated 1836 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2871 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
1836-2871
553 name = toStringTag->toQString();
executed 1837 times by 1 test: name = toStringTag->toQString();
Executed by:
  • tst_ecmascripttests
1837
554 string = QStringLiteral("[object %1]").arg(name);-
555 }
executed 4709 times by 5 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
4709
556 return Encode(v4->newString(string));
executed 4747 times by 5 tests: return Encode(v4->newString(string));
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlconsole
  • tst_qqmlecmascript
4747
557}-
558-
559ReturnedValue ObjectPrototype::method_toLocaleString(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
560{-
561 Scope scope(b);-
562 ScopedObject o(scope, thisObject->toObject(scope.engine));-
563 if (!o)
!oDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-144
564 RETURN_UNDEFINED();
executed 20 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
20
565-
566 ScopedFunctionObject f(scope, o->get(scope.engine->id_toString()));-
567 if (!f)
!fDescription
TRUEnever evaluated
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-144
568 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
569-
570 return f->call(thisObject, argv, argc);
executed 144 times by 1 test: return f->call(thisObject, argv, argc);
Executed by:
  • tst_ecmascripttests
144
571}-
572-
573ReturnedValue ObjectPrototype::method_valueOf(const FunctionObject *b, const Value *thisObject, const Value *, int)-
574{-
575 return Encode(thisObject->toObject(b->engine()));
executed 4505 times by 6 tests: return Encode(thisObject->toObject(b->engine()));
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquickdraghandler
4505
576}-
577-
578ReturnedValue ObjectPrototype::method_hasOwnProperty(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
579{-
580 Scope scope(b);-
581 ScopedPropertyKey P(scope, (argc ? argv[0] : Primitive::undefinedValue()).toPropertyKey(scope.engine));-
582 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 26800 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlecmascript
  • tst_qquicklayouts
0-26800
583 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
584 ScopedObject O(scope, thisObject->toObject(scope.engine));-
585 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 26861 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlecmascript
  • tst_qquicklayouts
8-26861
586 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
587 bool r = O->getOwnProperty(P) != Attr_Invalid;-
588 return Encode(r);
executed 26890 times by 5 tests: return Encode(r);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlecmascript
  • tst_qquicklayouts
26890
589}-
590-
591ReturnedValue ObjectPrototype::method_isPrototypeOf(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
592{-
593 Scope scope(b);-
594 if (!argc || !argv[0].isObject())
!argcDescription
TRUEnever evaluated
FALSEevaluated 546 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!argv[0].isObject()Description
TRUEnever evaluated
FALSEevaluated 546 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-546
595 return Encode(false);
never executed: return Encode(false);
0
596-
597 ScopedObject V(scope, argv[0]);-
598 ScopedObject O(scope, thisObject->toObject(scope.engine));-
599 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 539 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-539
600 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
601 ScopedObject proto(scope, V->getPrototypeOf());-
602 while (proto) {
protoDescription
TRUEevaluated 568 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-568
603 if (O->d() == proto->d())
O->d() == proto->d()Description
TRUEevaluated 528 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
40-528
604 return Encode(true);
executed 527 times by 1 test: return Encode(true);
Executed by:
  • tst_ecmascripttests
527
605 proto = proto->getPrototypeOf();-
606 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
40
607 return Encode(false);
executed 12 times by 1 test: return Encode(false);
Executed by:
  • tst_ecmascripttests
12
608}-
609-
610ReturnedValue ObjectPrototype::method_propertyIsEnumerable(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
611{-
612 Scope scope(b);-
613 ScopedPropertyKey p(scope, (argc ? argv[0] : Primitive::undefinedValue()).toPropertyKey(scope.engine));-
614 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 1661 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-1661
615 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
616-
617 ScopedObject o(scope, thisObject->toObject(scope.engine));-
618 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1657 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-1657
619 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
620 PropertyAttributes attrs = o->getOwnProperty(p);-
621 return Encode(attrs.isEnumerable());
executed 1659 times by 1 test: return Encode(attrs.isEnumerable());
Executed by:
  • tst_ecmascripttests
1659
622}-
623-
624ReturnedValue ObjectPrototype::method_defineGetter(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
625{-
626 Scope scope(b);-
627 if (argc < 2)
argc < 2Description
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
628 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
629-
630 ScopedFunctionObject f(scope, argv[1]);-
631 if (!f)
!fDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
632 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
633-
634 ScopedString prop(scope, argv[0], ScopedString::Convert);-
635 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
636 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
637-
638 ScopedObject o(scope, thisObject);-
639 if (!o) {
!oDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
2-6
640 if (!thisObject->isUndefined())
!thisObject->isUndefined()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
0-2
641 RETURN_UNDEFINED();
never executed: return QV4::Encode::undefined();
0
642 o = scope.engine->globalObject;-
643 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qjsengine
2
644-
645 ScopedProperty pd(scope);-
646 pd->value = f;-
647 pd->set = Primitive::emptyValue();-
648 bool ok = o->defineOwnProperty(prop->toPropertyKey(), pd, Attr_Accessor);-
649 if (!ok)
!okDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
650 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
651 RETURN_UNDEFINED();
executed 8 times by 2 tests: return QV4::Encode::undefined();
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
8
652}-
653-
654ReturnedValue ObjectPrototype::method_defineSetter(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
655{-
656 Scope scope(b);-
657 if (argc < 2)
argc < 2Description
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
658 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
659-
660 ScopedFunctionObject f(scope, argv[1]);-
661 if (!f)
!fDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
662 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
663-
664 ScopedString prop(scope, argv[0], ScopedString::Convert);-
665 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
666 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
667-
668 ScopedObject o(scope, thisObject);-
669 if (!o) {
!oDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
2-6
670 if (!thisObject->isUndefined())
!thisObject->isUndefined()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
0-2
671 RETURN_UNDEFINED();
never executed: return QV4::Encode::undefined();
0
672 o = scope.engine->globalObject;-
673 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qjsengine
2
674-
675 ScopedProperty pd(scope);-
676 pd->value = Primitive::emptyValue();-
677 pd->set = f;-
678 bool ok = o->defineOwnProperty(prop->toPropertyKey(), pd, Attr_Accessor);-
679 if (!ok)
!okDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
0-8
680 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
681 RETURN_UNDEFINED();
executed 8 times by 2 tests: return QV4::Encode::undefined();
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
8
682}-
683-
684ReturnedValue ObjectPrototype::method_get_proto(const FunctionObject *b, const Value *thisObject, const Value *, int)-
685{-
686 Scope scope(b);-
687 ScopedObject o(scope, thisObject->as<Object>());-
688 if (!o)
!oDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsvalue
0-2
689 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
690-
691 return Encode(o->getPrototypeOf());
executed 2 times by 1 test: return Encode(o->getPrototypeOf());
Executed by:
  • tst_qjsvalue
2
692}-
693-
694ReturnedValue ObjectPrototype::method_set_proto(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
695{-
696 Scope scope(b);-
697 ScopedObject o(scope, thisObject);-
698 if (!o || !argc || (!argv[0].isObject() && !argv[0].isNull()))
!oDescription
TRUEnever evaluated
FALSEevaluated 46 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
!argcDescription
TRUEnever evaluated
FALSEevaluated 46 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
!argv[0].isObject()Description
TRUEnever evaluated
FALSEevaluated 46 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
!argv[0].isNull()Description
TRUEnever evaluated
FALSEnever evaluated
0-46
699 THROW_TYPE_ERROR();
never executed: return scope.engine->throwTypeError();
0
700-
701 const Object *p = argv[0].isNull() ? nullptr : static_cast<const Object *>(argv);
argv[0].isNull()Description
TRUEnever evaluated
FALSEevaluated 46 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
0-46
702 bool ok = o->setPrototypeOf(p);-
703 if (!ok)
!okDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
FALSEevaluated 40 times by 3 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
6-40
704 return scope.engine->throwTypeError(QStringLiteral("Could not change prototype."));
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:
  • tst_ecmascripttests
  • tst_qjsvalue
executed 6 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
6
705 return Encode::undefined();
executed 40 times by 3 tests: return Encode::undefined();
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
40
706 RETURN_UNDEFINED();
dead code: return QV4::Encode::undefined();
-
707}-
708-
709void ObjectPrototype::toPropertyDescriptor(ExecutionEngine *engine, const Value &v, Property *desc, PropertyAttributes *attrs)-
710{-
711 Scope scope(engine);-
712 ScopedObject o(scope, v);-
713 if (!o) {
!oDescription
TRUEevaluated 74 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 20786 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
74-20786
714 engine->throwTypeError();-
715 return;
executed 75 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
75
716 }-
717-
718 attrs->clear();-
719 desc->value = Primitive::emptyValue();-
720 desc->set = Primitive::emptyValue();-
721 ScopedValue tmp(scope);-
722-
723 if (o->hasProperty(engine->id_enumerable()->toPropertyKey()))
o->hasProperty...PropertyKey())Description
TRUEevaluated 4506 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsonbinding
FALSEevaluated 16350 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
4506-16350
724 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:
  • tst_ecmascripttests
  • tst_qjsonbinding
4490
725-
726 if (o->hasProperty(engine->id_configurable()->toPropertyKey()))
o->hasProperty...PropertyKey())Description
TRUEevaluated 9280 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 11586 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
9280-11586
727 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:
  • tst_ecmascripttests
9255
728-
729 if (o->hasProperty(engine->id_get()->toPropertyKey())) {
o->hasProperty...PropertyKey())Description
TRUEevaluated 9628 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 11248 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsonbinding
9628-11248
730 ScopedValue get(scope, o->get(engine->id_get()));-
731 FunctionObject *f = get->as<FunctionObject>();-
732 if (f || get->isUndefined()) {
fDescription
TRUEevaluated 9067 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 509 times by 1 test
Evaluated by:
  • tst_ecmascripttests
get->isUndefined()Description
TRUEevaluated 453 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 59 times by 1 test
Evaluated by:
  • tst_ecmascripttests
59-9067
733 desc->value = get;-
734 } else {
executed 9520 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
9520
735 engine->throwTypeError();-
736 return;
executed 59 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
59
737 }-
738 attrs->setType(PropertyAttributes::Accessor);-
739 }
executed 9528 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
9528
740-
741 if (o->hasProperty(engine->id_set()->toPropertyKey())) {
o->hasProperty...PropertyKey())Description
TRUEevaluated 3604 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 17196 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
3604-17196
742 ScopedValue set(scope, o->get(engine->id_set()));-
743 FunctionObject *f = set->as<FunctionObject>();-
744 if (f || set->isUndefined()) {
fDescription
TRUEevaluated 3040 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 555 times by 1 test
Evaluated by:
  • tst_ecmascripttests
set->isUndefined()Description
TRUEevaluated 490 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
64-3040
745 desc->set = set;-
746 } else {
executed 3522 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
3522
747 engine->throwTypeError();-
748 return;
executed 64 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
64
749 }-
750 attrs->setType(PropertyAttributes::Accessor);-
751 }
executed 3528 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
3528
752-
753 if (o->hasProperty(engine->id_writable()->toPropertyKey())) {
o->hasProperty...PropertyKey())Description
TRUEevaluated 2998 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 17749 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
2998-17749
754 if (attrs->isAccessor()) {
attrs->isAccessor()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2974 times by 1 test
Evaluated by:
  • tst_ecmascripttests
24-2974
755 engine->throwTypeError();-
756 return;
executed 23 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
23
757 }-
758 attrs->setWritable((tmp = o->get(engine->id_writable()))->toBoolean());-
759 // writable forces it to be a data descriptor-
760 desc->value = Primitive::undefinedValue();-
761 }
executed 2962 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
2962
762-
763 if (o->hasProperty(engine->id_value()->toPropertyKey())) {
o->hasProperty...PropertyKey())Description
TRUEevaluated 5760 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsonbinding
FALSEevaluated 14963 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
5760-14963
764 if (attrs->isAccessor()) {
attrs->isAccessor()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 5721 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsonbinding
24-5721
765 engine->throwTypeError();-
766 return;
executed 24 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
24
767 }-
768 desc->value = o->get(engine->id_value());-
769 attrs->setType(PropertyAttributes::Data);-
770 }
executed 5725 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsonbinding
5725
771-
772 if (attrs->isGeneric())
attrs->isGeneric()Description
TRUEevaluated 2651 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 18012 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
2651-18012
773 desc->value = Primitive::emptyValue();
executed 2649 times by 1 test: desc->value = Primitive::emptyValue();
Executed by:
  • tst_ecmascripttests
2649
774}
executed 20629 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsonbinding
20629
775-
776-
777ReturnedValue ObjectPrototype::fromPropertyDescriptor(ExecutionEngine *engine, const Property *desc, PropertyAttributes attrs)-
778{-
779 if (attrs.isEmpty())
attrs.isEmpty()Description
TRUEevaluated 1253 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 23840 times by 1 test
Evaluated by:
  • tst_ecmascripttests
1253-23840
780 return Encode::undefined();
executed 1253 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
1253
781-
782 Scope scope(engine);-
783 // Let obj be the result of creating a new object as if by the expression new Object() where Object-
784 // is the standard built-in constructor with that name.-
785 ScopedObject o(scope, engine->newObject());-
786 ScopedString s(scope);-
787 ScopedValue v(scope);-
788-
789 if (attrs.isData()) {
attrs.isData()Description
TRUEevaluated 19307 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4550 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4550-19307
790 s = engine->newString(QStringLiteral("value"));
executed 19293 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
19293
791 o->put(s, desc->value);-
792 v = Primitive::fromBoolean(attrs.isWritable());-
793 s = engine->newString(QStringLiteral("writable"));
executed 19312 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
19312
794 o->put(s, v);-
795 } else {
executed 19343 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
19343
796 v = desc->getter() ? desc->getter()->asReturnedValue() : Encode::undefined();
desc->getter()Description
TRUEevaluated 3407 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1146 times by 1 test
Evaluated by:
  • tst_ecmascripttests
1146-3407
797 s = engine->newString(QStringLiteral("get"));
executed 4552 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
4552
798 o->put(s, v);-
799 v = desc->setter() ? desc->setter()->asReturnedValue() : Encode::undefined();
desc->setter()Description
TRUEevaluated 2764 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1801 times by 1 test
Evaluated by:
  • tst_ecmascripttests
1801-2764
800 s = engine->newString(QStringLiteral("set"));
executed 4570 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
4570
801 o->put(s, v);-
802 }
executed 4575 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
4575
803 v = Primitive::fromBoolean(attrs.isEnumerable());-
804 s = engine->newString(QStringLiteral("enumerable"));
executed 23891 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
23891
805 o->put(s, v);-
806 v = Primitive::fromBoolean(attrs.isConfigurable());-
807 s = engine->newString(QStringLiteral("configurable"));
executed 23890 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
23890
808 o->put(s, v);-
809-
810 return o.asReturnedValue();
executed 23961 times by 1 test: return o.asReturnedValue();
Executed by:
  • tst_ecmascripttests
23961
811}-
812-
813// es6: GetOwnPropertyKeys-
814Heap::ArrayObject *ObjectPrototype::getOwnPropertyNames(ExecutionEngine *v4, const Value &o)-
815{-
816 Scope scope(v4);-
817 ScopedArrayObject array(scope, v4->newArrayObject());-
818 ScopedObject O(scope, o.toObject(v4));-
819 if (O) {
ODescription
TRUEevaluated 2237 times by 6 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qquickworkerscript
FALSEnever evaluated
0-2237
820 ObjectIterator it(scope, O, ObjectIterator::NoFlags);-
821 ScopedValue name(scope);-
822 while (1) {-
823 name = it.nextPropertyNameAsString();-
824 if (name->isNull())
name->isNull()Description
TRUEevaluated 2236 times by 6 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qquickworkerscript
FALSEevaluated 4776 times by 6 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qquickworkerscript
2236-4776
825 break;
executed 2235 times by 6 tests: break;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qquickworkerscript
2235
826 array->push_back(name);-
827 }
executed 4775 times by 6 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qquickworkerscript
4775
828 }
executed 2235 times by 6 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qquickworkerscript
2235
829 return array->d();
executed 2235 times by 6 tests: return array->d();
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qquickworkerscript
2235
830}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0