You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/rules/no-control-regex.js
+15-2Lines changed: 15 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,16 @@ const collector = new (class {
14
14
}
15
15
16
16
onPatternEnter(){
17
+
18
+
/*
19
+
* `RegExpValidator` may parse the pattern twice in one `validatePattern`.
20
+
* So `this._controlChars` should be cleared here as well.
21
+
*
22
+
* For example, the `/(?<a>\x1f)/` regex will parse the pattern twice.
23
+
* This is based on the content described in Annex B.
24
+
* If the regex contains a `GroupName` and the `u` flag is not used, `ParseText` will be called twice.
25
+
* See https://tc39.es/ecma262/2023/multipage/additional-ecmascript-features-for-web-browsers.html#sec-parsepattern-annexb
26
+
*/
17
27
this._controlChars=[];
18
28
}
19
29
@@ -32,10 +42,13 @@ const collector = new (class {
0 commit comments