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
If a regular expression literal is statically known, we can check accessed capture groups of the match result.
constr1=/(.)(.)/;constm1=r1.exec(someString)!;console.log(m1[0],// always validm1[1],// allowedm1[2],// allowedm1[3],// not allowedm1.groups,// not allowed);constr2=/(?<foo>.)/;constm2=re.exec(someString)!;console.log(m2[0],// always validm2[1],// not allowedm2.groups!.foo,// allowedm2.groups.bar,// not allowed);
This may need control flow analysis to reliably tell where the match result came from and if the regular expression is a known literal.
If a regular expression literal is statically known, we can check accessed capture groups of the match result.
This may need control flow analysis to reliably tell where the match result came from and if the regular expression is a known literal.
Upstream feature request: microsoft/TypeScript#32098
The text was updated successfully, but these errors were encountered: