mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 16:04:36 +02:00
Make RegExp/CharacterClassEscapes tests faster across all engines
This commit is contained in:
parent
60b9467630
commit
8879820a8f
@ -7,17 +7,20 @@ description: |
|
|||||||
|
|
||||||
function buildString({ loneCodePoints, ranges }) {
|
function buildString({ loneCodePoints, ranges }) {
|
||||||
const CHUNK_SIZE = 10000;
|
const CHUNK_SIZE = 10000;
|
||||||
let result = String.fromCodePoint(...loneCodePoints);
|
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
|
||||||
for (const [start, end] of ranges) {
|
for (let i = 0; i < ranges.length; i++) {
|
||||||
|
const range = ranges[i];
|
||||||
|
const start = range[0];
|
||||||
|
const end = range[1];
|
||||||
const codePoints = [];
|
const codePoints = [];
|
||||||
for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
|
for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
|
||||||
codePoints[length++] = codePoint;
|
codePoints[length++] = codePoint;
|
||||||
if (length === CHUNK_SIZE) {
|
if (length === CHUNK_SIZE) {
|
||||||
result += String.fromCodePoint(...codePoints);
|
result += Reflect.apply(String.fromCodePoint, null, codePoints);
|
||||||
codePoints.length = length = 0;
|
codePoints.length = length = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += String.fromCodePoint(...codePoints);
|
result += Reflect.apply(String.fromCodePoint, null, codePoints);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\d/ug;
|
const re = /\d/ug;
|
||||||
const matchingRange = /[0-9]/ug;
|
const matchingRange = /[0-9]/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\d+/ug;
|
const re = /\d+/ug;
|
||||||
const matchingRange = /[0-9]+/ug;
|
const matchingRange = /[0-9]+/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\d+/g;
|
const re = /\d+/g;
|
||||||
const matchingRange = /[0-9]+/g;
|
const matchingRange = /[0-9]+/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\d/g;
|
const re = /\d/g;
|
||||||
const matchingRange = /[0-9]/g;
|
const matchingRange = /[0-9]/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\D/ug;
|
const re = /\D/ug;
|
||||||
const matchingRange = /[\0-\/:-\u{10FFFF}]/ug;
|
const matchingRange = /[\0-\/:-\u{10FFFF}]/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\D+/ug;
|
const re = /\D+/ug;
|
||||||
const matchingRange = /[\0-\/:-\u{10FFFF}]+/ug;
|
const matchingRange = /[\0-\/:-\u{10FFFF}]+/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\D+/g;
|
const re = /\D+/g;
|
||||||
const matchingRange = /[\0-\/:-\uFFFF]+/g;
|
const matchingRange = /[\0-\/:-\uFFFF]+/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\D/g;
|
const re = /\D/g;
|
||||||
const matchingRange = /[\0-\/:-\uFFFF]/g;
|
const matchingRange = /[\0-\/:-\uFFFF]/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\S/ug;
|
const re = /\S/ug;
|
||||||
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]/ug;
|
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\S+/ug;
|
const re = /\S+/ug;
|
||||||
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]+/ug;
|
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]+/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\S+/g;
|
const re = /\S+/g;
|
||||||
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]+/g;
|
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]+/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\S/g;
|
const re = /\S/g;
|
||||||
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]/g;
|
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\W/ug;
|
const re = /\W/ug;
|
||||||
const matchingRange = /[\0-\/:-@\[-\^`\{-\u{10FFFF}]/ug;
|
const matchingRange = /[\0-\/:-@\[-\^`\{-\u{10FFFF}]/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\W+/ug;
|
const re = /\W+/ug;
|
||||||
const matchingRange = /[\0-\/:-@\[-\^`\{-\u{10FFFF}]+/ug;
|
const matchingRange = /[\0-\/:-@\[-\^`\{-\u{10FFFF}]+/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\W+/g;
|
const re = /\W+/g;
|
||||||
const matchingRange = /[\0-\/:-@\[-\^`\{-\uFFFF]+/g;
|
const matchingRange = /[\0-\/:-@\[-\^`\{-\uFFFF]+/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\W/g;
|
const re = /\W/g;
|
||||||
const matchingRange = /[\0-\/:-@\[-\^`\{-\uFFFF]/g;
|
const matchingRange = /[\0-\/:-@\[-\^`\{-\uFFFF]/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\s/ug;
|
const re = /\s/ug;
|
||||||
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/ug;
|
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\s+/ug;
|
const re = /\s+/ug;
|
||||||
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/ug;
|
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\s+/g;
|
const re = /\s+/g;
|
||||||
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g;
|
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\s/g;
|
const re = /\s/g;
|
||||||
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/g;
|
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\w/ug;
|
const re = /\w/ug;
|
||||||
const matchingRange = /[0-9A-Z_a-z]/ug;
|
const matchingRange = /[0-9A-Z_a-z]/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
|
||||||
const totalChunks = Math.ceil(0x10ffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\w+/ug;
|
const re = /\w+/ug;
|
||||||
const matchingRange = /[0-9A-Z_a-z]+/ug;
|
const matchingRange = /[0-9A-Z_a-z]+/ug;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\w+/g;
|
const re = /\w+/g;
|
||||||
const matchingRange = /[0-9A-Z_a-z]+/g;
|
const matchingRange = /[0-9A-Z_a-z]+/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
@ -33,15 +33,10 @@ info: |
|
|||||||
The production CharacterClassEscape :: W evaluates as follows:
|
The production CharacterClassEscape :: W evaluates as follows:
|
||||||
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
|
||||||
features: [String.fromCodePoint]
|
features: [String.fromCodePoint]
|
||||||
|
includes: [regExpUtils.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const chunks = [];
|
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
|
||||||
const totalChunks = Math.ceil(0xffff / 0x10000);
|
|
||||||
|
|
||||||
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
|
|
||||||
// split strings to avoid a super long one;
|
|
||||||
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
const re = /\w/g;
|
const re = /\w/g;
|
||||||
const matchingRange = /[0-9A-Z_a-z]/g;
|
const matchingRange = /[0-9A-Z_a-z]/g;
|
||||||
@ -52,16 +47,14 @@ function matching(str) {
|
|||||||
return str.replace(re, '') === str.replace(matchingRange, '');
|
return str.replace(re, '') === str.replace(matchingRange, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const str of chunks) {
|
if (!matching(str)) {
|
||||||
if (!matching(str)) {
|
// Error, let's find out where
|
||||||
// Error, let's find out where
|
for (const char of str) {
|
||||||
for (const char of str) {
|
if (!matching(char)) {
|
||||||
if (!matching(char)) {
|
errors.push('0x' + char.codePointAt(0).toString(16));
|
||||||
errors.push('0x' + char.codePointAt(0).toString(16));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
errors.length,
|
errors.length,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user