Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/oxc_regular_expression/src/ast_impl/support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ fn term_contains_unsupported(mut term: &Term, unsupported: &RegexUnsupportedPatt
// Loop because `Term::Quantifier` contains a nested `Term`
loop {
match term {
Term::CapturingGroup(_) => return unsupported.named_capture_groups,
Term::CapturingGroup(group) => {
return group.name.is_some() && unsupported.named_capture_groups;
}
Term::UnicodePropertyEscape(_) => return unsupported.unicode_property_escapes,
Term::CharacterClass(character_class) => {
return unsupported.unicode_property_escapes
Expand Down
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/semantic_typescript.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5918,8 +5918,8 @@ Reference symbol mismatch for "require":
after transform: SymbolId(0) "require"
rebuilt : <None>
Unresolved references mismatch:
after transform: ["Error", "JSON", "RegExp"]
rebuilt : ["Error", "JSON", "RegExp", "require"]
after transform: ["Error", "JSON"]
rebuilt : ["Error", "JSON", "require"]

semantic Error: tasks/coverage/typescript/tests/cases/compiler/controlFlowUnionContainingTypeParameter1.ts
Unresolved references mismatch:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ a1 = /a.b/s
// RegExpLookbehindAssertions
b1 = /(?<!x)/
b2 = /(?<=x)/
b3 = /((?<!x)){2}/
b4 = /((?<=x)){3}/
b3 = /((?<!x)){2}/ // FIXME(sapphi-red): will be fixed in the next PR
b4 = /((?<=x)){3}/ // FIXME(sapphi-red): will be fixed in the next PR
// RegExpNamedCaptureGroups
c1 = /(?<a>b)/
c2 = /((?<c>d)){4}/;
c2 = /((?<c>d)){4}/; // FIXME(sapphi-red): will be fixed in the next PR
// RegExpUnicodePropertyEscapes
d1 = /\p{Emoji}/u
// ES2022
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ x2 = new RegExp(".", "u");
a1 = new RegExp("a.b", "s");
b1 = new RegExp("(?<!x)", "");
b2 = new RegExp("(?<=x)", "");
b3 = new RegExp("((?<!x)){2}", "");
b4 = new RegExp("((?<=x)){3}", "");
b3 = /((?<!x)){2}/;
b4 = /((?<=x)){3}/;
c1 = new RegExp("(?<a>b)", "");
c2 = new RegExp("((?<c>d)){4}", "");
c2 = /((?<c>d)){4}/;
d1 = new RegExp("\\p{Emoji}", "u");
f1 = new RegExp("y", "d");
g1 = new RegExp("[\\p{White_Space}&&\\p{ASCII}]", "v");
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
c1 = /(?<a>b)/
c2 = /((?<a>b)){2}/
c2 = /((?<a>b)){2}/ // FIXME(sapphi-red): will be fixed in the next PR

n1 = /(a)/
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
c1 = new RegExp("(?<a>b)", "");
c2 = new RegExp("((?<a>b)){2}", "");
c2 = /((?<a>b)){2}/;

n1 = /(a)/;
Loading