| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4globalobject.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | using namespace QV4; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | using QtMiscUtils::toHexUpper; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | using QtMiscUtils::fromHex; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | static 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | ushort uc = input.at(i).unicode(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | if (uc < 0x100
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | if ( (uc > 0x60
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | || (uc > 0x3F
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | || (uc > 0x2C
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | output.append(QChar(uc)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } never executed: else {end of block | 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: output;return output;never executed: return output; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | static 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | QChar c = input.at(i++); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | QChar a = input.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | if ((
| 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 ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | ushort uc = ushort((d3 << 12) | (d2 << 8) | (d1 << 4) | d0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | result.append(QChar(uc)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | i += 5; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | } never executed: else {end of block | 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 ((
| 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: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | static const char uriReserved[] = ";/?:@&=+$,#"; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | static const char uriUnescaped[] = "-_.!~*'()"; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | static const char uriUnescapedReserved[] = "-_.!~*'();/?:@&=+$,#"; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | static 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 blockExecuted by:
| 1697097 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | static 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
| 554790-658849 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | const QChar c = input.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | bool escape = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | if ((c.unicode() >= 'a'
| 2808-648366 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | (c.unicode() >= 'A'
| 1452-654780 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | (c.unicode() >= '0'
| 192-646566 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | escape = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } executed 11754 times by 2 tests: else {end of blockExecuted by:
| 11754 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | const char *r = unescapedSet; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | while (*
| 644990-9363509 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | if (*
| 582-9361162 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | escape = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | break; executed 582 times by 2 tests: break;Executed by:
| 582 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ++r; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } executed 9361076 times by 2 tests: end of blockExecuted by:
| 9361076 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } executed 646876 times by 2 tests: end of blockExecuted by:
| 646876 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | if (escape
| 12336-646386 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | uint uc = c.unicode(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | if ((
| 16384-564777 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | *ok = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | break; executed 16384 times by 1 test: break;Executed by:
| 16384 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | if (!((
| 65536-442216 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | ++i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | if (i == length
| 16382-106496 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | *ok = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | break; executed 16382 times by 1 test: break;Executed by:
| 16382 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | const uint uc2 = input.at(i).unicode(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | if ((
| 16384-65536 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | *ok = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | break; executed 57344 times by 1 test: break;Executed by:
| 57344 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | uc = ((uc - 0xD800) * 0x400) + (uc2 - 0xDC00) + 0x10000; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } executed 49152 times by 1 test: end of blockExecuted by:
| 49152 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | if (uc < 0x80
| 830-555606 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | addEscapeSequence(output, (uchar)uc); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } executed 830 times by 2 tests: else {end of blockExecuted by:
| 830 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | if (uc < 0x0800
| 15656-536410 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | addEscapeSequence(output, 0xc0 | ((uchar) (uc >> 6))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | } executed 15656 times by 1 test: else {end of blockExecuted by:
| 15656 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | if (QChar::requiresSurrogates(uc)
| 49152-488625 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | addEscapeSequence(output, 0xf0 | ((uchar) (uc >> 18))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | addEscapeSequence(output, 0x80 | (((uchar) (uc >> 12)) & 0x3f)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } executed 49152 times by 1 test: else {end of blockExecuted by:
| 49152 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | addEscapeSequence(output, 0xe0 | (((uchar) (uc >> 12)) & 0x3f)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } executed 488898 times by 1 test: end of blockExecuted by:
| 488898 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | addEscapeSequence(output, 0x80 | (((uchar) (uc >> 6)) & 0x3f)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } executed 538546 times by 1 test: end of blockExecuted by:
| 538546 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | addEscapeSequence(output, 0x80 | ((uchar) (uc&0x3f))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } executed 554633 times by 1 test: end of blockExecuted by:
| 554633 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | output.append(c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } executed 12336 times by 2 tests: end of blockExecuted by:
| 12336 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | ++i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } executed 567865 times by 2 tests: end of blockExecuted by:
| 567865 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | if (i != length
| 73728-570704 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | * executed 73728 times by 1 test: ok = false;*ok = false;Executed by:
executed 73728 times by 1 test: *ok = false;Executed by:
| 73728 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | return executed 641194 times by 2 tests: output;return output;Executed by:
executed 641194 times by 2 tests: return output;Executed by:
| 641194 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | enum DecodeMode { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | DecodeAll, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | DecodeNonReserved | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | static 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
| 8861992-13068743 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | const QChar ch = input.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | if (ch == percent
| 527240-12541623 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | int start = i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | if (i + 2 >= length
| 32-12527160 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | goto executed 32 times by 1 test: error;goto error;Executed by:
executed 32 times by 1 test: goto error;Executed by:
| 32 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | int d1 = fromHex(input.at(i+1).unicode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | int d0 = fromHex(input.at(i+2).unicode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | if ((
| 524016-12037150 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | goto executed 1025215 times by 1 test: error;goto error;Executed by:
executed 1025215 times by 1 test: goto error;Executed by:
| 1025215 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | int b = (d1 << 4) | d0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | i += 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | if (b & 0x80
| 1900-11596958 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | int uc; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | int min_uc; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | int need; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | if ((
| 589845-10979896 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | uc = b & 0x1f; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | need = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | min_uc = 0x80; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } executed 589843 times by 1 test: else if ((end of blockExecuted by:
| 589843-9457071 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | uc = b & 0x0f; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | need = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | min_uc = 0x800; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } executed 1571449 times by 1 test: else if ((end of blockExecuted by:
| 576-9468236 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | uc = b & 0x07; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | need = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | min_uc = 0x10000; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | } executed 9453701 times by 1 test: else {end of blockExecuted by:
| 9453701 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | goto executed 575 times by 1 test: error;goto error;Executed by:
executed 575 times by 1 test: goto error;Executed by:
| 575 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | if (i + (3 * need) >= length
| 2099-11577598 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | goto executed 2099 times by 1 test: error;goto error;Executed by:
executed 2099 times by 1 test: goto error;Executed by:
| 2099 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | for (int j = 0; j < need
| 8357808-29854783 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | ++i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | if (input.at(i) != percent
| 702-29913525 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | goto executed 702 times by 1 test: error;goto error;Executed by:
executed 702 times by 1 test: goto error;Executed by:
| 702 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | d1 = fromHex(input.at(i+1).unicode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | d0 = fromHex(input.at(i+2).unicode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | if ((
| 0-26804354 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | goto executed 3110132 times by 1 test: error;goto error;Executed by:
executed 3110132 times by 1 test: goto error;Executed by:
| 3110132 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | b = (d1 << 4) | d0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | if ((
| 135157-26679004 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | goto executed 135150 times by 1 test: error;goto error;Executed by:
executed 135150 times by 1 test: goto error;Executed by:
| 135150 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | i += 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | uc = (uc << 6) + (b & 0x3f); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | } executed 26667996 times by 1 test: end of blockExecuted by:
| 26667996 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | if (uc < min_uc
| 0-8362624 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | goto never executed: error;goto error;never executed: goto error; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | if (uc < 0x10000
| 507176-7857551 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | output.append(QChar(uc)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | } executed 507176 times by 1 test: else {end of blockExecuted by:
| 507176 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | if (uc > 0x10FFFF
| 0-7838287 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | goto never executed: error;goto 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 blockExecuted by:
| 7821960 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | if (decodeMode == DecodeNonReserved
| 444-976 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | const char *r = uriReserved; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | while (*
| 236-3848 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | if (*
| 208-3640 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | break; executed 208 times by 1 test: break;Executed by:
| 208 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | ++r; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | } executed 3640 times by 1 test: end of blockExecuted by:
| 3640 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | if (*
| 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:
| 208 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | output.append(QChar(b)); executed 236 times by 1 test: output.append(QChar(b));Executed by:
| 236 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | output.append(QChar(b)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } executed 1456 times by 1 test: end of blockExecuted by:
| 1456 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | output.append(ch); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | } executed 527240 times by 1 test: end of blockExecuted by:
| 527240 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | ++i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | } executed 8868322 times by 1 test: end of blockExecuted by:
| 8868322 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | if (i != length
| 0-8874845 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | * never executed: ok = false;*ok = false;never executed: *ok = false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | return executed 8829052 times by 1 test: output;return output;Executed by:
executed 8829052 times by 1 test: return output;Executed by:
| 8829052 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | error: | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | *ok = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | return executed 4219004 times by 1 test: QString();return QString();Executed by:
executed 4219004 times by 1 test: return QString();Executed by:
| 4219004 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | const 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | void 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 blockExecuted by:
| 98530 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | ReturnedValue EvalFunction::evalCall(const Value *, const Value *argv, int argc, bool directCall) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | if (argc < 1
| 12-1579011 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | return executed 12 times by 1 test: Encode::undefined();return Encode::undefined();Executed by:
executed 12 times by 1 test: return Encode::undefined();Executed by:
| 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
| 60-1578622 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | ctx = v4->scriptContext(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | } executed 60 times by 1 test: end of blockExecuted by:
| 60 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | String *scode = argv[0].stringValue(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | if (!scode
| 72-1578956 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | return executed 72 times by 1 test: argv[0].asReturnedValue();return argv[0].asReturnedValue();Executed by:
executed 72 times by 1 test: return argv[0].asReturnedValue();Executed by:
| 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: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 1580111 times by 7 tests: }()));return qstring_literal_temp;Executed by:
| 1580111 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | script.strictMode = (directCall
| 60-1579465 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | script.inheritContext = inheritContext; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | script.parse(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | if (v4->hasException
| 569-1578345 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | return executed 570 times by 1 test: Encode::undefined();return Encode::undefined();Executed by:
executed 570 times by 1 test: return Encode::undefined();Executed by:
| 570 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | Function *function = script.function(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | if (!function
| 521286-1055169 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | return executed 519155 times by 1 test: Encode::undefined();return Encode::undefined();Executed by:
executed 519155 times by 1 test: return Encode::undefined();Executed by:
| 519155 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | if (function->isStrict()
| 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: e->call(thisObject, nullptr, 0);return e->call(thisObject, nullptr, 0);Executed by:
executed 526429 times by 2 tests: return e->call(thisObject, nullptr, 0);Executed by:
| 526429 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | ScopedValue thisObject(scope, scope.engine->currentStackFrame->thisObject()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | return executed 528709 times by 7 tests: function->call(thisObject, nullptr, 0, ctx);return function->call(thisObject, nullptr, 0, ctx);Executed by:
executed 528709 times by 7 tests: return function->call(thisObject, nullptr, 0, ctx);Executed by:
| 528709 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | ReturnedValue EvalFunction::virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | return executed 64 times by 1 test: static_cast<const EvalFunction *>(f)->evalCall(thisObject, argv, argc, false);return static_cast<const EvalFunction *>(f)->evalCall(thisObject, argv, argc, false);Executed by:
executed 64 times by 1 test: return static_cast<const EvalFunction *>(f)->evalCall(thisObject, argv, argc, false);Executed by:
| 64 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | static inline int toInt(const QChar &qc, int R) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | ushort c = qc.unicode(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | int v = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | if (c >= '0'
| 744-806000 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | v = c - '0'; executed 271464 times by 2 tests: v = c - '0';Executed by:
| 271464 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | else if (c >= 'A'
| 772-534508 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | v = c - 'A' + 10; executed 267396 times by 1 test: v = c - 'A' + 10;Executed by:
| 267396 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | else if (c >= 'a'
| 800-267084 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | v = c - 'a' + 10; executed 5496 times by 1 test: v = c - 'a' + 10;Executed by:
| 5496 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | if (v >= 0
| 356-544356 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | return executed 544000 times by 2 tests: v;return v;Executed by:
executed 544000 times by 2 tests: return v;Executed by:
| 544000 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | return executed 262744 times by 2 tests: -1;return -1;Executed by:
executed 262744 times by 2 tests: return -1;Executed by:
| 262744 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | ReturnedValue 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()
| 812-266664 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | QString trimmed = inputString->toQString().trimmed(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | do { if (scope.hasException()
executed 16 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 16 times by 1 test: } } while (false);return QV4::Encode::undefined();Executed by:
| 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
| 108-267352 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | if (*
| 972-266380 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | sign = -1; executed 972 times by 1 test: sign = -1;Executed by:
| 972 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | if (*
| 700-266380 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | ++ executed 1672 times by 1 test: pos;++pos;Executed by:
executed 1672 times by 1 test: ++pos;Executed by:
| 1672 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | } executed 267352 times by 2 tests: end of blockExecuted by:
| 267352 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | bool stripPrefix = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | if (R
| 996-266464 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | if (R < 2
| 52-266408 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | return executed 108 times by 1 test: QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
executed 108 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
| 108 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | if (R != 16
| 328-266028 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | stripPrefix = false; executed 266028 times by 1 test: stripPrefix = false;Executed by:
| 266028 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | } executed 266356 times by 1 test: else {end of blockExecuted by:
| 266356 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | R = 10; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } executed 996 times by 2 tests: end of blockExecuted by:
| 996 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | if (stripPrefix
| 1324-266028 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | if ((
| 504-820 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | && (
| 228-276 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | && (pos[1] == QLatin1Char('x')
| 4-140 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | pos += 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | R = 16; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | } executed 224 times by 1 test: end of blockExecuted by:
| 224 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | } executed 1324 times by 2 tests: end of blockExecuted by:
| 1324 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | if (pos == end
| 108-267244 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | return executed 108 times by 1 test: QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
executed 108 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
| 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
| 220-267024 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | return executed 220 times by 1 test: QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
executed 220 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
| 220 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | qint64 v = d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | while (pos != end
| 4500-539500 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | d = toInt(*pos++, R); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | if (d == -1
| 262524-276976 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | break; executed 262524 times by 2 tests: break;Executed by:
| 262524 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | if (overflow
| 44-276932 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | if (overflow_digit_count == 0
| 20-24 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | v_overflow = v; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | v = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | ++overflow_digit_count; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | v = v * R + d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | } executed 44 times by 1 test: else {end of blockExecuted by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | qint64 vNew = v * R + d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | if (vNew < v
| 20-276912 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | overflow = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | --pos; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | } executed 20 times by 1 test: else {end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | v = vNew; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | } executed 276912 times by 2 tests: end of blockExecuted by:
| 276912 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | if (overflow
| 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: QV4::Encode(Encode(sign * result));return QV4::Encode(Encode(sign * result));Executed by:
executed 20 times by 1 test: return QV4::Encode(Encode(sign * result));Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | return executed 267004 times by 2 tests: QV4::Encode(Encode(sign * (double) v));return QV4::Encode(Encode(sign * (double) v));Executed by:
executed 267004 times by 2 tests: return QV4::Encode(Encode(sign * (double) v));Executed by:
| 267004 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | ReturnedValue 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()
executed 8 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 8 times by 1 test: } } while (false);return QV4::Encode::undefined();Executed by:
| 8-263152 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | QString trimmed = inputString->toQString().trimmed(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | if (trimmed.startsWith(QLatin1String("Infinity"))
| 40-263112 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | || trimmed.startsWith(QLatin1String("+Infinity"))
| 4-263108 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | return executed 44 times by 1 test: QV4::Encode(Encode((::qInf())));return QV4::Encode(Encode((::qInf())));Executed by:
executed 44 times by 1 test: return QV4::Encode(Encode((::qInf())));Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | if (trimmed.startsWith(QLatin1String("-Infinity"))
| 4-263104 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | return executed 4 times by 1 test: QV4::Encode(Encode(-(::qInf())));return QV4::Encode(Encode(-(::qInf())));Executed by:
executed 4 times by 1 test: return QV4::Encode(Encode(-(::qInf())));Executed by:
| 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
| 212-262891 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | return executed 212 times by 1 test: QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
executed 212 times by 1 test: return QV4::Encode(Encode(std::numeric_limits<double>::quiet_NaN()));Executed by:
| 212 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | return executed 262892 times by 1 test: QV4::Encode(Encode(d));return QV4::Encode(Encode(d));Executed by:
executed 262892 times by 1 test: return QV4::Encode(Encode(d));Executed by:
| 262892 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | ReturnedValue GlobalFunctions::method_isNaN(const FunctionObject *, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | if (!argc
| 4-2074 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | return executed 4 times by 1 test: QV4::Encode(Encode(true));return QV4::Encode(Encode(true));Executed by:
executed 4 times by 1 test: return QV4::Encode(Encode(true));Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | if (argv[0].integerCompatible()
| 182-1892 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | return executed 182 times by 2 tests: QV4::Encode(Encode(false));return QV4::Encode(Encode(false));Executed by:
executed 182 times by 2 tests: return QV4::Encode(Encode(false));Executed by:
| 182 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | double d = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | return executed 1892 times by 4 tests: QV4::Encode(Encode((bool)std::isnan(d)));return QV4::Encode(Encode((bool)std::isnan(d)));Executed by:
executed 1892 times by 4 tests: return QV4::Encode(Encode((bool)std::isnan(d)));Executed by:
| 1892 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | ReturnedValue GlobalFunctions::method_isFinite(const FunctionObject *, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | if (!argc
| 4-174 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | return executed 4 times by 1 test: QV4::Encode(Encode(false));return QV4::Encode(Encode(false));Executed by:
executed 4 times by 1 test: return QV4::Encode(Encode(false));Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | if (argv[0].integerCompatible()
| 24-150 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | return executed 24 times by 1 test: QV4::Encode(Encode(true));return QV4::Encode(Encode(true));Executed by:
executed 24 times by 1 test: return QV4::Encode(Encode(true));Executed by:
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | double d = argv[0].toNumber(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | return executed 150 times by 2 tests: QV4::Encode(Encode((bool)std::isfinite(d)));return QV4::Encode(Encode((bool)std::isfinite(d)));Executed by:
executed 150 times by 2 tests: return QV4::Encode(Encode((bool)std::isfinite(d)));Executed by:
| 150 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | ReturnedValue GlobalFunctions::method_decodeURI(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | if (argc == 0
| 0-6545862 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | return never executed: QV4::Encode::undefined();return 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
| 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: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 2065233 times by 1 test: }())));return qstring_literal_temp;Executed by:
| 2065233 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | return executed 2065227 times by 1 test: QV4::Encode(scope.engine->throwURIError(s));return QV4::Encode(scope.engine->throwURIError(s));Executed by:
executed 2065227 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));Executed by:
| 2065227 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | return executed 4445724 times by 1 test: QV4::Encode(v4->newString(out));return QV4::Encode(v4->newString(out));Executed by:
executed 4445724 times by 1 test: return QV4::Encode(v4->newString(out));Executed by:
| 4445724 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | ReturnedValue GlobalFunctions::method_decodeURIComponent(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | if (argc == 0
| 0-6589277 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | return never executed: QV4::Encode::undefined();return 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
| 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: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 2104002 times by 1 test: }())));return qstring_literal_temp;Executed by:
| 2104002 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | return executed 2110048 times by 1 test: QV4::Encode(scope.engine->throwURIError(s));return QV4::Encode(scope.engine->throwURIError(s));Executed by:
executed 2110048 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));Executed by:
| 2110048 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | return executed 4447441 times by 1 test: QV4::Encode(v4->newString(out));return QV4::Encode(v4->newString(out));Executed by:
executed 4447441 times by 1 test: return QV4::Encode(v4->newString(out));Executed by:
| 4447441 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | ReturnedValue GlobalFunctions::method_encodeURI(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | if (argc == 0
| 0-323557 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | return never executed: QV4::Encode::undefined();return 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
| 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: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 45053 times by 1 test: }())));return qstring_literal_temp;Executed by:
| 45053 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | return executed 45055 times by 1 test: QV4::Encode(scope.engine->throwURIError(s));return QV4::Encode(scope.engine->throwURIError(s));Executed by:
executed 45055 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));Executed by:
| 45055 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | return executed 278562 times by 1 test: QV4::Encode(v4->newString(out));return QV4::Encode(v4->newString(out));Executed by:
executed 278562 times by 1 test: return QV4::Encode(v4->newString(out));Executed by:
| 278562 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | ReturnedValue GlobalFunctions::method_encodeURIComponent(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | if (argc == 0
| 0-323396 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | return never executed: QV4::Encode::undefined();return 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
| 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: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 45056 times by 1 test: }())));return qstring_literal_temp;Executed by:
| 45056 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | return executed 45056 times by 1 test: QV4::Encode(scope.engine->throwURIError(s));return QV4::Encode(scope.engine->throwURIError(s));Executed by:
executed 45056 times by 1 test: return QV4::Encode(scope.engine->throwURIError(s));Executed by:
| 45056 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | return executed 277375 times by 2 tests: QV4::Encode(v4->newString(out));return QV4::Encode(v4->newString(out));Executed by:
executed 277375 times by 2 tests: return QV4::Encode(v4->newString(out));Executed by:
| 277375 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | ReturnedValue GlobalFunctions::method_escape(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | ExecutionEngine *v4 = b->engine(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | if (!argc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | return never executed: 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); returnreturn 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; }())));never executed: qstring_literal_temp;return 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: QV4::Encode(v4->newString(escape(str)));return QV4::Encode(v4->newString(escape(str)));never executed: return QV4::Encode(v4->newString(escape(str))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | ReturnedValue GlobalFunctions::method_unescape(const FunctionObject *b, const Value *, const Value *argv, int argc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | ExecutionEngine *v4 = b->engine(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | if (!argc
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | return never executed: 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); returnreturn 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; }())));never executed: qstring_literal_temp;return 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: QV4::Encode(v4->newString(unescape(str)));return QV4::Encode(v4->newString(unescape(str)));never executed: return QV4::Encode(v4->newString(unescape(str))); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |