mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Don't use function argument destructuring in regExpUtils.js (#3000)
This increases compatibility with less advanced engines that only have partial support for recent language features like assignment patterns.
This commit is contained in:
parent
1ebd34b53b
commit
10fc95cacb
@ -6,7 +6,12 @@ description: |
|
|||||||
defines: [buildString, testPropertyEscapes, matchValidator]
|
defines: [buildString, testPropertyEscapes, matchValidator]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
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;
|
const CHUNK_SIZE = 10000;
|
||||||
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
|
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
|
||||||
for (let i = 0; i < ranges.length; i++) {
|
for (let i = 0; i < ranges.length; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user