Skip to content

Commit

Permalink
add: supersede Fixes for RegEx features implemented in PM 32
Browse files Browse the repository at this point in the history
  • Loading branch information
martok committed Jan 24, 2023
1 parent 2684c5a commit 1165299
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ function supersededFixes(service) {
if (service.isNullishCoalescingSupported) {
superseded.add("gh-script-optchain");
}
if (service.isNamedCapturingGroupSupported) {
superseded.add("gl-script");
superseded.add("mm-regexp");
superseded.add("reddit-comments-regexp");
}
if (service.isPropertyEscapeSupported) {
superseded.add("duolingo-regexp");
superseded.add("gh-regexp");
superseded.add("google-regexp");
superseded.add("notion-regexp");
}
return superseded;
}

Expand Down Expand Up @@ -613,6 +624,7 @@ class PolyfillService {
this.isOptionalChainingSupported = this._checkSyntax("foo?.bar");
this.isNullishCoalescingSupported = this._checkSyntax("foo??bar");
this.isNamedCapturingGroupSupported = this._checkSyntax("/(?<Name>x)/");
this.isPropertyEscapeSupported = this._checkSyntax("/\\p{L}/u");
this.fixCache = new Map();
this.rules = new RuleEngine();
this.exclusion = new RuleEngine();
Expand Down

0 comments on commit 1165299

Please sign in to comment.