OpenCoverage

qv4globalobject.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4globalobject.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10using namespace QV4;-
11using QtMiscUtils::toHexUpper;-
12using QtMiscUtils::fromHex;-
13-
14static QString escape(const QString &input)-
15{-
16 QString output;-
17 output.reserve(input.size() * 3);-
18 const int length = input.length();-
19 for (int i = 0; i < length
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
20 ushort uc = input.at(i).unicode();-
21 if (uc < 0x100
uc < 0x100Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
22 if ( (uc > 0x60
uc > 0x60Description
TRUEnever evaluated
FALSEnever evaluated
&& uc < 0x7B
uc < 0x7BDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
23 || (uc > 0x3F
uc > 0x3FDescription
TRUEnever evaluated
FALSEnever evaluated
&& uc < 0x5B
uc < 0x5BDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
24 || (uc > 0x2C
uc > 0x2CDescription
TRUEnever evaluated
FALSEnever evaluated
&& uc < 0x3A
uc < 0x3ADescription
TRUEnever evaluated
FALSEnever evaluated
)
0
25 || (
(uc == 0x2A)Description
TRUEnever evaluated
FALSEnever evaluated
uc == 0x2A)
(uc == 0x2A)Description
TRUEnever evaluated
FALSEnever evaluated
0
26 || (
(uc == 0x2B)Description
TRUEnever evaluated
FALSEnever evaluated
uc == 0x2B)
(uc == 0x2B)Description
TRUEnever evaluated
FALSEnever evaluated
0
27 || (
(uc == 0x5F)Description
TRUEnever evaluated
FALSEnever evaluated
uc == 0x5F)
(uc == 0x5F)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
28 output.append(QChar(uc));-
29 }
never executed: end of block
else {
0
30 output.append('%');-
31 output.append(QLatin1Char(toHexUpper(uc >> 4)));-
32 output.append(QLatin1Char(toHexUpper(uc)));-
33 }
never executed: end of block
0
34 } else {-
35 output.append('%');-
36 output.append('u');-
37 output.append(QLatin1Char(toHexUpper(uc >> 12)));-
38 output.append(QLatin1Char(toHexUpper(uc >> 8)));-
39 output.append(QLatin1Char(toHexUpper(uc >> 4)));-
40 output.append(QLatin1Char(toHexUpper(uc)));-
41 }
never executed: end of block
0
42 }-
43 return
never executed: return output;
output;
never executed: return output;
0
44}-
45-
46static QString unescape(const QString &input)-
47{-
48 QString result;-
49 result.reserve(input.length());-
50 int i = 0;-
51 const int length = input.length();-
52 while (i < length
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
53 QChar c = input.at(i++);-
54 if ((
(c == '%')Description
TRUEnever evaluated
FALSEnever evaluated
c == '%')
(c == '%')Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(i + 1 < length)Description
TRUEnever evaluated
FALSEnever evaluated
i + 1 < length)
(i + 1 < length)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
55 QChar a = input.at(i);-
56 if ((
(a == 'u')Description
TRUEnever evaluated
FALSEnever evaluated
a == 'u')
(a == 'u')Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(i + 4 < length)Description
TRUEnever evaluated
FALSEnever evaluated
i + 4 < length)
(i + 4 < length)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
57 int d3 = fromHex(input.at(i+1).unicode());-
58 int d2 = fromHex(input.at(i+2).unicode());-
59 int d1 = fromHex(input.at(i+3).unicode());-
60 int d0 = fromHex(input.at(i+4).unicode());-
61 if ((
(d3 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
d3 != -1)
(d3 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(d2 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
d2 != -1)
(d2 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(d1 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
d1 != -1)
(d1 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(d0 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
d0 != -1)
(d0 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
62 ushort uc = ushort((d3 << 12) | (d2 << 8) | (d1 << 4) | d0);-
63 result.append(QChar(uc));-
64 i += 5;-
65 }
never executed: end of block
else {
0
66 result.append(c);-
67 }
never executed: end of block
0
68 } else {-
69 int d1 = fromHex(a.unicode());-
70 int d0 = fromHex(input.at(i+1).unicode());-
71 if ((
(d1 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
d1 != -1)
(d1 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(d0 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
d0 != -1)
(d0 != -1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
72 c = (d1 << 4) | d0;-
73 i += 2;-
74 }
never executed: end of block
0
75 result.append(c);-
76 }
never executed: end of block
0
77 } else {-
78 result.append(c);-
79 }
never executed: end of block
0
80 }-
81 return
never executed: return result;
result;
never executed: return result;
0
82}-
83-
84static const char uriReserved[] = ";/?:@&=+$,#";-
85static const char uriUnescaped[] = "-_.!~*'()";-
86static const char uriUnescapedReserved[] = "-_.!~*'();/?:@&=+$,#";-
87-
88static void addEscapeSequence(QString &output, uchar ch)-
89{-
90 output.append(QLatin1Char('%'));-
91 output.append(QLatin1Char(toHexUpper(ch >> 4)));-
92 output.append(QLatin1Char(toHexUpper(ch & 0xf)));-
93}
executed 1697097 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
1697097
94-
95static QString encode(const QString &input, const char *unescapedSet, bool *ok)-
96{-
97 *ok = true;-
98 QString output;-
99 const int length = input.length();-
100 int i = 0;-
101 while (i < length
i < lengthDescription
TRUEevaluated 658849 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 554790 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
) {
554790-658849
102 const QChar c = input.at(i);-
103 bool escape = true;-
104 if ((c.unicode() >= 'a'
c.unicode() >= 'a'Description
TRUEevaluated 648366 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 10314 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
&& c.unicode() <= 'z'
c.unicode() <= 'z'Description
TRUEevaluated 2808 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 645702 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) ||
2808-648366
105 (c.unicode() >= 'A'
c.unicode() >= 'A'Description
TRUEevaluated 654780 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 1452 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
&& c.unicode() <= 'Z'
c.unicode() <= 'Z'Description
TRUEevaluated 8754 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 645675 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) ||
1452-654780
106 (c.unicode() >= '0'
c.unicode() >= '0'Description
TRUEevaluated 646566 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1032 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
&& c.unicode() <= '9'
c.unicode() <= '9'Description
TRUEevaluated 192 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 645782 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)) {
192-646566
107 escape = false;-
108 }
executed 11754 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
else {
11754
109 const char *r = unescapedSet;-
110 while (*
*rDescription
TRUEevaluated 9363509 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 644990 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
r
*rDescription
TRUEevaluated 9363509 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 644990 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
) {
644990-9363509
111 if (*
*r == c.unicode()Description
TRUEevaluated 582 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 9361162 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
r == c.unicode()
*r == c.unicode()Description
TRUEevaluated 582 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 9361162 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
) {
582-9361162
112 escape = false;-
113 break;
executed 582 times by 2 tests: break;
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
582
114 }-
115 ++r;-
116 }
executed 9361076 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
9361076
117 }
executed 646876 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
646876
118 if (escape
escapeDescription
TRUEevaluated 646386 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 12336 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
) {
12336-646386
119 uint uc = c.unicode();-
120 if ((
(uc >= 0xDC00)Description
TRUEevaluated 81920 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 564777 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
uc >= 0xDC00)
(uc >= 0xDC00)Description
TRUEevaluated 81920 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 564777 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
&& (
(uc <= 0xDFFF)Description
TRUEevaluated 16384 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 65536 times by 1 test
Evaluated by:
  • tst_ecmascripttests
uc <= 0xDFFF)
(uc <= 0xDFFF)Description
TRUEevaluated 16384 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 65536 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
16384-564777
121 *ok = false;-
122 break;
executed 16384 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
16384
123 }-
124 if (!((
(uc < 0xD800)Description
TRUEevaluated 442216 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 188412 times by 1 test
Evaluated by:
  • tst_ecmascripttests
uc < 0xD800)
(uc < 0xD800)Description
TRUEevaluated 442216 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 188412 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| (
(uc > 0xDBFF)Description
TRUEevaluated 65536 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 122877 times by 1 test
Evaluated by:
  • tst_ecmascripttests
uc > 0xDBFF)
(uc > 0xDBFF)Description
TRUEevaluated 65536 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 122877 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)) {
65536-442216
125 ++i;-
126 if (i == length
i == lengthDescription
TRUEevaluated 16382 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 106496 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
16382-106496
127 *ok = false;-
128 break;
executed 16382 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
16382
129 }-
130 const uint uc2 = input.at(i).unicode();-
131 if ((
(uc2 < 0xDC00)Description
TRUEevaluated 40960 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 65536 times by 1 test
Evaluated by:
  • tst_ecmascripttests
uc2 < 0xDC00)
(uc2 < 0xDC00)Description
TRUEevaluated 40960 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 65536 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| (
(uc2 > 0xDFFF)Description
TRUEevaluated 16384 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 49152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
uc2 > 0xDFFF)
(uc2 > 0xDFFF)Description
TRUEevaluated 16384 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 49152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
16384-65536
132 *ok = false;-
133 break;
executed 57344 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
57344
134 }-
135 uc = ((uc - 0xD800) * 0x400) + (uc2 - 0xDC00) + 0x10000;-
136 }
executed 49152 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
49152
137 if (uc < 0x80
uc < 0x80Description
TRUEevaluated 830 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
FALSEevaluated 555606 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
830-555606
138 addEscapeSequence(output, (uchar)uc);-
139 }
executed 830 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
else {
830
140 if (uc < 0x0800
uc < 0x0800Description
TRUEevaluated 15656 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 536410 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
15656-536410
141 addEscapeSequence(output, 0xc0 | ((uchar) (uc >> 6)));-
142 }
executed 15656 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
15656
143-
144 if (QChar::requiresSurrogates(uc)
QChar::requiresSurrogates(uc)Description
TRUEevaluated 49152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 488625 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
49152-488625
145 addEscapeSequence(output, 0xf0 | ((uchar) (uc >> 18)));-
146 addEscapeSequence(output, 0x80 | (((uchar) (uc >> 12)) & 0x3f));-
147 }
executed 49152 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
49152
148 addEscapeSequence(output, 0xe0 | (((uchar) (uc >> 12)) & 0x3f));-
149 }
executed 488898 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
488898
150 addEscapeSequence(output, 0x80 | (((uchar) (uc >> 6)) & 0x3f));-
151 }
executed 538546 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
538546
152 addEscapeSequence(output, 0x80 | ((uchar) (uc&0x3f)));-
153 }
executed 554633 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
554633
154 } else {-
155 output.append(c);-
156 }
executed 12336 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
12336
157 ++i;-
158 }
executed 567865 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
567865
159 if (i != length
i != lengthDescription
TRUEevaluated 73728 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 570704 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
)
73728-570704
160 *
executed 73728 times by 1 test: *ok = false;
Executed by:
  • tst_ecmascripttests
ok = false;
executed 73728 times by 1 test: *ok = false;
Executed by:
  • tst_ecmascripttests
73728
161 return
executed 641194 times by 2 tests: return output;
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
output;
executed 641194 times by 2 tests: return output;
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
641194
162}-
163-
164enum DecodeMode {-
165 DecodeAll,-
166 DecodeNonReserved-
167};-
168-
169static QString decode(const QString &input, DecodeMode decodeMode, bool *ok)-
170{-
171 *ok = true;-
172 QString output;-
173 output.reserve(input.length());-
174 const int length = input.length();-
175 int i = 0;-
176 const QChar percent = QLatin1Char('%');-
177 while (i < length
i < lengthDescription
TRUEevaluated 13068743 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8861992 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
8861992-13068743
178 const QChar ch = input.at(i);-
179 if (ch == percent
ch == percentDescription
TRUEevaluated 12541623 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 527240 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
527240-12541623
180 int start = i;-
181 if (i + 2 >= length
i + 2 >= lengthDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12527160 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
32-12527160
182 goto
executed 32 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
error;
executed 32 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
32
183-
184 int d1 = fromHex(input.at(i+1).unicode());-
185 int d0 = fromHex(input.at(i+2).unicode());-
186 if ((
(d1 == -1)Description
TRUEevaluated 524016 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12037150 times by 1 test
Evaluated by:
  • tst_ecmascripttests
d1 == -1)
(d1 == -1)Description
TRUEevaluated 524016 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 12037150 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| (
(d0 == -1)Description
TRUEevaluated 524016 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 11582608 times by 1 test
Evaluated by:
  • tst_ecmascripttests
d0 == -1)
(d0 == -1)Description
TRUEevaluated 524016 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 11582608 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
524016-12037150
187 goto
executed 1025215 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
error;
executed 1025215 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
1025215
188-
189 int b = (d1 << 4) | d0;-
190 i += 2;-
191 if (b & 0x80
b & 0x80Description
TRUEevaluated 11596958 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1900 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
1900-11596958
192 int uc;-
193 int min_uc;-
194 int need;-
195 if ((
(b & 0xe0) == 0xc0Description
TRUEevaluated 589845 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 10979896 times by 1 test
Evaluated by:
  • tst_ecmascripttests
b & 0xe0) == 0xc0
(b & 0xe0) == 0xc0Description
TRUEevaluated 589845 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 10979896 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
589845-10979896
196 uc = b & 0x1f;-
197 need = 1;-
198 min_uc = 0x80;-
199 }
executed 589843 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else if ((
(b & 0xf0) == 0xe0Description
TRUEevaluated 1577624 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 9457071 times by 1 test
Evaluated by:
  • tst_ecmascripttests
b & 0xf0) == 0xe0
(b & 0xf0) == 0xe0Description
TRUEevaluated 1577624 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 9457071 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
589843-9457071
200 uc = b & 0x0f;-
201 need = 2;-
202 min_uc = 0x800;-
203 }
executed 1571449 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else if ((
(b & 0xf8) == 0xf0Description
TRUEevaluated 9468236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 576 times by 1 test
Evaluated by:
  • tst_ecmascripttests
b & 0xf8) == 0xf0
(b & 0xf8) == 0xf0Description
TRUEevaluated 9468236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 576 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
576-9468236
204 uc = b & 0x07;-
205 need = 3;-
206 min_uc = 0x10000;-
207 }
executed 9453701 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
9453701
208 goto
executed 575 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
error;
executed 575 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
575
209 }-
210-
211 if (i + (3 * need) >= length
i + (3 * need) >= lengthDescription
TRUEevaluated 2099 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 11577598 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
2099-11577598
212 goto
executed 2099 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
error;
executed 2099 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
2099
213-
214 for (int j = 0; j < need
j < needDescription
TRUEevaluated 29854783 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 8357808 times by 1 test
Evaluated by:
  • tst_ecmascripttests
; ++j) {
8357808-29854783
215 ++i;-
216 if (input.at(i) != percent
input.at(i) != percentDescription
TRUEevaluated 702 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 29913525 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
702-29913525
217 goto
executed 702 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
error;
executed 702 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
702
218-
219 d1 = fromHex(input.at(i+1).unicode());-
220 d0 = fromHex(input.at(i+2).unicode());-
221 if ((
(d1 == -1)Description
TRUEevaluated 3135070 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 26776527 times by 1 test
Evaluated by:
  • tst_ecmascripttests
d1 == -1)
(d1 == -1)Description
TRUEevaluated 3135070 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 26776527 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| (
(d0 == -1)Description
TRUEnever evaluated
FALSEevaluated 26804354 times by 1 test
Evaluated by:
  • tst_ecmascripttests
d0 == -1)
(d0 == -1)Description
TRUEnever evaluated
FALSEevaluated 26804354 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-26804354
222 goto
executed 3110132 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
error;
executed 3110132 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
3110132
223-
224 b = (d1 << 4) | d0;-
225 if ((
(b & 0xC0) != 0x80Description
TRUEevaluated 135157 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 26679004 times by 1 test
Evaluated by:
  • tst_ecmascripttests
b & 0xC0) != 0x80
(b & 0xC0) != 0x80Description
TRUEevaluated 135157 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 26679004 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
135157-26679004
226 goto
executed 135150 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
error;
executed 135150 times by 1 test: goto error;
Executed by:
  • tst_ecmascripttests
135150
227-
228 i += 2;-
229 uc = (uc << 6) + (b & 0x3f);-
230 }
executed 26667996 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
26667996
231 if (uc < min_uc
uc < min_ucDescription
TRUEnever evaluated
FALSEevaluated 8362624 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-8362624
232 goto
never executed: goto error;
error;
never executed: goto error;
0
233-
234 if (uc < 0x10000
uc < 0x10000Description
TRUEevaluated 507176 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 7857551 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
507176-7857551
235 output.append(QChar(uc));-
236 }
executed 507176 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
507176
237 if (uc > 0x10FFFF
uc > 0x10FFFFDescription
TRUEnever evaluated
FALSEevaluated 7838287 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-7838287
238 goto
never executed: goto error;
error;
never executed: goto error;
0
239-
240 ushort l = ushort(((uc - 0x10000) & 0x3FF) + 0xDC00);-
241 ushort h = ushort((((uc - 0x10000) >> 10) & 0x3FF) + 0xD800);-
242 output.append(QChar(h));-
243 output.append(QChar(l));-
244 }
executed 7821960 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
7821960
245 } else {-
246 if (decodeMode == DecodeNonReserved
decodeMode == ...odeNonReservedDescription
TRUEevaluated 924 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 976 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& b <= 0x40
b <= 0x40Description
TRUEevaluated 444 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 480 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
444-976
247 const char *r = uriReserved;-
248 while (*
*rDescription
TRUEevaluated 3848 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
r
*rDescription
TRUEevaluated 3848 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
236-3848
249 if (*
*r == bDescription
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3640 times by 1 test
Evaluated by:
  • tst_ecmascripttests
r == b
*r == bDescription
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 3640 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
208-3640
250 break;
executed 208 times by 1 test: break;
Executed by:
  • tst_ecmascripttests
208
251 ++r;-
252 }
executed 3640 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
3640
253 if (*
*rDescription
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
r
*rDescription
TRUEevaluated 208 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 236 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
208-236
254 output.append(input.midRef(start, i - start + 1));
executed 208 times by 1 test: output.append(input.midRef(start, i - start + 1));
Executed by:
  • tst_ecmascripttests
208
255 else-
256 output.append(QChar(b));
executed 236 times by 1 test: output.append(QChar(b));
Executed by:
  • tst_ecmascripttests
236
257 } else {-
258 output.append(QChar(b));-
259 }
executed 1456 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
1456
260 }-
261 } else {-
262 output.append(ch);-
263 }
executed 527240 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
527240
264 ++i;-
265 }
executed 8868322 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
8868322
266 if (i != length
i != lengthDescription
TRUEnever evaluated
FALSEevaluated 8874845 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-8874845
267 *
never executed: *ok = false;
ok = false;
never executed: *ok = false;
0
268 return
executed 8829052 times by 1 test: return output;
Executed by:
  • tst_ecmascripttests
output;
executed 8829052 times by 1 test: return output;
Executed by:
  • tst_ecmascripttests
8829052
269 error:-
270 *ok = false;-
271 return
executed 4219004 times by 1 test: return QString();
Executed by:
  • tst_ecmascripttests
QString();
executed 4219004 times by 1 test: return QString();
Executed by:
  • tst_ecmascripttests
4219004
272}-
273-
274const QV4::VTable EvalFunction::static_vtbl = { (std::is_same<EvalFunction::SuperClass, Object>::value) ? nullptr : &EvalFunction::SuperClass::static_vtbl, (sizeof(EvalFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(EvalFunction::Data) + (EvalFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(EvalFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), EvalFunction::IsExecutionContext, EvalFunction::IsString, EvalFunction::IsObject, EvalFunction::IsFunctionObject, EvalFunction::IsErrorObject, EvalFunction::IsArrayData, EvalFunction::IsStringOrSymbol, EvalFunction::MyType, { 0, 0, 0, 0 }, "EvalFunction", EvalFunction::virtualDestroy, EvalFunction::Data::markObjects, EvalFunction::virtualIsEqualTo, EvalFunction::virtualGet, EvalFunction::virtualPut, EvalFunction::virtualDeleteProperty, EvalFunction::virtualHasProperty, EvalFunction::virtualGetOwnProperty, EvalFunction::virtualDefineOwnProperty, EvalFunction::virtualIsExtensible, EvalFunction::virtualPreventExtensions, EvalFunction::virtualGetPrototypeOf, EvalFunction::virtualSetPrototypeOf, EvalFunction::virtualGetLength, EvalFunction::virtualAdvanceIterator, EvalFunction::virtualInstanceOf, EvalFunction::virtualCall, EvalFunction::virtualCallAsConstructor, };-
275-
276void Heap::EvalFunction::init(QV4::ExecutionContext *scope)-
277{-
278 Scope s(scope);-
279 Heap::FunctionObject::init(scope, s.engine->id_eval());-
280 ScopedFunctionObject f(s, this);-
281 f->defineReadonlyConfigurableProperty(s.engine->id_length(), Primitive::fromInt32(1));-
282}
executed 98530 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
  • ...
98530
283-
284ReturnedValue EvalFunction::evalCall(const Value *, const Value *argv, int argc, bool directCall) const-
285{-
286 if (argc < 1
argc < 1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1579011 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
)
12-1579011
287 return
executed 12 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 12 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
12
288-
289 ExecutionEngine *v4 = engine();-
290 bool isStrict = v4->currentStackFrame->v4Function->isStrict();-
291-
292 Scope scope(v4);-
293 ScopedContext ctx(scope, v4->currentContext());-
294-
295 if (!directCall
!directCallDescription
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1578622 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
) {
60-1578622
296-
297 ctx = v4->scriptContext();-
298 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
60
299-
300 String *scode = argv[0].stringValue();-
301 if (!scode
!scodeDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1578956 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
)
72-1578956
302 return
executed 72 times by 1 test: return argv[0].asReturnedValue();
Executed by:
  • tst_ecmascripttests
argv[0].asReturnedValue();
executed 72 times by 1 test: return argv[0].asReturnedValue();
Executed by:
  • tst_ecmascripttests
72
303-
304 const QString code = scode->toQString();-
305 bool inheritContext = !isStrict;-
306-
307 Script script(ctx, QV4::Compiler::ContextType::Eval, code, ([]() noexcept -> QString { enum { Size = sizeof(u"" "eval code")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "eval code" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 1580111 times by 7 tests: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
qstring_literal_temp;
executed 1580111 times by 7 tests: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
}()));
1580111
308 script.strictMode = (directCall
directCallDescription
TRUEevaluated 1579465 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_ecmascripttests
&& isStrict
isStrictDescription
TRUEevaluated 788850 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 790836 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
);
60-1579465
309 script.inheritContext = inheritContext;-
310 script.parse();-
311 if (v4->hasException
v4->hasExceptionDescription
TRUEevaluated 569 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1578345 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
)
569-1578345
312 return
executed 570 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 570 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
570
313-
314 Function *function = script.function();-
315 if (!function
!functionDescription
TRUEevaluated 521286 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1055169 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
)
521286-1055169
316 return
executed 519155 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
Encode::undefined();
executed 519155 times by 1 test: return Encode::undefined();
Executed by:
  • tst_ecmascripttests
519155
317-
318 if (function->isStrict()
function->isStrict()Description
TRUEevaluated 526402 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
FALSEevaluated 528749 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
|| isStrict
isStrictDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 528753 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
) {
28-528753
319 ScopedFunctionObject e(scope, FunctionObject::createScriptFunction(ctx, function));-
320 ScopedValue thisObject(scope, directCall ? scope.engine->currentStackFrame->thisObject() : scope.engine->globalObject->asReturnedValue());-
321 return
executed 526429 times by 2 tests: return e->call(thisObject, nullptr, 0);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
e->call(thisObject, nullptr, 0);
executed 526429 times by 2 tests: return e->call(thisObject, nullptr, 0);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
526429
322 }-
323-
324 ScopedValue thisObject(scope, scope.engine->currentStackFrame->thisObject());-
325-
326 return
executed 528709 times by 7 tests: return function->call(thisObject, nullptr, 0, ctx);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
function->call(thisObject, nullptr, 0, ctx);
executed 528709 times by 7 tests: return function->call(thisObject, nullptr, 0, ctx);
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qquickworkerscript
528709
327}-
328-
329-
330ReturnedValue EvalFunction::virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)-
331{-
332-
333 return
executed 64 times by 1 test: return static_cast<const EvalFunction *>(f)->evalCall(thisObject, argv, argc, false);
Executed by:
  • tst_ecmascripttests
static_cast<const EvalFunction *>(f)->evalCall(thisObject, argv, argc, false);
executed 64 times by 1 test: return static_cast<const EvalFunction *>(f)->evalCall(thisObject, argv, argc, false);
Executed by:
  • tst_ecmascripttests
64
334}-
335-
336-
337static inline int toInt(const QChar &qc, int R)-
338{-
339 ushort c = qc.unicode();-
340 int v = -1;-
341 if (c >= '0'
c >= '0'Description
TRUEevaluated 806000 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 744 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
&& c <= '9'
c <= '9'Description
TRUEevaluated 271464 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 534536 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
744-806000
342 v = c - '0';
executed 271464 times by 2 tests: v = c - '0';
Executed by:
  • tst_ecmascripttests
  • tst_examples
271464
343 else if (c >= 'A'
c >= 'A'Description
TRUEevaluated 534508 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 772 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
&& c <= 'Z'
c <= 'Z'Description
TRUEevaluated 267396 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 267112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
772-534508
344 v = c - 'A' + 10;
executed 267396 times by 1 test: v = c - 'A' + 10;
Executed by:
  • tst_ecmascripttests
267396
345 else if (c >= 'a'
c >= 'a'Description
TRUEevaluated 267084 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 800 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
&& c <= 'z'
c <= 'z'Description
TRUEevaluated 5496 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 261588 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
800-267084
346 v = c - 'a' + 10;
executed 5496 times by 1 test: v = c - 'a' + 10;
Executed by:
  • tst_ecmascripttests
5496
347 if (v >= 0
v >= 0Description
TRUEevaluated 544356 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 262388 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
&& v < R
v < RDescription
TRUEevaluated 544000 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 356 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
356-544356
348 return
executed 544000 times by 2 tests: return v;
Executed by:
  • tst_ecmascripttests
  • tst_examples
v;
executed 544000 times by 2 tests: return v;
Executed by:
  • tst_ecmascripttests
  • tst_examples
544000
349 else-
350 return
executed 262744 times by 2 tests: return -1;
Executed by:
  • tst_ecmascripttests
  • tst_examples
-1;
executed 262744 times by 2 tests: return -1;
Executed by:
  • tst_ecmascripttests
  • tst_examples
262744
351}-
352-
353-
354ReturnedValue GlobalFunctions::method_parseInt(const FunctionObject *b, const Value *, const Value *argv, int argc)-
355{-
356 Scope scope(b);-
357 ScopedValue inputString(scope, argc ? argv[0] : Primitive::undefinedValue());-
358 ScopedValue radix(scope, argc > 1 ? argv[1] : Primitive::undefinedValue());-
359 int R = radix->isUndefined()
radix->isUndefined()Description
TRUEevaluated 812 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 266664 times by 1 test
Evaluated by:
  • tst_ecmascripttests
? 0 : radix->toInt32();
812-266664
360-
361-
362 QString trimmed = inputString->toQString().trimmed();-
363 do { if (scope.hasException()
scope.hasException()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 267460 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
) { return
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
QV4::Encode::undefined();
executed 16 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
} } while (false);
16-267460
364-
365 const QChar *pos = trimmed.constData();-
366 const QChar *end = pos + trimmed.length();-
367-
368 int sign = 1;-
369 if (pos != end
pos != endDescription
TRUEevaluated 267352 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
108-267352
370 if (*
*pos == QLatin1Char('-')Description
TRUEevaluated 972 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 266380 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
pos == QLatin1Char('-')
*pos == QLatin1Char('-')Description
TRUEevaluated 972 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 266380 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
)
972-266380
371 sign = -1;
executed 972 times by 1 test: sign = -1;
Executed by:
  • tst_ecmascripttests
972
372 if (*
*pos == QLatin1Char('-')Description
TRUEevaluated 972 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 266380 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
pos == QLatin1Char('-')
*pos == QLatin1Char('-')Description
TRUEevaluated 972 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 266380 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
|| *
*pos == QLatin1Char('+')Description
TRUEevaluated 700 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 265680 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
pos == QLatin1Char('+')
*pos == QLatin1Char('+')Description
TRUEevaluated 700 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 265680 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
)
700-266380
373 ++
executed 1672 times by 1 test: ++pos;
Executed by:
  • tst_ecmascripttests
pos;
executed 1672 times by 1 test: ++pos;
Executed by:
  • tst_ecmascripttests
1672
374 }
executed 267352 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
267352
375 bool stripPrefix = true;-
376 if (R
RDescription
TRUEevaluated 266464 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 996 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
) {
996-266464
377 if (R < 2
R < 2Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 266408 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| R > 36
R > 36Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 266356 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
52-266408
378 return
executed 108 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
executed 108 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
108
379 if (R != 16
R != 16Description
TRUEevaluated 266028 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 328 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
328-266028
380 stripPrefix = false;
executed 266028 times by 1 test: stripPrefix = false;
Executed by:
  • tst_ecmascripttests
266028
381 }
executed 266356 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
266356
382 R = 10;-
383 }
executed 996 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
996
384 if (stripPrefix
stripPrefixDescription
TRUEevaluated 1324 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 266028 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
1324-266028
385 if ((
(end - pos >= 2)Description
TRUEevaluated 504 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 820 times by 1 test
Evaluated by:
  • tst_ecmascripttests
end - pos >= 2)
(end - pos >= 2)Description
TRUEevaluated 504 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 820 times by 1 test
Evaluated by:
  • tst_ecmascripttests
504-820
386 && (
(pos[0] == QLatin1Char('0'))Description
TRUEevaluated 228 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 276 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
pos[0] == QLatin1Char('0'))
(pos[0] == QLatin1Char('0'))Description
TRUEevaluated 228 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 276 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
228-276
387 && (pos[1] == QLatin1Char('x')
pos[1] == QLatin1Char('x')Description
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_ecmascripttests
|| pos[1] == QLatin1Char('X')
pos[1] == QLatin1Char('X')Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)) {
4-140
388 pos += 2;-
389 R = 16;-
390 }
executed 224 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
224
391 }
executed 1324 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
1324
392-
393-
394 if (pos == end
pos == endDescription
TRUEevaluated 108 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 267244 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
)
108-267244
395 return
executed 108 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
executed 108 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
108
396 bool overflow = false;-
397 qint64 v_overflow = 0;-
398 unsigned overflow_digit_count = 0;-
399 int d = toInt(*pos++, R);-
400 if (d == -1
d == -1Description
TRUEevaluated 220 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 267024 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
)
220-267024
401 return
executed 220 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
executed 220 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
220
402 qint64 v = d;-
403 while (pos != end
pos != endDescription
TRUEevaluated 539500 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 4500 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
4500-539500
404 d = toInt(*pos++, R);-
405 if (d == -1
d == -1Description
TRUEevaluated 262524 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
FALSEevaluated 276976 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
)
262524-276976
406 break;
executed 262524 times by 2 tests: break;
Executed by:
  • tst_ecmascripttests
  • tst_examples
262524
407 if (overflow
overflowDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 276932 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
) {
44-276932
408 if (overflow_digit_count == 0
overflow_digit_count == 0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
20-24
409 v_overflow = v;-
410 v = 0;-
411 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
20
412 ++overflow_digit_count;-
413 v = v * R + d;-
414 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
44
415 qint64 vNew = v * R + d;-
416 if (vNew < v
vNew < vDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 276912 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
) {
20-276912
417 overflow = true;-
418 --pos;-
419 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_ecmascripttests
else {
20
420 v = vNew;-
421 }
executed 276912 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
276912
422 }-
423 }-
424-
425 if (overflow
overflowDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 267004 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
) {
20-267004
426 double result = (double) v_overflow * pow(static_cast<double>(R), static_cast<double>(overflow_digit_count));-
427 result += v;-
428 return
executed 20 times by 1 test: return QV4::Encode(Encode(sign * result));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(sign * result));
executed 20 times by 1 test: return QV4::Encode(Encode(sign * result));
Executed by:
  • tst_ecmascripttests
20
429 } else {-
430 return
executed 267004 times by 2 tests: return QV4::Encode(Encode(sign * (double) v));
Executed by:
  • tst_ecmascripttests
  • tst_examples
QV4::Encode(Encode(sign * (double) v));
executed 267004 times by 2 tests: return QV4::Encode(Encode(sign * (double) v));
Executed by:
  • tst_ecmascripttests
  • tst_examples
267004
431 }-
432}-
433-
434-
435ReturnedValue GlobalFunctions::method_parseFloat(const FunctionObject *b, const Value *, const Value *argv, int argc)-
436{-
437 Scope scope(b);-
438-
439 ScopedString inputString(scope, argc ? argv[0] : Primitive::undefinedValue(), ScopedString::Convert);-
440 do { if (scope.hasException()
scope.hasException()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 263152 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) { return
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
QV4::Encode::undefined();
executed 8 times by 1 test: return QV4::Encode::undefined();
Executed by:
  • tst_ecmascripttests
} } while (false);
8-263152
441-
442 QString trimmed = inputString->toQString().trimmed();-
443-
444-
445 if (trimmed.startsWith(QLatin1String("Infinity"))
trimmed.starts...g("Infinity"))Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 263112 times by 1 test
Evaluated by:
  • tst_ecmascripttests
40-263112
446 || trimmed.startsWith(QLatin1String("+Infinity"))
trimmed.starts...("+Infinity"))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 263108 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-263108
447 return
executed 44 times by 1 test: return QV4::Encode(Encode((::qInf())));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode((::qInf())));
executed 44 times by 1 test: return QV4::Encode(Encode((::qInf())));
Executed by:
  • tst_ecmascripttests
44
448 if (trimmed.startsWith(QLatin1String("-Infinity"))
trimmed.starts...("-Infinity"))Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 263104 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
4-263104
449 return
executed 4 times by 1 test: return QV4::Encode(Encode(-(::qInf())));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(-(::qInf())));
executed 4 times by 1 test: return QV4::Encode(Encode(-(::qInf())));
Executed by:
  • tst_ecmascripttests
4
450 QByteArray ba = trimmed.toLatin1();-
451 bool ok;-
452 const char *begin = ba.constData();-
453 const char *end = nullptr;-
454 double d = qstrtod(begin, &end, &ok);-
455 if (end - begin == 0
end - begin == 0Description
TRUEevaluated 212 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 262891 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
212-262891
456 return
executed 212 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
executed 212 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));
Executed by:
  • tst_ecmascripttests
212
457 else-
458 return
executed 262892 times by 1 test: return QV4::Encode(Encode(d));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(d));
executed 262892 times by 1 test: return QV4::Encode(Encode(d));
Executed by:
  • tst_ecmascripttests
262892
459}-
460-
461-
462ReturnedValue GlobalFunctions::method_isNaN(const FunctionObject *, const Value *, const Value *argv, int argc)-
463{-
464 if (!argc
!argcDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 2074 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
)
4-2074
465-
466 return
executed 4 times by 1 test: return QV4::Encode(Encode(true));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(true));
executed 4 times by 1 test: return QV4::Encode(Encode(true));
Executed by:
  • tst_ecmascripttests
4
467-
468 if (argv[0].integerCompatible()
argv[0].integerCompatible()Description
TRUEevaluated 182 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquicklayouts
FALSEevaluated 1892 times by 4 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
)
182-1892
469 return
executed 182 times by 2 tests: return QV4::Encode(Encode(false));
Executed by:
  • tst_ecmascripttests
  • tst_qquicklayouts
QV4::Encode(Encode(false));
executed 182 times by 2 tests: return QV4::Encode(Encode(false));
Executed by:
  • tst_ecmascripttests
  • tst_qquicklayouts
182
470-
471 double d = argv[0].toNumber();-
472 return
executed 1892 times by 4 tests: return QV4::Encode(Encode((bool)std::isnan(d)));
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
QV4::Encode(Encode((bool)std::isnan(d)));
executed 1892 times by 4 tests: return QV4::Encode(Encode((bool)std::isnan(d)));
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
1892
473}-
474-
475-
476ReturnedValue GlobalFunctions::method_isFinite(const FunctionObject *, const Value *, const Value *argv, int argc)-
477{-
478 if (!argc
!argcDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 174 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquicklayouts
)
4-174
479-
480 return
executed 4 times by 1 test: return QV4::Encode(Encode(false));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(false));
executed 4 times by 1 test: return QV4::Encode(Encode(false));
Executed by:
  • tst_ecmascripttests
4
481-
482 if (argv[0].integerCompatible()
argv[0].integerCompatible()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 150 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquicklayouts
)
24-150
483 return
executed 24 times by 1 test: return QV4::Encode(Encode(true));
Executed by:
  • tst_ecmascripttests
QV4::Encode(Encode(true));
executed 24 times by 1 test: return QV4::Encode(Encode(true));
Executed by:
  • tst_ecmascripttests
24
484-
485 double d = argv[0].toNumber();-
486 return
executed 150 times by 2 tests: return QV4::Encode(Encode((bool)std::isfinite(d)));
Executed by:
  • tst_ecmascripttests
  • tst_qquicklayouts
QV4::Encode(Encode((bool)std::isfinite(d)));
executed 150 times by 2 tests: return QV4::Encode(Encode((bool)std::isfinite(d)));
Executed by:
  • tst_ecmascripttests
  • tst_qquicklayouts
150
487}-
488-
489-
490ReturnedValue GlobalFunctions::method_decodeURI(const FunctionObject *b, const Value *, const Value *argv, int argc)-
491{-
492 if (argc == 0
argc == 0Description
TRUEnever evaluated
FALSEevaluated 6545862 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-6545862
493 return
never executed: return QV4::Encode::undefined();
QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
494-
495 ExecutionEngine *v4 = b->engine();-
496 QString uriString = argv[0].toQString();-
497 bool ok;-
498 QString out = decode(uriString, DecodeNonReserved, &ok);-
499 if (!ok
!okDescription
TRUEevaluated 2129259 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4445896 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
2129259-4445896
500 Scope scope(v4);-
501 ScopedString s(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "malformed URI sequence")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "malformed URI sequence" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 2065233 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
qstring_literal_temp;
executed 2065233 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
}())));
2065233
502 return
executed 2065227 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
QV4::Encode(scope.engine->throwURIError(s));
executed 2065227 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
2065227
503 }-
504-
505 return
executed 4445724 times by 1 test: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
QV4::Encode(v4->newString(out));
executed 4445724 times by 1 test: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
4445724
506}-
507-
508-
509ReturnedValue GlobalFunctions::method_decodeURIComponent(const FunctionObject *b, const Value *, const Value *argv, int argc)-
510{-
511 if (argc == 0
argc == 0Description
TRUEnever evaluated
FALSEevaluated 6589277 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-6589277
512 return
never executed: return QV4::Encode::undefined();
QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
513-
514 ExecutionEngine *v4 = b->engine();-
515 QString uriString = argv[0].toQString();-
516 bool ok;-
517 QString out = decode(uriString, DecodeAll, &ok);-
518 if (!ok
!okDescription
TRUEevaluated 2147387 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 4447800 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
2147387-4447800
519 Scope scope(v4);-
520 ScopedString s(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "malformed URI sequence")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "malformed URI sequence" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 2104002 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
qstring_literal_temp;
executed 2104002 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
}())));
2104002
521 return
executed 2110048 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
QV4::Encode(scope.engine->throwURIError(s));
executed 2110048 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
2110048
522 }-
523-
524 return
executed 4447441 times by 1 test: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
QV4::Encode(v4->newString(out));
executed 4447441 times by 1 test: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
4447441
525}-
526-
527-
528ReturnedValue GlobalFunctions::method_encodeURI(const FunctionObject *b, const Value *, const Value *argv, int argc)-
529{-
530 if (argc == 0
argc == 0Description
TRUEnever evaluated
FALSEevaluated 323557 times by 1 test
Evaluated by:
  • tst_ecmascripttests
)
0-323557
531 return
never executed: return QV4::Encode::undefined();
QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
532-
533 ExecutionEngine *v4 = b->engine();-
534 QString uriString = argv[0].toQString();-
535 bool ok;-
536 QString out = encode(uriString, uriUnescapedReserved, &ok);-
537 if (!ok
!okDescription
TRUEevaluated 45053 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 278568 times by 1 test
Evaluated by:
  • tst_ecmascripttests
) {
45053-278568
538 Scope scope(v4);-
539 ScopedString s(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "malformed URI sequence")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "malformed URI sequence" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 45053 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
qstring_literal_temp;
executed 45053 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
}())));
45053
540 return
executed 45055 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
QV4::Encode(scope.engine->throwURIError(s));
executed 45055 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
45055
541 }-
542-
543 return
executed 278562 times by 1 test: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
QV4::Encode(v4->newString(out));
executed 278562 times by 1 test: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
278562
544}-
545-
546-
547ReturnedValue GlobalFunctions::method_encodeURIComponent(const FunctionObject *b, const Value *, const Value *argv, int argc)-
548{-
549 if (argc == 0
argc == 0Description
TRUEnever evaluated
FALSEevaluated 323396 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
)
0-323396
550 return
never executed: return QV4::Encode::undefined();
QV4::Encode::undefined();
never executed: return QV4::Encode::undefined();
0
551-
552 ExecutionEngine *v4 = b->engine();-
553 QString uriString = argv[0].toQString();-
554 bool ok;-
555 QString out = encode(uriString, uriUnescaped, &ok);-
556 if (!ok
!okDescription
TRUEevaluated 45056 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 277471 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qquickloader
) {
45056-277471
557 Scope scope(v4);-
558 ScopedString s(scope, scope.engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "malformed URI sequence")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "malformed URI sequence" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 45056 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
qstring_literal_temp;
executed 45056 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_ecmascripttests
}())));
45056
559 return
executed 45056 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
QV4::Encode(scope.engine->throwURIError(s));
executed 45056 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));
Executed by:
  • tst_ecmascripttests
45056
560 }-
561-
562 return
executed 277375 times by 2 tests: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
QV4::Encode(v4->newString(out));
executed 277375 times by 2 tests: return QV4::Encode(v4->newString(out));
Executed by:
  • tst_ecmascripttests
  • tst_qquickloader
277375
563}-
564-
565ReturnedValue GlobalFunctions::method_escape(const FunctionObject *b, const Value *, const Value *argv, int argc)-
566{-
567 ExecutionEngine *v4 = b->engine();-
568 if (!argc
!argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
569 return
never executed: return QV4::Encode(v4->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "undefined")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "undefined" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));
QV4::Encode(v4->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "undefined")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "undefined" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}())));
never executed: return QV4::Encode(v4->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "undefined")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "undefined" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));
0
570-
571 QString str = argv[0].toQString();-
572 return
never executed: return QV4::Encode(v4->newString(escape(str)));
QV4::Encode(v4->newString(escape(str)));
never executed: return QV4::Encode(v4->newString(escape(str)));
0
573}-
574-
575ReturnedValue GlobalFunctions::method_unescape(const FunctionObject *b, const Value *, const Value *argv, int argc)-
576{-
577 ExecutionEngine *v4 = b->engine();-
578 if (!argc
!argcDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
579 return
never executed: return QV4::Encode(v4->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "undefined")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "undefined" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));
QV4::Encode(v4->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "undefined")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "undefined" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}())));
never executed: return QV4::Encode(v4->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "undefined")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "undefined" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())));
0
580-
581 QString str = argv[0].toQString();-
582 return
never executed: return QV4::Encode(v4->newString(unescape(str)));
QV4::Encode(v4->newString(unescape(str)));
never executed: return QV4::Encode(v4->newString(unescape(str)));
0
583}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0