fix: stricter rest element check (#13715)

This commit is contained in:
Huáng Jùnliàng 2021-08-31 09:31:21 -04:00 committed by GitHub
parent fdfe97879e
commit 6436733d7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: {