mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Allow assignment expressions as destructuring assignment target
This commit is contained in:
parent
501a3704f9
commit
3ff2a62892
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user