mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Allow assignment expressions as destructuring assignment target
This commit is contained in:
@@ -6441,6 +6441,10 @@ module ts {
|
||||
}
|
||||
|
||||
function checkDestructuringAssignment(target: Expression, sourceType: Type, contextualMapper?: TypeMapper): Type {
|
||||
if (target.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>target).operator === SyntaxKind.EqualsToken) {
|
||||
checkBinaryExpression(<BinaryExpression>target, contextualMapper);
|
||||
target = (<BinaryExpression>target).left;
|
||||
}
|
||||
if (target.kind === SyntaxKind.ObjectLiteral) {
|
||||
return checkObjectLiteralAssignment(<ObjectLiteral>target, sourceType, contextualMapper);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user