Also check AssignmentPatterns for export name (#9521)
This commit is contained in:
@@ -1816,7 +1816,9 @@ export default class StatementParser extends ExpressionParser {
|
||||
}
|
||||
|
||||
checkDeclaration(node: N.Pattern | N.ObjectProperty): void {
|
||||
if (node.type === "ObjectPattern") {
|
||||
if (node.type === "Identifier") {
|
||||
this.checkDuplicateExports(node, node.name);
|
||||
} else if (node.type === "ObjectPattern") {
|
||||
for (const prop of node.properties) {
|
||||
this.checkDeclaration(prop);
|
||||
}
|
||||
@@ -1830,8 +1832,8 @@ export default class StatementParser extends ExpressionParser {
|
||||
this.checkDeclaration(node.value);
|
||||
} else if (node.type === "RestElement") {
|
||||
this.checkDeclaration(node.argument);
|
||||
} else if (node.type === "Identifier") {
|
||||
this.checkDuplicateExports(node, node.name);
|
||||
} else if (node.type === "AssignmentPattern") {
|
||||
this.checkDeclaration(node.left);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user