Skip to content

Commit

Permalink
remove regexpUnicodeSets parser plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed May 17, 2023
1 parent c5f68eb commit 8b00ad1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
20 changes: 10 additions & 10 deletions packages/babel-core/src/parser/util/missing-plugin-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ const pluginNameMap: Record<
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple",
},
},
regexpUnicodeSets: {
syntax: {
name: "@babel/plugin-syntax-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md",
},
transform: {
name: "@babel/plugin-proposal-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md",
},
},
throwExpressions: {
syntax: {
name: "@babel/plugin-syntax-throw-expressions",
Expand Down Expand Up @@ -289,6 +279,16 @@ if (!process.env.BABEL_8_BREAKING) {
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-private-property-in-object",
},
},
regexpUnicodeSets: {
syntax: {
name: "@babel/plugin-syntax-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md",
},
transform: {
name: "@babel/plugin-proposal-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md",
},
},
});
}

Expand Down
3 changes: 0 additions & 3 deletions packages/babel-parser/src/tokenizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const VALID_REGEX_FLAGS = new Set([
charCodes.lowercaseY,
charCodes.lowercaseU,
charCodes.lowercaseD,
// This is only valid when using the regexpUnicodeSets plugin
charCodes.lowercaseV,
]);

Expand Down Expand Up @@ -1100,8 +1099,6 @@ export default abstract class Tokenizer extends CommentsParser {
// @ts-expect-error VALID_REGEX_FLAGS.has should accept expanded type: number
if (VALID_REGEX_FLAGS.has(cp)) {
if (cp === charCodes.lowercaseV) {
this.expectPlugin("regexpUnicodeSets", nextPos());

if (mods.includes("u")) {
this.raise(Errors.IncompatibleRegExpUVFlags, { at: nextPos() });
}
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type Plugin =
| "partialApplication"
| "placeholders"
| "privateIn" // Enabled by default
| "regexpUnicodeSets"
| "regexpUnicodeSets" // Enabled by default
| "throwExpressions"
| "topLevelAwait"
| "v8intrinsic"
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/babel-parser/typings/babel-parser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Plugin =
| "partialApplication"
| "placeholders"
| "privateIn" // Enabled by default
| "regexpUnicodeSets"
| "regexpUnicodeSets" // Enabled by default
| "throwExpressions"
| "topLevelAwait"
| "v8intrinsic"
Expand Down

0 comments on commit 8b00ad1

Please sign in to comment.