Skip to content

Commit

Permalink
Always enable unicodeSetsFlag parsing (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Sep 23, 2023
1 parent fa70523 commit c2236ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rewrite-pattern.js
Expand Up @@ -773,13 +773,13 @@ const validateOptions = (options) => {
case 'dotAllFlag':
case 'unicodeFlag':
case 'unicodePropertyEscapes':
case 'unicodeSetsFlag':
case 'namedGroups':
if (value != null && value !== false && value !== 'transform') {
throw new Error(`.${key} must be false (default) or 'transform'.`);
}
break;
case 'modifiers':
case 'unicodeSetsFlag':
if (value != null && value !== false && value !== 'parse' && value !== 'transform') {
throw new Error(`.${key} must be false (default), 'parse' or 'transform'.`);
}
Expand Down Expand Up @@ -824,11 +824,11 @@ const rewritePattern = (pattern, flags, options) => {
config.modifiersData.m = undefined;

const regjsparserFeatures = {
'unicodeSet': Boolean(options && options.unicodeSetsFlag),
'modifiers': Boolean(options && options.modifiers),

// Enable every stable RegExp feature by default
'unicodePropertyEscape': true,
'unicodeSet': true,
'namedGroups': true,
'lookbehind': true,
};
Expand Down

0 comments on commit c2236ab

Please sign in to comment.