OpenCoverage

qv4stringobject.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4stringobject.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40-
41#include "qv4stringobject_p.h"-
42#include "qv4regexp_p.h"-
43#include "qv4regexpobject_p.h"-
44#include "qv4objectproto_p.h"-
45#include <private/qv4mm_p.h>-
46#include "qv4scopedvalue_p.h"-
47#include "qv4symbol_p.h"-
48#include "qv4alloca_p.h"-
49#include "qv4jscall_p.h"-
50#include "qv4stringiterator_p.h"-
51#include <QtCore/QDateTime>-
52#include <QtCore/QDebug>-
53#include <QtCore/QStringList>-
54-
55#include <cassert>-
56-
57#ifndef Q_OS_WIN-
58# include <time.h>-
59# ifndef Q_OS_VXWORKS-
60# include <sys/time.h>-
61# else-
62# include "qplatformdefs.h"-
63# endif-
64#else-
65# include <windows.h>-
66#endif-
67-
68using namespace QV4;-
69-
70DEFINE_OBJECT_VTABLE(StringObject);-
71-
72void Heap::StringObject::init()-
73{-
74 Object::init();-
75 Q_ASSERT(vtable() == QV4::StringObject::staticVTable());-
76 string.set(internalClass->engine, internalClass->engine->id_empty()->d());-
77 setProperty(internalClass->engine, LengthPropertyIndex, Primitive::fromInt32(0));-
78}
never executed: end of block
0
79-
80void Heap::StringObject::init(const QV4::String *str)-
81{-
82 Object::init();-
83 string.set(internalClass->engine, str->d());-
84 setProperty(internalClass->engine, LengthPropertyIndex, Primitive::fromInt32(length()));-
85}
executed 48304 times by 14 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllocale
  • tst_qqmltranslation
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
  • tst_testfiltering
48304
86-
87Heap::String *Heap::StringObject::getIndex(uint index) const-
88{-
89 QString str = string->toQString();-
90 if (index >= (uint)str.length())
index >= (uint)str.length()Description
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 1076 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
28-1076
91 return nullptr;
executed 28 times by 2 tests: return nullptr;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
28
92 return internalClass->engine->newString(str.mid(index, 1));
executed 1076 times by 4 tests: return internalClass->engine->newString(str.mid(index, 1));
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
1076
93}-
94-
95uint Heap::StringObject::length() const-
96{-
97 return string->length();
executed 48934 times by 14 tests: return string->length();
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllocale
  • tst_qqmltranslation
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickvisualdatamodel
  • tst_testfiltering
48934
98}-
99-
100bool StringObject::virtualDeleteProperty(Managed *m, PropertyKey id)-
101{-
102 Q_ASSERT(m->as<StringObject>());-
103 if (id.isArrayIndex()) {
id.isArrayIndex()Description
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 86 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
28-86
104 StringObject *o = static_cast<StringObject *>(m);-
105 uint index = id.asArrayIndex();-
106 if (index < static_cast<uint>(o->d()->string->toQString().length()))
index < static...ng().length())Description
TRUEevaluated 26 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
2-26
107 return false;
executed 26 times by 2 tests: return false;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
26
108 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qjsengine
2
109 return Object::virtualDeleteProperty(m, id);
executed 88 times by 2 tests: return Object::virtualDeleteProperty(m, id);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
88
110}-
111-
112void StringObject::virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attrs)-
113{-
114 name->setM(nullptr);-
115 StringObject *s = static_cast<StringObject *>(m);-
116 uint slen = s->d()->string->toQString().length();-
117 if (it->arrayIndex <= slen) {
it->arrayIndex <= slenDescription
TRUEevaluated 577 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
28-577
118 while (it->arrayIndex < slen) {
it->arrayIndex < slenDescription
TRUEevaluated 322 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
FALSEevaluated 256 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
256-322
119 *index = it->arrayIndex;-
120 ++it->arrayIndex;-
121 Property pd;-
122 PropertyAttributes a = s->getOwnProperty(PropertyKey::fromArrayIndex(*index), &pd);-
123 if (!(it->flags & ObjectIterator::EnumerableOnly) || a.isEnumerable()) {
!(it->flags & ...numerableOnly)Description
TRUEevaluated 148 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalueiterator
FALSEevaluated 174 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
a.isEnumerable()Description
TRUEevaluated 174 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
FALSEnever evaluated
0-174
124 *attrs = a;-
125 p->copy(&pd, a);-
126 return;
executed 322 times by 4 tests: return;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
322
127 }-
128 }
never executed: end of block
0
129 if (s->arrayData()) {
s->arrayData()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 244 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
12-244
130 it->arrayNode = s->sparseBegin();-
131 // iterate until we're past the end of the string-
132 while (it->arrayNode && it->arrayNode->key() < slen)
it->arrayNodeDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
it->arrayNode->key() < slenDescription
TRUEnever evaluated
FALSEnever evaluated
0-12
133 it->arrayNode = it->arrayNode->nextNode();
never executed: it->arrayNode = it->arrayNode->nextNode();
0
134 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
12
135 }
executed 256 times by 4 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
256
136-
137 return Object::virtualAdvanceIterator(m, it, name, index, p, attrs);
executed 284 times by 4 tests: return Object::virtualAdvanceIterator(m, it, name, index, p, attrs);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
284
138}-
139-
140PropertyAttributes StringObject::virtualGetOwnProperty(Managed *m, PropertyKey id, Property *p)-
141{-
142 PropertyAttributes attributes = Object::virtualGetOwnProperty(m, id, p);-
143 if (attributes != Attr_Invalid)
attributes != Attr_InvalidDescription
TRUEevaluated 510 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1548 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
510-1548
144 return attributes;
executed 510 times by 1 test: return attributes;
Executed by:
  • tst_ecmascripttests
510
145-
146 Object *o = static_cast<Object *>(m);-
147 if (id.isArrayIndex()) {
id.isArrayIndex()Description
TRUEevaluated 542 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
FALSEevaluated 1006 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
542-1006
148 uint index = id.asArrayIndex();-
149 if (o->isStringObject()) {
o->isStringObject()Description
TRUEevaluated 542 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
FALSEnever evaluated
0-542
150 if (index >= static_cast<const StringObject *>(m)->length())
index >= stati...>(m)->length()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 530 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
12-530
151 return Attr_Invalid;
executed 12 times by 1 test: return Attr_Invalid;
Executed by:
  • tst_ecmascripttests
12
152 if (p)
pDescription
TRUEevaluated 438 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_ecmascripttests
92-438
153 p->value = static_cast<StringObject *>(o)->getIndex(index);
executed 438 times by 4 tests: p->value = static_cast<StringObject *>(o)->getIndex(index);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
438
154 return Attr_NotConfigurable|Attr_NotWritable;
executed 530 times by 4 tests: return Attr_NotConfigurable|Attr_NotWritable;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
530
155 }-
156 }
never executed: end of block
0
157 return Attr_Invalid;
executed 1006 times by 2 tests: return Attr_Invalid;
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
1006
158}-
159-
160DEFINE_OBJECT_VTABLE(StringCtor);-
161-
162void Heap::StringCtor::init(QV4::ExecutionContext *scope)-
163{-
164 Heap::FunctionObject::init(scope, QStringLiteral("String"));
executed 98740 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
  • ...
98740
165}
executed 99086 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
  • ...
99086
166-
167ReturnedValue StringCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *)-
168{-
169 ExecutionEngine *v4 = static_cast<const Object *>(f)->engine();-
170 Scope scope(v4);-
171 ScopedString value(scope);-
172 if (argc)
argcDescription
TRUEevaluated 3214 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
FALSEevaluated 256 times by 1 test
Evaluated by:
  • tst_ecmascripttests
256-3214
173 value = argv[0].toString(v4);
executed 3215 times by 5 tests: value = argv[0].toString(v4);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
3215
174 else-
175 value = v4->newString();
executed 256 times by 1 test: value = v4->newString();
Executed by:
  • tst_ecmascripttests
256
176 CHECK_EXCEPTION();
executed 11 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
scope.hasException()Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3468 times by 5 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
11-3468
177 return Encode(v4->newStringObject(value));
executed 3467 times by 5 tests: return Encode(v4->newStringObject(value));
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
3467
178}-
179-
180ReturnedValue StringCtor::virtualCall(const FunctionObject *m, const Value *, const Value *argv, int argc)-
181{-
182 ExecutionEngine *v4 = m->engine();-
183 if (!argc)
!argcDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 616874 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-616874
184 return v4->newString()->asReturnedValue();
executed 4 times by 1 test: return v4->newString()->asReturnedValue();
Executed by:
  • tst_ecmascripttests
4
185 if (argv[0].isSymbol())
argv[0].isSymbol()Description
TRUEevaluated 500 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 616418 times by 1 test
Evaluated by:
  • tst_ecmascripttests
500-616418
186 return v4->newString(argv[0].symbolValue()->descriptiveString())->asReturnedValue();
executed 500 times by 1 test: return v4->newString(argv[0].symbolValue()->descriptiveString())->asReturnedValue();
Executed by:
  • tst_ecmascripttests
500
187 return argv[0].toString(v4)->asReturnedValue();
executed 616377 times by 1 test: return argv[0].toString(v4)->asReturnedValue();
Executed by:
  • tst_ecmascripttests
616377
188}-
189-
190ReturnedValue StringCtor::method_fromCharCode(const FunctionObject *b, const Value *, const Value *argv, int argc)-
191{-
192 QString str(argc, Qt::Uninitialized);-
193 QChar *ch = str.data();-
194 for (int i = 0, ei = argc; i < ei; ++i) {
i < eiDescription
TRUEevaluated 28032727 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 17044476 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
17044476-28032727
195 *ch = QChar(argv[i].toUInt16());-
196 ++ch;-
197 }
executed 28025947 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
28025947
198 *ch = 0;-
199 return Encode(b->engine()->newString(str));
executed 17068719 times by 2 tests: return Encode(b->engine()->newString(str));
Executed by:
  • tst_ecmascripttests
  • tst_examples
17068719
200}-
201-
202-
203-
204ReturnedValue StringCtor::method_fromCodePoint(const FunctionObject *f, const Value *, const Value *argv, int argc)-
205{-
206 ExecutionEngine *e = f->engine();-
207 QString result(argc*2, Qt::Uninitialized); // assume worst case-
208 QChar *ch = result.data();-
209 for (int i = 0; i < argc; ++i) {
i < argcDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 59 times by 1 test
Evaluated by:
  • tst_ecmascripttests
59-140
210 double num = argv[i].toNumber();-
211 if (e->hasException)
e->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-124
212 return Encode::undefined();
executed 16 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
213 int cp = static_cast<int>(num);-
214 if (cp != num || cp < 0 || cp > 0x10ffff)
cp != numDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 95 times by 1 test
Evaluated by:
  • tst_ecmascripttests
cp < 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 87 times by 1 test
Evaluated by:
  • tst_ecmascripttests
cp > 0x10ffffDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-95
215 return e->throwRangeError(QStringLiteral("String.fromCodePoint: argument out of range."));
executed 40 times by 1 test: return e->throwRangeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "String.fromCodePoint: argument out of range.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "String.fromCodePoint: argument out of range." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_ecmascripttests
executed 40 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
40
216 if (cp > 0xffff) {
cp > 0xffffDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 63 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-63
217 *ch = QChar::highSurrogate(cp);-
218 ++ch;-
219 *ch = QChar::lowSurrogate(cp);-
220 } else {
executed 20 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
20
221 *ch = cp;-
222 }
executed 63 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
63
223 ++ch;-
224 }
executed 83 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
83
225 *ch = 0;-
226 result.truncate(ch - result.constData());-
227 return e->newString(result)->asReturnedValue();
executed 60 times by 1 test: return e->newString(result)->asReturnedValue();
Executed by:
  • tst_ecmascripttests
60
228}-
229-
230void StringPrototype::init(ExecutionEngine *engine, Object *ctor)-
231{-
232 Scope scope(engine);-
233 ScopedObject o(scope);-
234-
235 // need to set this once again, as these were not fully defined when creating the string proto-
236 Heap::InternalClass *ic = scope.engine->classes[ExecutionEngine::Class_StringObject]->changePrototype(scope.engine->objectPrototype()->d());-
237 d()->internalClass.set(scope.engine, ic);-
238 d()->string.set(scope.engine, scope.engine->id_empty()->d());-
239 setProperty(scope.engine, Heap::StringObject::LengthPropertyIndex, Primitive::fromInt32(0));-
240-
241 ctor->defineReadonlyProperty(engine->id_prototype(), (o = this));-
242 ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1));-
243 ctor->defineDefaultProperty(QStringLiteral("fromCharCode"), StringCtor::method_fromCharCode, 1);
executed 98391 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
  • ...
