Debian Codegraph @

quickjs/tests/test262.patch

raw
1 diff --git a/harness/atomicsHelper.js b/harness/atomicsHelper.js
2 index 9c1217351e..3c24755558 100644
3 --- a/harness/atomicsHelper.js
4 +++ b/harness/atomicsHelper.js
5 @@ -227,10 +227,14 @@ $262.agent.waitUntil = function(typedArray, index, expected) {
6 * }
7 */
8 $262.agent.timeouts = {
9 - yield: 100,
10 - small: 200,
11 - long: 1000,
12 - huge: 10000,
13 +// yield: 100,
14 +// small: 200,
15 +// long: 1000,
16 +// huge: 10000,
17 + yield: 20,
18 + small: 20,
19 + long: 100,
20 + huge: 1000,
21 };
22
23 /**
24 diff --git a/harness/regExpUtils.js b/harness/regExpUtils.js
25 index be7039fda0..7b38abf8df 100644
26 --- a/harness/regExpUtils.js
27 +++ b/harness/regExpUtils.js
28 @@ -6,24 +6,27 @@ description: |
29 defines: [buildString, testPropertyEscapes, matchValidator]
30 ---*/
31
32 +if ($262 && typeof $262.codePointRange === "function") {
33 + /* use C function to build the codePointRange (much faster with
34 + slow JS engines) */
35 + codePointRange = $262.codePointRange;
36 +} else {
37 + codePointRange = function codePointRange(start, end) {
38 + const codePoints = [];
39 + let length = 0;
40 + for (codePoint = start; codePoint < end; codePoint++) {
41 + codePoints[length++] = codePoint;
42 + }
43 + return String.fromCodePoint.apply(null, codePoints);
44 + }
45 +}
46 +
47 function buildString({ loneCodePoints, ranges }) {
48 - const CHUNK_SIZE = 10000;
49 - let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
50 - for (let i = 0; i < ranges.length; i++) {
51 - const range = ranges[i];
52 - const start = range[0];
53 - const end = range[1];
54 - const codePoints = [];
55 - for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
56 - codePoints[length++] = codePoint;
57 - if (length === CHUNK_SIZE) {
58 - result += Reflect.apply(String.fromCodePoint, null, codePoints);
59 - codePoints.length = length = 0;
60 - }
61 + let result = String.fromCodePoint.apply(null, loneCodePoints);
62 + for (const [start, end] of ranges) {
63 + result += codePointRange(start, end + 1);
64 }
65 - result += Reflect.apply(String.fromCodePoint, null, codePoints);
66 - }
67 - return result;
68 + return result;
69 }
70
71 function testPropertyEscapes(regex, string, expression) {