Skip to content

Commit

Permalink
updated test262.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Bellard committed May 30, 2024
1 parent adec734 commit d86aaf0
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions tests/test262.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/harness/atomicsHelper.js b/harness/atomicsHelper.js
index 9c1217351e..3c24755558 100644
index 9828b15..4a5919d 100644
--- a/harness/atomicsHelper.js
+++ b/harness/atomicsHelper.js
@@ -227,10 +227,14 @@ $262.agent.waitUntil = function(typedArray, index, expected) {
@@ -272,10 +272,14 @@ $262.agent.waitUntil = function(typedArray, index, expected) {
* }
*/
$262.agent.timeouts = {
Expand All @@ -22,13 +22,13 @@ index 9c1217351e..3c24755558 100644

/**
diff --git a/harness/regExpUtils.js b/harness/regExpUtils.js
index be7039fda0..7b38abf8df 100644
index b55f3c6..396bad4 100644
--- a/harness/regExpUtils.js
+++ b/harness/regExpUtils.js
@@ -6,24 +6,27 @@ description: |
defines: [buildString, testPropertyEscapes, matchValidator]
@@ -6,27 +6,30 @@ description: |
defines: [buildString, testPropertyEscapes, testPropertyOfStrings, testExtendedCharacterClass, matchValidator]
---*/

+if ($262 && typeof $262.codePointRange === "function") {
+ /* use C function to build the codePointRange (much faster with
+ slow JS engines) */
Expand All @@ -44,7 +44,12 @@ index be7039fda0..7b38abf8df 100644
+ }
+}
+
function buildString({ loneCodePoints, ranges }) {
function buildString(args) {
// Use member expressions rather than destructuring `args` for improved
// compatibility with engines that only implement assignment patterns
// partially or not at all.
const loneCodePoints = args.loneCodePoints;
const ranges = args.ranges;
- const CHUNK_SIZE = 10000;
- let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
- for (let i = 0; i < ranges.length; i++) {
Expand All @@ -58,14 +63,11 @@ index be7039fda0..7b38abf8df 100644
- result += Reflect.apply(String.fromCodePoint, null, codePoints);
- codePoints.length = length = 0;
- }
+ let result = String.fromCodePoint.apply(null, loneCodePoints);
+ for (const [start, end] of ranges) {
+ result += codePointRange(start, end + 1);
}
- }
- result += Reflect.apply(String.fromCodePoint, null, codePoints);
- }
- return result;
+ return result;
+ let result = String.fromCodePoint.apply(null, loneCodePoints);
+ for (const [start, end] of ranges) {
+ result += codePointRange(start, end + 1);
}
return result;
}

function testPropertyEscapes(regex, string, expression) {

0 comments on commit d86aaf0

Please sign in to comment.