98391
244 ctor->defineDefaultProperty(QStringLiteral("fromCodePoint"), StringCtor::method_fromCodePoint, 1);
executed 98846 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
  • ...
98846
245-
246 defineDefaultProperty(QStringLiteral("constructor"), (o = ctor));
executed 98866 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
  • ...
98866
247 defineDefaultProperty(engine->id_toString(), method_toString);-
248 defineDefaultProperty(engine->id_valueOf(), method_toString); // valueOf and toString are identical-
249 defineDefaultProperty(QStringLiteral("charAt"), method_charAt, 1);
executed 99063 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
  • ...
99063
250 defineDefaultProperty(QStringLiteral("charCodeAt"), method_charCodeAt, 1);
executed 98363 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
  • ...
98363
251 defineDefaultProperty(QStringLiteral("codePointAt"), method_codePointAt, 1);
executed 99090 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
  • ...
99090
252 defineDefaultProperty(QStringLiteral("concat"), method_concat, 1);
executed 98876 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
  • ...
98876
253 defineDefaultProperty(QStringLiteral("endsWith"), method_endsWith, 1);
executed 99076 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
  • ...
99076
254 defineDefaultProperty(QStringLiteral("indexOf"), method_indexOf, 1);
executed 99056 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
  • ...
99056
255 defineDefaultProperty(QStringLiteral("includes"), method_includes, 1);
executed 99079 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
  • ...
99079
256 defineDefaultProperty(QStringLiteral("lastIndexOf"), method_lastIndexOf, 1);
executed 98838 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
  • ...
