mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-06 06:49:29 -05:00
committed by
Ryan Cavanaugh
parent
dc7c9bad3d
commit
b45df892a8
@@ -31186,6 +31186,13 @@ namespace ts {
|
||||
|
||||
for (const prop of node.properties) {
|
||||
if (prop.kind === SyntaxKind.SpreadAssignment) {
|
||||
if (inDestructuring) {
|
||||
// a rest property cannot be destructured any further
|
||||
const expression = skipParentheses(prop.expression);
|
||||
if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) {
|
||||
return grammarErrorOnNode(prop.expression, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
const name = prop.name;
|
||||
|
||||
Reference in New Issue
Block a user