Skip to content

Commit

Permalink
fix: stricter rest element check (#13715)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Aug 31, 2021
1 parent fdfe978 commit 6436733
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/babel-types/src/definitions/core.ts
Expand Up @@ -898,7 +898,12 @@ defineType("RestElement", {
argument: {
validate: !process.env.BABEL_TYPES_8_BREAKING
? assertNodeType("LVal")
: assertNodeType("Identifier", "Pattern", "MemberExpression"),
: assertNodeType(
"Identifier",
"ArrayPattern",
"ObjectPattern",
"MemberExpression",
),
},
// For Flow
optional: {
Expand Down

0 comments on commit 6436733

Please sign in to comment.