98838
257 defineDefaultProperty(QStringLiteral("localeCompare"), method_localeCompare, 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
258 defineDefaultProperty(QStringLiteral("match"), method_match, 1);
executed 98810 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
  • ...
98810
259 defineDefaultProperty(QStringLiteral("normalize"), method_normalize, 0);
executed 99086 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
  • ...
99086
260 defineDefaultProperty(QStringLiteral("padEnd"), method_padEnd, 1);
executed 98854 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
  • ...
98854
261 defineDefaultProperty(QStringLiteral("padStart"), method_padStart, 1);
executed 98945 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
  • ...
98945
262 defineDefaultProperty(QStringLiteral("repeat"), method_repeat, 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
263 defineDefaultProperty(QStringLiteral("replace"), method_replace, 2);
executed 99113 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
  • ...
99113
264 defineDefaultProperty(QStringLiteral("search"), method_search, 1);
executed 98910 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
  • ...
98910
265 defineDefaultProperty(QStringLiteral("slice"), method_slice, 2);
executed 99088 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
  • ...
99088
266 defineDefaultProperty(QStringLiteral("split"), method_split, 2);
executed 98825 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
  • ...
98825
267 defineDefaultProperty(QStringLiteral("startsWith"), method_startsWith, 1);
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
268 defineDefaultProperty(QStringLiteral("substr"), method_substr, 2);
executed 98912 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
  • ...
98912
269 defineDefaultProperty(QStringLiteral("substring"), method_substring, 2);
executed 99119 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
  • ...
99119
270 defineDefaultProperty(QStringLiteral("toLowerCase"), method_toLowerCase);
executed 99059 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
  • ...
99059
271 defineDefaultProperty(QStringLiteral("toLocaleLowerCase"), method_toLocaleLowerCase);
executed 99088 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
  • ...
99088
272 defineDefaultProperty(QStringLiteral("toUpperCase"), method_toUpperCase);
executed 98846 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
  • ...
98846
273 defineDefaultProperty(QStringLiteral("toLocaleUpperCase"), method_toLocaleUpperCase);
executed 99108 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
  • ...
99108
274 defineDefaultProperty(QStringLiteral("trim"), method_trim);
executed 98817 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
  • ...
98817
275 defineDefaultProperty(engine->symbol_iterator(), method_iterator);-
276}
executed 98662 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
  • ...
98662
277-
278static Heap::String *thisAsString(ExecutionEngine *v4, const QV4::Value *thisObject)-
279{-
280 if (String *s = thisObject->stringValue())
String *s = th...>stringValue()Description
TRUEevaluated 359 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
112-359
281 return s->d();
executed 359 times by 1 test: return s->d();
Executed by:
  • tst_ecmascripttests
359
282 if (const StringObject *thisString = thisObject->as<StringObject>())
const StringOb...tringObject>()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-64
283 return thisString->d()->string;
executed 48 times by 1 test: return thisString->d()->string;
Executed by:
  • tst_ecmascripttests
48
284 return thisObject->toString(v4);
executed 64 times by 1 test: return thisObject->toString(v4);
Executed by:
  • tst_ecmascripttests
64
285}-
286-
287static QString getThisString(ExecutionEngine *v4, const QV4::Value *thisObject)-
288{-
289 if (String *s = thisObject->stringValue())
String *s = th...>stringValue()Description
TRUEevaluated 570539 times by 10 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qquickaccessible
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_signalspy
  • tst_testfiltering
FALSEevaluated 3682 times by 1 test
Evaluated by:
  • tst_ecmascripttests
3682-570539
290 return s->toQString();
executed 570589 times by 10 tests: return s->toQString();
Executed by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qquickaccessible
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_signalspy
  • tst_testfiltering
570589
291 if (const StringObject *thisString = thisObject->as<StringObject>())
const StringOb...tringObject>()Description
TRUEevaluated 2844 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 837 times by 1 test
Evaluated by:
  • tst_ecmascripttests
837-2844
292 return thisString->d()->string->toQString();
executed 2843 times by 1 test: return thisString->d()->string->toQString();
Executed by:
  • tst_ecmascripttests
2843
293 if (thisObject->isUndefined() || thisObject->isNull()) {
thisObject->isUndefined()Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 760 times by 1 test
Evaluated by:
  • tst_ecmascripttests
thisObject->isNull()Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 681 times by 1 test
Evaluated by:
  • tst_ecmascripttests
80-760
294 v4->throwTypeError();-
295 return QString();
executed 159 times by 1 test: return QString();
Executed by:
  • tst_ecmascripttests
159
296 }-
297 return thisObject->toQString();
executed 680 times by 1 test: return thisObject->toQString();
Executed by:
  • tst_ecmascripttests
680
298}-
299-
300ReturnedValue StringPrototype::method_toString(const FunctionObject *b, const Value *thisObject, const Value *, int)-
301{-
302 if (thisObject->isString())
thisObject->isString()Description
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
FALSEevaluated 2271 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
66-2271
303 return thisObject->asReturnedValue();
executed 66 times by 2 tests: return thisObject->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
66
304-
305 ExecutionEngine *v4 = b->engine();-
306 const StringObject *o = thisObject->as<StringObject>();-
307 if (!o)
!oDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2256 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsvalue
16-2256
308 return v4->throwTypeError();
executed 16 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
16
309 return o->d()->string->asReturnedValue();
executed 2255 times by 2 tests: return o->d()->string->asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
2255
310}-
311-
312ReturnedValue StringPrototype::method_charAt(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
313{-
314 ExecutionEngine *v4 = b->engine();-
315 const QString str = getThisString(v4, thisObject);-
316 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 316 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-316
317 return QV4::Encode::undefined();
executed 12 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
318-
319 int pos = 0;-
320 if (argc > 0)
argc > 0Description
TRUEevaluated 312 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-312
321 pos = (int) argv[0].toInteger();
executed 312 times by 1 test: pos = (int) argv[0].toInteger();
Executed by:
  • tst_ecmascripttests
312
322-
323 QString result;-
324 if (pos >= 0 && pos < str.length())
pos >= 0Description
TRUEevaluated 304 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
pos < str.length()Description
TRUEevaluated 288 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-304
325 result += str.at(pos);
executed 288 times by 1 test: result += str.at(pos);
Executed by:
  • tst_ecmascripttests
288
326-
327 return Encode(v4->newString(result));
executed 316 times by 1 test: return Encode(v4->newString(result));
Executed by:
  • tst_ecmascripttests
316
328}-
329-
330ReturnedValue StringPrototype::method_charCodeAt(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
331{-
332 ExecutionEngine *v4 = b->engine();-
333 const QString str = getThisString(v4, thisObject);-
334 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 306 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickaccessible
12-306
335 return QV4::Encode::undefined();
executed 12 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
336-
337 int pos = 0;-
338 if (argc > 0)
argc > 0Description
TRUEevaluated 302 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickaccessible
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-302
339 pos = (int) argv[0].toInteger();
executed 301 times by 2 tests: pos = (int) argv[0].toInteger();
Executed by:
  • tst_ecmascripttests
  • tst_qquickaccessible
301
340-
341-
342 if (pos >= 0 && pos < str.length())
pos >= 0Description
TRUEevaluated 302 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickaccessible
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
pos < str.length()Description
TRUEevaluated 294 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickaccessible
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-302
343 RETURN_RESULT(Encode(str.at(pos).unicode()));
executed 294 times by 2 tests: return QV4::Encode(Encode(str.at(pos).unicode()));
Executed by:
  • tst_ecmascripttests
  • tst_qquickaccessible
294
344-
345 return Encode(qt_qnan());
executed 12 times by 1 test: return Encode(qt_qnan());
Executed by:
  • tst_ecmascripttests
12
346}-
347-
348ReturnedValue StringPrototype::method_codePointAt(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
349{-
350 ExecutionEngine *v4 = f->engine();-
351 QString value = getThisString(v4, thisObject);-
352 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 192 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-192
353 return QV4::Encode::undefined();
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
354-
355 int index = argc ? argv[0].toInteger() : 0;
argcDescription
TRUEevaluated 192 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-192
356 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 184 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-184
357 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
358-
359 if (index < 0 || index >= value.size())
index < 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_ecmascripttests
index >= value.size()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 164 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-172
360 return Encode::undefined();
executed 20 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
20
361-
362 uint first = value.at(index).unicode();-
363 if (QChar::isHighSurrogate(first) && index + 1 < value.size()) {
QChar::isHighSurrogate(first)Description
TRUEevaluated 124 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
index + 1 < value.size()Description
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-124
364 uint second = value.at(index + 1).unicode();-
365 if (QChar::isLowSurrogate(second))
QChar::isLowSurrogate(second)Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-64
366 return Encode(QChar::surrogateToUcs4(first, second));
executed 64 times by 1 test: return Encode(QChar::surrogateToUcs4(first, second));
Executed by:
  • tst_ecmascripttests
64
367 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
48
368 return Encode(first);
executed 100 times by 1 test: return Encode(first);
Executed by:
  • tst_ecmascripttests
100
369}-
370-
371ReturnedValue StringPrototype::method_concat(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
372{-
373 ExecutionEngine *v4 = b->engine();-
374 QString value = getThisString(v4, thisObject);-
375 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-52
376 return QV4::Encode::undefined();
executed 12 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
377-
378 Scope scope(v4);-
379 ScopedString s(scope);-
380 for (int i = 0; i < argc; ++i) {
i < argcDescription
TRUEevaluated 584 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
52-584
381 s = argv[i].toString(scope.engine);-
382 if (v4->hasException)
v4->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 584 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-584
383 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
384-
385 Q_ASSERT(s->isString());-
386 value += s->toQString();-
387 }
executed 584 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
584
388-
389 return Encode(v4->newString(value));
executed 52 times by 1 test: return Encode(v4->newString(value));
Executed by:
  • tst_ecmascripttests
52
390}-
391-
392ReturnedValue StringPrototype::method_endsWith(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
393{-
394 ExecutionEngine *v4 = b->engine();-
395 const QString value = getThisString(v4, thisObject);-
396 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-160
397 return QV4::Encode::undefined();
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
398-
399 if (argc && argv[0].as<RegExpObject>())
argcDescription
TRUEevaluated 154 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
argv[0].as<RegExpObject>()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 149 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-154
400 return v4->throwTypeError();
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
401 QString searchString = (argc ? argv[0] : Primitive::undefinedValue()).toQString();
argcDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-144
402 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-142
403 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
404-
405 int pos = value.length();-
406 if (argc > 1)
argc > 1Description
TRUEevaluated 99 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 43 times by 1 test
Evaluated by:
  • tst_ecmascripttests
43-99
407 pos = (int) argv[1].toInteger();
executed 99 times by 1 test: pos = (int) argv[1].toInteger();
Executed by:
  • tst_ecmascripttests
99
408-
409 if (pos == value.length())
pos == value.length()Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
64-80
410 RETURN_RESULT(Encode(value.endsWith(searchString)));
executed 63 times by 1 test: return QV4::Encode(Encode(value.endsWith(searchString)));
Executed by:
  • tst_ecmascripttests
63
411-
412 QStringRef stringToSearch = value.leftRef(pos);-
413 return Encode(stringToSearch.endsWith(searchString));
executed 80 times by 1 test: return Encode(stringToSearch.endsWith(searchString));
Executed by:
  • tst_ecmascripttests
80
414}-
415-
416ReturnedValue StringPrototype::method_indexOf(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
417{-
418 ExecutionEngine *v4 = b->engine();-
419 const QString value = getThisString(v4, thisObject);-
420 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 15013 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
8-15013
421 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
422-
423 QString searchString = (argc ? argv[0] : Primitive::undefinedValue()).toQString();
argcDescription
TRUEevaluated 15008 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-15008
424 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 14985 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
28-14985
425 return Encode::undefined();
executed 28 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
28
426-
427 int pos = 0;-
428 if (argc > 1)
argc > 1Description
TRUEevaluated 2472 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12511 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
2472-12511
429 pos = (int) argv[1].toInteger();
executed 2472 times by 1 test: pos = (int) argv[1].toInteger();
Executed by:
  • tst_ecmascripttests
2472
430-
431 int index = -1;-
432 if (! value.isEmpty())
! value.isEmpty()Description
TRUEevaluated 14953 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-14953
433 index = value.indexOf(searchString, qMin(qMax(pos, 0), value.length()));
executed 14944 times by 7 tests: index = value.indexOf(searchString, qMin(qMax(pos, 0), value.length()));
Executed by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
14944
434-
435 return Encode(index);
executed 14977 times by 7 tests: return Encode(index);
Executed by:
  • tst_ecmascripttests
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
14977
436}-
437-
438ReturnedValue StringPrototype::method_includes(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
439{-
440 ExecutionEngine *v4 = b->engine();-
441 const QString value = getThisString(v4, thisObject);-
442 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
15-160
443 return QV4::Encode::undefined();
executed 15 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
15
444-
445 if (argc && argv[0].as<RegExpObject>())
argcDescription
TRUEevaluated 159 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
argv[0].as<RegExpObject>()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-159
446 return v4->throwTypeError();
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
447 QString searchString = (argc ? argv[0] : Primitive::undefinedValue()).toQString();
argcDescription
TRUEevaluated 151 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-151
448 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-144
449 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
450-
451 int pos = 0;-
452 if (argc > 1) {
argc > 1Description
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-112
453 const Value &posArg = argv[1];-
454 pos = (int) posArg.toInteger();-
455 if (!posArg.isInteger() && posArg.isNumber() && qIsInf(posArg.toNumber()))
!posArg.isInteger()Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
posArg.isNumber()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
qIsInf(posArg.toNumber())Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-56
456 pos = value.length();
executed 8 times by 1 test: pos = value.length();
Executed by:
  • tst_ecmascripttests
8
457 }
executed 112 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
112
458-
459 if (pos == 0)
pos == 0Description
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
64-80
460 RETURN_RESULT(Encode(value.contains(searchString)));
executed 80 times by 1 test: return QV4::Encode(Encode(value.contains(searchString)));
Executed by:
  • tst_ecmascripttests
80
461-
462 QStringRef stringToSearch = value.midRef(pos);-
463 return Encode(stringToSearch.contains(searchString));
executed 64 times by 1 test: return Encode(stringToSearch.contains(searchString));
Executed by:
  • tst_ecmascripttests
64
464}-
465-
466ReturnedValue StringPrototype::method_lastIndexOf(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
467{-
468 ExecutionEngine *v4 = b->engine();-
469 const QString value = getThisString(v4, thisObject);-
470 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 238 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
8-238
471 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
472-
473 QString searchString = (argc ? argv[0] : Primitive::undefinedValue()).toQString();
argcDescription
TRUEevaluated 234 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-234
474 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 230 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
8-230
475 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
476-
477 double position = argc > 1 ? RuntimeHelpers::toNumber(argv[1]) : +qInf();
argc > 1Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 206 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
24-206
478 if (std::isnan(position))
std::isnan(position)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 222 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
8-222
479 position = +qInf();
executed 8 times by 1 test: position = +qInf();
Executed by:
  • tst_ecmascripttests
8
480 else-
481 position = trunc(position);
executed 222 times by 4 tests: position = trunc(position);
Executed by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
222
482-
483 int pos = trunc(qMin(qMax(position, 0.0), double(value.length())));-
484 if (!searchString.isEmpty() && pos == value.length())
!searchString.isEmpty()Description
TRUEevaluated 230 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
FALSEnever evaluated
pos == value.length()Description
TRUEevaluated 214 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-230
485 --pos;
executed 214 times by 4 tests: --pos;
Executed by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
214
486 if (searchString.isNull() && pos == 0)
searchString.isNull()Description
TRUEnever evaluated
FALSEevaluated 230 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
pos == 0Description
TRUEnever evaluated
FALSEnever evaluated
0-230
487 RETURN_RESULT(Encode(-1));
never executed: return QV4::Encode(Encode(-1));
0
488 int index = value.lastIndexOf(searchString, pos);-
489 return Encode(index);
executed 229 times by 4 tests: return Encode(index);
Executed by:
  • tst_ecmascripttests
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
229
490}-
491-
492ReturnedValue StringPrototype::method_localeCompare(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
493{-
494 ExecutionEngine *v4 = b->engine();-
495 const QString value = getThisString(v4, thisObject);-
496 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 252 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-252
497 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
498-
499 const QString that = (argc ? argv[0] : Primitive::undefinedValue()).toQString();
argcDescription
TRUEevaluated 220 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-220
500 return Encode(QString::localeAwareCompare(value, that));
executed 252 times by 1 test: return Encode(QString::localeAwareCompare(value, that));
Executed by:
  • tst_ecmascripttests
252
501}-
502-
503ReturnedValue StringPrototype::method_match(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
504{-
505 ExecutionEngine *v4 = b->engine();-
506 if (thisObject->isNullOrUndefined())
thisObject->is...lOrUndefined()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 415 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
8-415
507 return v4->throwTypeError();
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
508-
509 Scope scope(v4);-
510 ScopedString s(scope, thisObject->toString(v4));-
511 if (v4->hasException)
v4->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 414 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
0-414
512 return Encode::undefined();
never executed: return Encode::undefined();
0
513-
514 Scoped<RegExpObject> that(scope, argc ? argv[0] : Primitive::undefinedValue());-
515 if (!that) {
!thatDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 330 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
84-330
516 // convert args[0] to a regexp-
517 that = RegExpCtor::virtualCallAsConstructor(b, argv, argc, b);-
518 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-76
519 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
520 }
executed 76 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
76
521 Q_ASSERT(!!that);-
522-
523 bool global = that->global();-
524-
525 if (!global)
!globalDescription
TRUEevaluated 264 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_ecmascripttests
142-264
526 return RegExpPrototype::method_exec(b, that, s, 1);
executed 264 times by 2 tests: return RegExpPrototype::method_exec(b, that, s, 1);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
264
527-
528 // rx is now in thisObject-
529 that->setLastIndex(0);-
530 ScopedArrayObject a(scope, scope.engine->newArrayObject());-
531-
532 int previousLastIndex = 0;-
533 uint n = 0;-
534 while (1) {-
535 Value result = Primitive::fromReturnedValue(RegExpPrototype::execFirstMatch(b, that, s, 1));-
536 if (result.isNull())
result.isNull()Description
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 680 times by 1 test
Evaluated by:
  • tst_ecmascripttests
144-680
537 break;
executed 144 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
144
538 int index = that->lastIndex();-
539 if (previousLastIndex == index) {
previousLastIndex == indexDescription
TRUEnever evaluated
FALSEevaluated 678 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-678
540 previousLastIndex = index + 1;-
541 that->setLastIndex(previousLastIndex);-
542 } else {
never executed: end of block
0
543 previousLastIndex = index;-
544 }
executed 678 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
678
545 a->arraySet(n, result);-
546 ++n;-
547 }
executed 678 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
678
548 if (!n)
!nDescription
TRUEnever evaluated
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-144
549 return Encode::null();
never executed: return Encode::null();
0
550 else-
551 return a.asReturnedValue();
executed 144 times by 1 test: return a.asReturnedValue();
Executed by:
  • tst_ecmascripttests
144
552}-
553-
554ReturnedValue StringPrototype::method_normalize(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
555{-
556 ExecutionEngine *v4 = f->engine();-
557 const QString value = getThisString(v4, thisObject);-
558 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-76
559 return Encode::undefined();
executed 16 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
560-
561 QString::NormalizationForm form = QString::NormalizationForm_C;-
562 if (argc >= 1 && !argv[0].isUndefined()) {
argc >= 1Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!argv[0].isUndefined()Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-72
563 QString f = argv[0].toQString();-
564 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-60
565 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
566 if (f == QLatin1String("NFC"))
f == QLatin1String("NFC")Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-44
567 form = QString::NormalizationForm_C;
executed 16 times by 1 test: form = QString::NormalizationForm_C;
Executed by:
  • tst_ecmascripttests
16
568 else if (f == QLatin1String("NFD"))
f == QLatin1String("NFD")Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-28
569 form = QString::NormalizationForm_D;
executed 16 times by 1 test: form = QString::NormalizationForm_D;
Executed by:
  • tst_ecmascripttests
16
570 else if (f == QLatin1String("NFKC"))
f == QLatin1String("NFKC")Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-20
571 form = QString::NormalizationForm_KC;
executed 8 times by 1 test: form = QString::NormalizationForm_KC;
Executed by:
  • tst_ecmascripttests
8
572 else if (f == QLatin1String("NFKD"))
f == QLatin1String("NFKD")Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-12
573 form = QString::NormalizationForm_KD;
executed 8 times by 1 test: form = QString::NormalizationForm_KD;
Executed by:
  • tst_ecmascripttests
8
574 else-
575 return v4->throwRangeError(QLatin1String("String.prototype.normalize: Invalid normalization form."));
executed 12 times by 1 test: return v4->throwRangeError(QLatin1String("String.prototype.normalize: Invalid normalization form."));
Executed by:
  • tst_ecmascripttests
12
576 }-
577 QString normalized = value.normalized(form);-
578 return v4->newString(normalized)->asReturnedValue();
executed 56 times by 1 test: return v4->newString(normalized)->asReturnedValue();
Executed by:
  • tst_ecmascripttests
56
579}-
580-
581ReturnedValue StringPrototype::method_padEnd(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
582{-
583 ExecutionEngine *v4 = f->engine();-
584 if (thisObject->isNullOrUndefined())
thisObject->is...lOrUndefined()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-96
585 return v4->throwTypeError();
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
586-
587 Scope scope(v4);-
588 ScopedString s(scope, thisAsString(v4, thisObject));-
589 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-88
590 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
591 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-88
592 return s->asReturnedValue();
never executed: return s->asReturnedValue();
0
593-
594 int maxLen = argv[0].toInteger();-
595 if (maxLen <= s->d()->length())
maxLen <= s->d()->length()Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-56
596 return s->asReturnedValue();
executed 32 times by 1 test: return s->asReturnedValue();
Executed by:
  • tst_ecmascripttests
32
597 QString fillString = (argc > 1 && !argv[1].isUndefined()) ? argv[1].toQString() : QString::fromLatin1(" ");
argc > 1Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!argv[1].isUndefined()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-52
598 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-52
599 return Encode::undefined();
executed 4 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
4
600-
601 if (fillString.isEmpty())
fillString.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-48
602 return s->asReturnedValue();
executed 4 times by 1 test: return s->asReturnedValue();
Executed by:
  • tst_ecmascripttests
4
603-
604 QString padded = s->toQString();-
605 int oldLength = padded.length();-
606 int toFill = maxLen - oldLength;-
607 padded.resize(maxLen);-
608 QChar *ch = padded.data() + oldLength;-
609 while (toFill) {
toFillDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-144
610 int copy = qMin(fillString.length(), toFill);-
611 memcpy(ch, fillString.constData(), copy*sizeof(QChar));-
612 toFill -= copy;-
613 ch += copy;-
614 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
144
615 *ch = 0;-
616-
617 return v4->newString(padded)->asReturnedValue();
executed 48 times by 1 test: return v4->newString(padded)->asReturnedValue();
Executed by:
  • tst_ecmascripttests
48
618}-
619-
620ReturnedValue StringPrototype::method_padStart(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
621{-
622 ExecutionEngine *v4 = f->engine();-
623 if (thisObject->isNullOrUndefined())
thisObject->is...lOrUndefined()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 95 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-95
624 return v4->throwTypeError();
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
625-
626 Scope scope(v4);-
627 ScopedString s(scope, thisAsString(v4, thisObject));-
628 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-88
629 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
630 if (!argc)
!argcDescription
TRUEnever evaluated
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-88
631 return s->asReturnedValue();
never executed: return s->asReturnedValue();
0
632-
633 int maxLen = argv[0].toInteger();-
634 if (maxLen <= s->d()->length())
maxLen <= s->d()->length()Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-56
635 return s->asReturnedValue();
executed 32 times by 1 test: return s->asReturnedValue();
Executed by:
  • tst_ecmascripttests
32
636 QString fillString = (argc > 1 && !argv[1].isUndefined()) ? argv[1].toQString() : QString::fromLatin1(" ");
argc > 1Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!argv[1].isUndefined()Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-52
637 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-52
638 return Encode::undefined();
executed 4 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
4
639-
640 if (fillString.isEmpty())
fillString.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-48
641 return s->asReturnedValue();
executed 4 times by 1 test: return s->asReturnedValue();
Executed by:
  • tst_ecmascripttests
4
642-
643 QString original = s->toQString();-
644 int oldLength = original.length();-
645 int toFill = maxLen - oldLength;-
646 QString padded;-
647 padded.resize(maxLen);-
648 QChar *ch = padded.data();-
649 while (toFill) {
toFillDescription
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-144
650 int copy = qMin(fillString.length(), toFill);-
651 memcpy(ch, fillString.constData(), copy*sizeof(QChar));-
652 toFill -= copy;-
653 ch += copy;-
654 }
executed 144 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
144
655 memcpy(ch, original.constData(), oldLength*sizeof(QChar));-
656 ch += oldLength;-
657 *ch = 0;-
658-
659 return v4->newString(padded)->asReturnedValue();
executed 48 times by 1 test: return v4->newString(padded)->asReturnedValue();
Executed by:
  • tst_ecmascripttests
48
660}-
661-
662-
663ReturnedValue StringPrototype::method_repeat(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
664{-
665 ExecutionEngine *v4 = b->engine();-
666 const QString value = getThisString(v4, thisObject);-
667 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-72
668 return QV4::Encode::undefined();
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
669-
670 double repeats = (argc ? argv[0] : Primitive::undefinedValue()).toInteger();
argcDescription
TRUEevaluated 71 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-71
671-
672 if (repeats < 0 || qIsInf(repeats))
repeats < 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_ecmascripttests
qIsInf(repeats)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
4-64
673 return v4->throwRangeError(QLatin1String("Invalid count value"));
executed 12 times by 1 test: return v4->throwRangeError(QLatin1String("Invalid count value"));
Executed by:
  • tst_ecmascripttests
12
674-
675 return Encode(v4->newString(value.repeated(int(repeats))));
executed 60 times by 1 test: return Encode(v4->newString(value.repeated(int(repeats))));
Executed by:
  • tst_ecmascripttests
60
676}-
677-
678static void appendReplacementString(QString *result, const QString &input, const QString& replaceValue, uint* matchOffsets, int captureCount)-
679{-
680 result->reserve(result->length() + replaceValue.length());-
681 for (int i = 0; i < replaceValue.length(); ++i) {
i < replaceValue.length()Description
TRUEevaluated 603 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 780 times by 1 test
Evaluated by:
  • tst_ecmascripttests
603-780
682 if (replaceValue.at(i) == QLatin1Char('$') && i < replaceValue.length() - 1) {
replaceValue.a...atin1Char('$')Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 532 times by 1 test
Evaluated by:
  • tst_ecmascripttests
i < replaceValue.length() - 1Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-532
683 ushort ch = replaceValue.at(++i).unicode();-
684 uint substStart = JSC::Yarr::offsetNoMatch;-
685 uint substEnd = JSC::Yarr::offsetNoMatch;-
686 if (ch == '$') {
ch == '$'Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-60
687 *result += QChar(ch);-
688 continue;
executed 12 times by 1 test: continue;
Executed by:
  • tst_ecmascripttests
12
689 } else if (ch == '&') {
ch == '&'Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-48
690 substStart = matchOffsets[0];-
691 substEnd = matchOffsets[1];-
692 } else if (ch == '`') {
executed 12 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
ch == '`'Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-36
693 substStart = 0;-
694 substEnd = matchOffsets[0];-
695 } else if (ch == '\'') {
executed 12 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
ch == '\''Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-24
696 substStart = matchOffsets[1];-
697 substEnd = input.length();-
698 } else if (ch >= '1' && ch <= '9') {
executed 12 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
ch >= '1'Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
ch <= '9'Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-24
699 uint capture = ch - '0';-
700 Q_ASSERT(capture > 0);-
701 if (capture < static_cast<uint>(captureCount)) {
capture < stat...(captureCount)Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-24
702 substStart = matchOffsets[capture * 2];-
703 substEnd = matchOffsets[capture * 2 + 1];-
704 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
24
705 } else if (ch == '0' && i < replaceValue.length() - 1) {
executed 24 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
ch == '0'Description
TRUEnever evaluated
FALSEnever evaluated
i < replaceValue.length() - 1Description
TRUEnever evaluated
FALSEnever evaluated
0-24
706 int capture = (ch - '0') * 10;-
707 ch = replaceValue.at(++i).unicode();-
708 if (ch >= '0' && ch <= '9') {
ch >= '0'Description
TRUEnever evaluated
FALSEnever evaluated
ch <= '9'Description
TRUEnever evaluated
FALSEnever evaluated
0
709 capture += ch - '0';-
710 if (capture > 0 && capture < captureCount) {
capture > 0Description
TRUEnever evaluated
FALSEnever evaluated
capture < captureCountDescription
TRUEnever evaluated
FALSEnever evaluated
0
711 substStart = matchOffsets[capture * 2];-
712 substEnd = matchOffsets[capture * 2 + 1];-
713 }
never executed: end of block
0
714 }
never executed: end of block
0
715 }
never executed: end of block
0
716 if (substStart != JSC::Yarr::offsetNoMatch && substEnd != JSC::Yarr::offsetNoMatch)
substStart != ...:offsetNoMatchDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
substEnd != JS...:offsetNoMatchDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-60
717 *result += input.midRef(substStart, substEnd - substStart);
executed 60 times by 1 test: *result += input.midRef(substStart, substEnd - substStart);
Executed by:
  • tst_ecmascripttests
60
718 } else {
executed 59 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
59
719 *result += replaceValue.at(i);-
720 }
executed 532 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
532
721 }-
722}
executed 780 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
780
723-
724ReturnedValue StringPrototype::method_replace(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
725{-
726 QString string;-
727 if (const StringObject *thisString = thisObject->as<StringObject>())
const StringOb...tringObject>()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2267 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
12-2267
728 string = thisString->d()->string->toQString();
executed 12 times by 1 test: string = thisString->d()->string->toQString();
Executed by:
  • tst_ecmascripttests
12
729 else-
730 string = thisObject->toQString();
executed 2267 times by 3 tests: string = thisObject->toQString();
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
2267
731-
732 int numCaptures = 0;-
733 int numStringMatches = 0;-
734-
735 uint allocatedMatchOffsets = 64;-
736 uint _matchOffsets[64];-
737 uint *matchOffsets = _matchOffsets;-
738-
739 Scope scope(b);-
740 ScopedValue searchValue(scope, argc ? argv[0] : Primitive::undefinedValue());-
741 Scoped<RegExpObject> regExp(scope, searchValue);-
742 if (regExp) {
regExpDescription
TRUEevaluated 2199 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
80-2199
743 uint offset = 0;-
744 uint nMatchOffsets = 0;-
745-
746 // We extract the pointer here to work around a compiler bug on Android.-
747 Scoped<RegExp> re(scope, regExp->value());-
748 while (true) {-
749 int oldSize = nMatchOffsets;-
750 if (allocatedMatchOffsets < nMatchOffsets + re->captureCount() * 2) {
allocatedMatch...ureCount() * 2Description
TRUEnever evaluated
FALSEevaluated 2937 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
0-2937
751 allocatedMatchOffsets = qMax(allocatedMatchOffsets * 2, nMatchOffsets + re->captureCount() * 2);-
752 uint *newOffsets = (uint *)malloc(allocatedMatchOffsets*sizeof(uint));-
753 memcpy(newOffsets, matchOffsets, nMatchOffsets*sizeof(uint));-
754 if (matchOffsets != _matchOffsets)
matchOffsets != _matchOffsetsDescription
TRUEnever evaluated
FALSEnever evaluated
0
755 free(matchOffsets);
never executed: free(matchOffsets);
0
756 matchOffsets = newOffsets;-
757 }
never executed: end of block
0
758 if (re->match(string, offset, matchOffsets + oldSize) == JSC::Yarr::offsetNoMatch) {
re->match(stri...:offsetNoMatchDescription
TRUEevaluated 2144 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
FALSEevaluated 794 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
794-2144
759 nMatchOffsets = oldSize;-
760 break;
executed 2144 times by 3 tests: break;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
2144
761 }-
762 nMatchOffsets += re->captureCount() * 2;-
763 if (!regExp->global())
!regExp->global()Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 738 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
56-738
764 break;
executed 56 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
56
765 offset = qMax(offset + 1, matchOffsets[oldSize + 1]);-
766 }
executed 738 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
738
767 if (regExp->global())
regExp->global()Description
TRUEevaluated 2144 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
FALSEevaluated 55 times by 1 test
Evaluated by:
  • tst_ecmascripttests
55-2144
768 regExp->setLastIndex(0);
executed 2144 times by 3 tests: regExp->setLastIndex(0);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
2144
769 numStringMatches = nMatchOffsets / (regExp->value()->captureCount() * 2);-
770 numCaptures = regExp->value()->captureCount();-
771 } else {
executed 2200 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
2200
772 numCaptures = 1;-
773 QString searchString = searchValue->toQString();-
774 int idx = string.indexOf(searchString);-
775 if (idx != -1) {
idx != -1Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-60
776 numStringMatches = 1;-
777 matchOffsets[0] = idx;-
778 matchOffsets[1] = idx + searchString.length();-
779 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
60
780 }
executed 80 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
80
781-
782 QString result;-
783 ScopedValue replacement(scope);-
784 ScopedValue replaceValue(scope, argc > 1 ? argv[1] : Primitive::undefinedValue());-
785 ScopedFunctionObject searchCallback(scope, replaceValue);-
786 if (!!searchCallback) {
!!searchCallbackDescription
TRUEevaluated 64 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 2216 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
64-2216
787 result.reserve(string.length() + 10*numStringMatches);-
788 ScopedValue entry(scope);-
789 Value *arguments = scope.alloc(numCaptures + 2);-
790 int lastEnd = 0;-
791 for (int i = 0; i < numStringMatches; ++i) {
i < numStringMatchesDescription
TRUEevaluated 74 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 64 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
64-74
792 for (int k = 0; k < numCaptures; ++k) {
k < numCapturesDescription
TRUEevaluated 128 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 74 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
74-128
793 int idx = (i * numCaptures + k) * 2;-
794 uint start = matchOffsets[idx];-
795 uint end = matchOffsets[idx + 1];-
796 entry = Primitive::undefinedValue();-
797 if (start != JSC::Yarr::offsetNoMatch && end != JSC::Yarr::offsetNoMatch)
start != JSC::...:offsetNoMatchDescription
TRUEevaluated 128 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEnever evaluated
end != JSC::Ya...:offsetNoMatchDescription
TRUEevaluated 128 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEnever evaluated
0-128
798 entry = scope.engine->newString(string.mid(start, end - start));
executed 128 times by 2 tests: entry = scope.engine->newString(string.mid(start, end - start));
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
128
799 arguments[k] = entry;-
800 }
executed 128 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
128
801 uint matchStart = matchOffsets[i * numCaptures * 2];-
802 Q_ASSERT(matchStart >= static_cast<uint>(lastEnd));-
803 uint matchEnd = matchOffsets[i * numCaptures * 2 + 1];-
804 arguments[numCaptures] = Primitive::fromUInt32(matchStart);-
805 arguments[numCaptures + 1] = scope.engine->newString(string);-
806-
807 Value that = Primitive::undefinedValue();-
808 replacement = searchCallback->call(&that, arguments, numCaptures + 2);-
809 result += string.midRef(lastEnd, matchStart - lastEnd);-
810 result += replacement->toQString();-
811 lastEnd = matchEnd;-
812 }
executed 74 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
74
813 result += string.midRef(lastEnd);-
814 } else {
executed 64 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
64
815 QString newString = replaceValue->toQString();-
816 result.reserve(string.length() + numStringMatches*newString.size());-
817-
818 int lastEnd = 0;-
819 for (int i = 0; i < numStringMatches; ++i) {
i < numStringMatchesDescription
TRUEevaluated 780 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2216 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
780-2216
820 int baseIndex = i * numCaptures * 2;-
821 uint matchStart = matchOffsets[baseIndex];-
822 uint matchEnd = matchOffsets[baseIndex + 1];-
823 if (matchStart == JSC::Yarr::offsetNoMatch)
matchStart == ...:offsetNoMatchDescription
TRUEnever evaluated
FALSEevaluated 780 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-780
824 continue;
never executed: continue;
0
825-
826 result += string.midRef(lastEnd, matchStart - lastEnd);-
827 appendReplacementString(&result, string, newString, matchOffsets + baseIndex, numCaptures);-
828 lastEnd = matchEnd;-
829 }
executed 780 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
780
830 result += string.midRef(lastEnd);-
831 }
executed 2216 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlxmlhttprequest
2216
832-
833 if (matchOffsets != _matchOffsets)
matchOffsets != _matchOffsetsDescription
TRUEnever evaluated
FALSEevaluated 2280 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
0-2280
834 free(matchOffsets);
never executed: free(matchOffsets);
0
835-
836 return Encode(scope.engine->newString(result));
executed 2280 times by 3 tests: return Encode(scope.engine->newString(result));
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlxmlhttprequest
2280
837}-
838-
839ReturnedValue StringPrototype::method_search(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
840{-
841 Scope scope(b);-
842 QString string = getThisString(scope.engine, thisObject);-
843 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-112
844 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
845-
846 Scoped<RegExpObject> regExp(scope, argc ? argv[0] : Primitive::undefinedValue());-
847 if (!regExp) {
!regExpDescription
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-80
848 regExp = scope.engine->regExpCtor()->callAsConstructor(argv, 1);-
849 if (scope.engine->hasException)
scope.engine->hasExceptionDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
7-72
850 return QV4::Encode::undefined();
executed 7 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
7
851-
852 Q_ASSERT(regExp);-
853 }
executed 72 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
72
854 Scoped<RegExp> re(scope, regExp->value());-
855 Q_ALLOCA_VAR(uint, matchOffsets, regExp->value()->captureCount() * 2 * sizeof(uint));-
856 uint result = re->match(string, /*offset*/0, matchOffsets);-
857 if (result == JSC::Yarr::offsetNoMatch)
result == JSC:...:offsetNoMatchDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-88
858 return Encode(-1);
executed 16 times by 1 test: return Encode(-1);
Executed by:
  • tst_ecmascripttests
16
859 else-
860 return Encode(result);
executed 88 times by 1 test: return Encode(result);
Executed by:
  • tst_ecmascripttests
88
861}-
862-
863ReturnedValue StringPrototype::method_slice(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
864{-
865 ExecutionEngine *v4 = b->engine();-
866 Scope scope(v4);-
867 ScopedString s(scope, thisAsString(v4, thisObject));-
868 if (v4->hasException)
v4->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 280 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-280
869 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
870 Q_ASSERT(s);-
871-
872 const double length = s->d()->length();-
873-
874 double start = argc ? argv[0].toInteger() : 0;
argcDescription
TRUEevaluated 272 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-272
875 double end = (argc < 2 || argv[1].isUndefined())
argc < 2Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 264 times by 1 test
Evaluated by:
  • tst_ecmascripttests
argv[1].isUndefined()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 252 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-264
876 ? length : argv[1].toInteger();-
877-
878 if (start < 0)
start < 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 268 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-268
879 start = qMax(length + start, 0.);
executed 12 times by 1 test: start = qMax(length + start, 0.);
Executed by:
  • tst_ecmascripttests
12
880 else-
881 start = qMin(start, length);
executed 268 times by 1 test: start = qMin(start, length);
Executed by:
  • tst_ecmascripttests
268
882-
883 if (end < 0)
end < 0Description
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 116 times by 1 test
Evaluated by:
  • tst_ecmascripttests
116-164
884 end = qMax(length + end, 0.);
executed 164 times by 1 test: end = qMax(length + end, 0.);
Executed by:
  • tst_ecmascripttests
164
885 else-
886 end = qMin(end, length);
executed 116 times by 1 test: end = qMin(end, length);
Executed by:
  • tst_ecmascripttests
116
887-
888 const int intStart = int(start);-
889 const int intEnd = int(end);-
890-
891 int count = qMax(0, intEnd - intStart);-
892 return Encode(v4->memoryManager->alloc<ComplexString>(s->d(), intStart, count));
executed 280 times by 1 test: return Encode(v4->memoryManager->alloc<ComplexString>(s->d(), intStart, count));
Executed by:
  • tst_ecmascripttests
280
893}-
894-
895ReturnedValue StringPrototype::method_split(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
896{-
897 ExecutionEngine *v4 = b->engine();-
898 QString text = getThisString(v4, thisObject);-
899 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 486 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
8-486
900 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
901-
902 Scope scope(v4);-
903 ScopedValue separatorValue(scope, argc ? argv[0] : Primitive::undefinedValue());-
904 ScopedValue limitValue(scope, argc > 1 ? argv[1] : Primitive::undefinedValue());-
905-
906 ScopedArrayObject array(scope, scope.engine->newArrayObject());-
907-
908 if (separatorValue->isUndefined()) {
separatorValue->isUndefined()Description
TRUEevaluated 71 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 420 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
71-420
909 if (limitValue->isUndefined()) {
limitValue->isUndefined()Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-72
910 ScopedString s(scope, scope.engine->newString(text));-
911 array->push_back(s);-
912 return array.asReturnedValue();
executed 70 times by 1 test: return array.asReturnedValue();
Executed by:
  • tst_ecmascripttests
70
913 }-
914 RETURN_RESULT(scope.engine->newString(text.left(limitValue->toInteger())));
never executed: return QV4::Encode(scope.engine->newString(text.left(limitValue->toInteger())));
0
915 }-
916-
917 uint limit = limitValue->isUndefined() ? UINT_MAX : limitValue->toUInt32();
limitValue->isUndefined()Description
TRUEevaluated 268 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
FALSEevaluated 152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
152-268
918-
919 if (limit == 0)
limit == 0Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 358 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
60-358
920 return array.asReturnedValue();
executed 60 times by 1 test: return array.asReturnedValue();
Executed by:
  • tst_ecmascripttests
60
921-
922 Scoped<RegExpObject> re(scope, separatorValue);-
923 if (re) {
reDescription
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 256 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
104-256
924 if (re->value()->pattern->isEmpty()) {
re->value()->p...ern->isEmpty()Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
31-72
925 re = (RegExpObject *)nullptr;-
926 separatorValue = scope.engine->newString();-
927 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
32
928 }
executed 104 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
104
929-
930 ScopedString s(scope);-
931 if (re) {
reDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 286 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
72-286
932 uint offset = 0;-
933 Q_ALLOCA_VAR(uint, matchOffsets, re->value()->captureCount() * 2 * sizeof(uint));-
934 while (true) {-
935 Scoped<RegExp> regexp(scope, re->value());-
936 uint result = regexp->match(text, offset, matchOffsets);-
937 if (result == JSC::Yarr::offsetNoMatch)
result == JSC:...:offsetNoMatchDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
52-160
938 break;
executed 52 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
52
939-
940 array->push_back((s = scope.engine->newString(text.mid(offset, matchOffsets[0] - offset))));-
941 offset = qMax(offset + 1, matchOffsets[1]);-
942-
943 if (array->getLength() >= limit)
array->getLength() >= limitDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 140 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-140
944 break;
executed 20 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
20
945-
946 for (int i = 1; i < re->value()->captureCount(); ++i) {
i < re->value(...captureCount()Description
TRUEnever evaluated
FALSEevaluated 140 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-140
947 uint start = matchOffsets[i * 2];-
948 uint end = matchOffsets[i * 2 + 1];-
949 array->push_back((s = scope.engine->newString(text.mid(start, end - start))));-
950 if (array->getLength() >= limit)
array->getLength() >= limitDescription
TRUEnever evaluated
FALSEnever evaluated
0
951 break;
never executed: break;
0
952 }
never executed: end of block
0
953 }
executed 140 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
140
954 if (array->getLength() < limit)
array->getLength() < limitDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-52
955 array->push_back((s = scope.engine->newString(text.mid(offset))));
executed 52 times by 1 test: array->push_back((s = scope.engine->newString(text.mid(offset))));
Executed by:
  • tst_ecmascripttests
52
956 } else {
executed 72 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
72
957 QString separator = separatorValue->toQString();-
958 if (separator.isEmpty()) {
separator.isEmpty()Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 240 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
47-240
959 for (uint i = 0; i < qMin(limit, uint(text.length())); ++i)
i < qMin(limit...ext.length()))Description
TRUEevaluated 307 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_ecmascripttests
48-307
960 array->push_back((s = scope.engine->newString(text.mid(i, 1))));
executed 307 times by 1 test: array->push_back((s = scope.engine->newString(text.mid(i, 1))));
Executed by:
  • tst_ecmascripttests
307
961 return array.asReturnedValue();
executed 48 times by 1 test: return array.asReturnedValue();
Executed by:
  • tst_ecmascripttests
48
962 }-
963-
964 int start = 0;-
965 int end;-
966 while ((end = text.indexOf(separator, start)) != -1) {
(end = text.in... start)) != -1Description
TRUEevaluated 368 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
FALSEevaluated 211 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
211-368
967 array->push_back((s = scope.engine->newString(text.mid(start, end - start))));-
968 start = end + separator.size();-
969 if (array->getLength() >= limit)
array->getLength() >= limitDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 340 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
28-340
970 break;
executed 28 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
28
971 }
executed 340 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
340
972 if (array->getLength() < limit && start != -1)
array->getLength() < limitDescription
TRUEevaluated 211 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
start != -1Description
TRUEevaluated 211 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
FALSEnever evaluated
0-211
973 array->push_back((s = scope.engine->newString(text.mid(start))));
executed 212 times by 3 tests: array->push_back((s = scope.engine->newString(text.mid(start))));
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
212
974 }
executed 240 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
240
975 return array.asReturnedValue();
executed 312 times by 3 tests: return array.asReturnedValue();
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
312
976}-
977-
978ReturnedValue StringPrototype::method_startsWith(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
979{-
980 ExecutionEngine *v4 = b->engine();-
981 const QString value = getThisString(v4, thisObject);-
982 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_ecmascripttests
16-148
983 return QV4::Encode::undefined();
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
16
984-
985 if (argc && argv[0].as<RegExpObject>())
argcDescription
TRUEevaluated 148 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
argv[0].as<RegExpObject>()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 140 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-148
986 return v4->throwTypeError();
executed 8 times by 1 test: return v4->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
987 QString searchString = (argc ? argv[0] : Primitive::undefinedValue()).toQString();
argcDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEnever evaluated
0-140
988 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 132 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-132
989 return Encode::undefined();
executed 8 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
990-
991 int pos = 0;-
992 if (argc > 1)
argc > 1Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
36-96
993 pos = (int) argv[1].toInteger();
executed 96 times by 1 test: pos = (int) argv[1].toInteger();
Executed by:
  • tst_ecmascripttests
96
994-
995 if (pos == 0)
pos == 0Description
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
56-76
996 return Encode(value.startsWith(searchString));
executed 76 times by 1 test: return Encode(value.startsWith(searchString));
Executed by:
  • tst_ecmascripttests
76
997-
998 QStringRef stringToSearch = value.midRef(pos);-
999 RETURN_RESULT(Encode(stringToSearch.startsWith(searchString)));
executed 56 times by 1 test: return QV4::Encode(Encode(stringToSearch.startsWith(searchString)));
Executed by:
  • tst_ecmascripttests
56
1000}-
1001-
1002ReturnedValue StringPrototype::method_substr(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
1003{-
1004 ExecutionEngine *v4 = b->engine();-
1005 const QString value = getThisString(v4, thisObject);-
1006 if (v4->hasException)
v4->hasExceptionDescription
TRUEnever evaluated
FALSEevaluated 40 times by 3 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_signalspy
0-40
1007 return QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
1008-
1009 double start = 0;-
1010 if (argc > 0)
argc > 0Description
TRUEevaluated 40 times by 3 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_signalspy
FALSEnever evaluated
0-40
1011 start = argv[0].toInteger();
executed 40 times by 3 tests: start = argv[0].toInteger();
Executed by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_signalspy
40
1012-
1013 double length = +qInf();-
1014 if (argc > 1)
argc > 1Description
TRUEevaluated 36 times by 3 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_signalspy
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_signalspy
4-36
1015 length = argv[1].toInteger();
executed 36 times by 3 tests: length = argv[1].toInteger();
Executed by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_signalspy
36
1016-
1017 double count = value.length();-
1018 if (start < 0)
start < 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 3 tests
Evaluated by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_signalspy
0-40
1019 start = qMax(count + start, 0.0);
never executed: start = qMax(count + start, 0.0);
0
1020-
1021 length = qMin(qMax(length, 0.0), count - start);-
1022-
1023 qint32 x = Primitive::toInt32(start);-
1024 qint32 y = Primitive::toInt32(length);-
1025 return Encode(v4->newString(value.mid(x, y)));
executed 40 times by 3 tests: return Encode(v4->newString(value.mid(x, y)));
Executed by:
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_signalspy
40
1026}-
1027-
1028ReturnedValue StringPrototype::method_substring(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
1029{-
1030 ExecutionEngine *v4 = b->engine();-
1031 const QString value = getThisString(v4, thisObject);-
1032 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 191 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-191
1033 return QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
8
1034-
1035 int length = value.length();-
1036-
1037 double start = 0;-
1038 double end = length;-
1039-
1040 if (argc > 0)
argc > 0Description
TRUEevaluated 184 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
8-184
1041 start = argv[0].toInteger();
executed 184 times by 1 test: start = argv[0].toInteger();
Executed by:
  • tst_ecmascripttests
184
1042-
1043 if (argc > 1 && !argv[1].isUndefined())
argc > 1Description
TRUEevaluated 179 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
!argv[1].isUndefined()Description
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-179
1044 end = argv[1].toInteger();
executed 164 times by 1 test: end = argv[1].toInteger();
Executed by:
  • tst_ecmascripttests
164
1045-
1046 if (std::isnan(start) || start < 0)
std::isnan(start)Description
TRUEnever evaluated
FALSEevaluated 192 times by 1 test
Evaluated by:
  • tst_ecmascripttests
start < 0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-192
1047 start = 0;
executed 20 times by 1 test: start = 0;
Executed by:
  • tst_ecmascripttests
20
1048-
1049 if (std::isnan(end) || end < 0)
std::isnan(end)Description
TRUEnever evaluated
FALSEevaluated 192 times by 1 test
Evaluated by:
  • tst_ecmascripttests
end < 0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 168 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-192
1050 end = 0;
executed 24 times by 1 test: end = 0;
Executed by:
  • tst_ecmascripttests
24
1051-
1052 if (start > length)
start > lengthDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 164 times by 1 test
Evaluated by:
  • tst_ecmascripttests
28-164
1053 start = length;
executed 28 times by 1 test: start = length;
Executed by:
  • tst_ecmascripttests
28
1054-
1055 if (end > length)
end > lengthDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_ecmascripttests
20-172
1056 end = length;
executed 20 times by 1 test: end = length;
Executed by:
  • tst_ecmascripttests
20
1057-
1058 if (start > end) {
start > endDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 156 times by 1 test
Evaluated by:
  • tst_ecmascripttests
36-156
1059 double was = start;-
1060 start = end;-
1061 end = was;-
1062 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
36
1063-
1064 qint32 x = (int)start;-
1065 qint32 y = (int)(end - start);-
1066 return Encode(v4->newString(value.mid(x, y)));
executed 191 times by 1 test: return Encode(v4->newString(value.mid(x, y)));
Executed by:
  • tst_ecmascripttests
191
1067}-
1068-
1069ReturnedValue StringPrototype::method_toLowerCase(const FunctionObject *b, const Value *thisObject, const Value *, int)-
1070{-
1071 ExecutionEngine *v4 = b->engine();-
1072 const QString value = getThisString(v4, thisObject);-
1073 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1292 times by 1 test
Evaluated by:
  • tst_ecmascripttests
32-1292
1074 return QV4::Encode::undefined();
executed 32 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
32
1075-
1076 return Encode(v4->newString(value.toLower()));
executed 1292 times by 1 test: return Encode(v4->newString(value.toLower()));
Executed by:
  • tst_ecmascripttests
1292
1077}-
1078-
1079ReturnedValue StringPrototype::method_toLocaleLowerCase(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
1080{-
1081 return method_toLowerCase(b, thisObject, argv, argc);
executed 658 times by 1 test: return method_toLowerCase(b, thisObject, argv, argc);
Executed by:
  • tst_ecmascripttests
658
1082}-
1083-
1084ReturnedValue StringPrototype::method_toUpperCase(const FunctionObject *b, const Value *thisObject, const Value *, int)-
1085{-
1086 ExecutionEngine *v4 = b->engine();-
1087 const QString value = getThisString(v4, thisObject);-
1088 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 557416 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_signalspy
32-557416
1089 return QV4::Encode::undefined();
executed 32 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
32
1090-
1091 return Encode(v4->newString(value.toUpper()));
executed 557416 times by 2 tests: return Encode(v4->newString(value.toUpper()));
Executed by:
  • tst_ecmascripttests
  • tst_signalspy
557416
1092}-
1093-
1094ReturnedValue StringPrototype::method_toLocaleUpperCase(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)-
1095{-
1096 return method_toUpperCase(b, thisObject, argv, argc);
executed 652 times by 1 test: return method_toUpperCase(b, thisObject, argv, argc);
Executed by:
  • tst_ecmascripttests
652
1097}-
1098-
1099ReturnedValue StringPrototype::method_trim(const FunctionObject *b, const Value *thisObject, const Value *, int)-
1100{-
1101 ExecutionEngine *v4 = b->engine();-
1102 QString s = getThisString(v4, thisObject);-
1103 if (v4->hasException)
v4->hasExceptionDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 500 times by 1 test
Evaluated by:
  • tst_ecmascripttests
11-500
1104 return QV4::Encode::undefined();
executed 11 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
11
1105-
1106 const QChar *chars = s.constData();-
1107 int start, end;-
1108 for (start = 0; start < s.length(); ++start) {
start < s.length()Description
TRUEevaluated 1163 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 63 times by 1 test
Evaluated by:
  • tst_ecmascripttests
63-1163
1109 if (!chars[start].isSpace() && chars[start].unicode() != 0xfeff)
!chars[start].isSpace()Description
TRUEevaluated 463 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 703 times by 1 test
Evaluated by:
  • tst_ecmascripttests
chars[start].u...de() != 0xfeffDescription
TRUEevaluated 436 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
28-703
1110 break;
executed 435 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
435
1111 }
executed 731 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
731
1112 for (end = s.length() - 1; end >= start; --end) {
end >= startDescription
TRUEevaluated 776 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 63 times by 1 test
Evaluated by:
  • tst_ecmascripttests
63-776
1113 if (!chars[end].isSpace() && chars[end].unicode() != 0xfeff)
!chars[end].isSpace()Description
TRUEevaluated 448 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 331 times by 1 test
Evaluated by:
  • tst_ecmascripttests
chars[end].unicode() != 0xfeffDescription
TRUEevaluated 436 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
12-448
1114 break;
executed 436 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
436
1115 }
executed 343 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
343
1116-
1117 return Encode(v4->newString(QString(chars + start, end - start + 1)));
executed 498 times by 1 test: return Encode(v4->newString(QString(chars + start, end - start + 1)));
Executed by:
  • tst_ecmascripttests
498
1118}-
1119-
1120-
1121-
1122ReturnedValue StringPrototype::method_iterator(const FunctionObject *b, const Value *thisObject, const Value *, int)-
1123{-
1124 Scope scope(b);-
1125 ScopedString s(scope, thisObject->toString(scope.engine));-
1126 if (!s || thisObject->isNullOrUndefined())
!sDescription
TRUEnever evaluated
FALSEevaluated 94 times by 1 test
Evaluated by:
  • tst_ecmascripttests
thisObject->is...lOrUndefined()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 86 times by 1 test
Evaluated by:
  • tst_ecmascripttests
0-94
1127 return scope.engine->throwTypeError();
executed 8 times by 1 test: return scope.engine->throwTypeError();
Executed by:
  • tst_ecmascripttests
8
1128-
1129 Scoped<StringIteratorObject> si(scope, scope.engine->memoryManager->allocate<StringIteratorObject>(s->d(), scope.engine));-
1130 return si->asReturnedValue();
executed 86 times by 1 test: return si->asReturnedValue();
Executed by:
  • tst_ecmascripttests
86
1131}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0