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
2 changes: 1 addition & 1 deletion crates/oxc_parser/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub fn unterminated_string(span: Span) -> OxcDiagnostic {

#[cold]
pub fn reg_exp_flag(x0: char, span1: Span) -> OxcDiagnostic {
OxcDiagnostic::error(format!("Unexpected flag {x0} in regular expression literal"))
ts_error("1499", format!("Unexpected flag {x0} in regular expression literal"))
.with_label(span1)
.with_help(format!("The allowed flags are `{REGEXP_FLAGS_LIST}`"))
}
Expand Down
2 changes: 1 addition & 1 deletion tasks/coverage/snapshots/parser_test262.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23220,7 +23220,7 @@ Negative Passed: 4581/4581 (100.00%)
╰────
help: Valid modifiers are: i, m, s

× Unexpected flag G in regular expression literal
× TS(1499): Unexpected flag G in regular expression literal
╭─[test262/test/language/literals/regexp/early-err-bad-flag.js:19:4]
18 │
19 │ /./G;
Expand Down
16 changes: 8 additions & 8 deletions tasks/coverage/snapshots/parser_typescript.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9993,7 +9993,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: Valid group names are: foo

× Unexpected flag a in regular expression literal
× TS(1499): Unexpected flag a in regular expression literal
╭─[typescript/tests/cases/compiler/regularExpressionScanning.ts:3:11]
2 │ // Flags
3 │ /foo/visualstudiocode,
Expand All @@ -10002,7 +10002,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: The allowed flags are `gimsuydv`

× Unexpected flag l in regular expression literal
× TS(1499): Unexpected flag l in regular expression literal
╭─[typescript/tests/cases/compiler/regularExpressionScanning.ts:3:12]
2 │ // Flags
3 │ /foo/visualstudiocode,
Expand All @@ -10020,7 +10020,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: Remove the duplicated flag here

× Unexpected flag t in regular expression literal
× TS(1499): Unexpected flag t in regular expression literal
╭─[typescript/tests/cases/compiler/regularExpressionScanning.ts:3:14]
2 │ // Flags
3 │ /foo/visualstudiocode,
Expand All @@ -10047,7 +10047,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: Remove the duplicated flag here

× Unexpected flag o in regular expression literal
× TS(1499): Unexpected flag o in regular expression literal
╭─[typescript/tests/cases/compiler/regularExpressionScanning.ts:3:18]
2 │ // Flags
3 │ /foo/visualstudiocode,
Expand All @@ -10056,7 +10056,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: The allowed flags are `gimsuydv`

× Unexpected flag c in regular expression literal
× TS(1499): Unexpected flag c in regular expression literal
╭─[typescript/tests/cases/compiler/regularExpressionScanning.ts:3:19]
2 │ // Flags
3 │ /foo/visualstudiocode,
Expand All @@ -10065,7 +10065,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: The allowed flags are `gimsuydv`

× Unexpected flag o in regular expression literal
× TS(1499): Unexpected flag o in regular expression literal
╭─[typescript/tests/cases/compiler/regularExpressionScanning.ts:3:20]
2 │ // Flags
3 │ /foo/visualstudiocode,
Expand All @@ -10083,7 +10083,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: Remove the duplicated flag here

× Unexpected flag e in regular expression literal
× TS(1499): Unexpected flag e in regular expression literal
╭─[typescript/tests/cases/compiler/regularExpressionScanning.ts:3:22]
2 │ // Flags
3 │ /foo/visualstudiocode,
Expand Down Expand Up @@ -23009,7 +23009,7 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/Va
╰────
help: Try inserting a semicolon here

× Unexpected flag a in regular expression literal
× TS(1499): Unexpected flag a in regular expression literal
╭─[typescript/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity3.ts:1:16]
1 │ if (1) /regexp/a.foo();
· ─
Expand Down
Loading