Fix crash in JS when checking destructuring shorthand assignment (#25529)

This commit is contained in:
Nathan Shively-Sanders
2018-07-10 08:32:56 -07:00
committed by GitHub
parent b3b6c3bdbc
commit 60c0dfeb25
5 changed files with 47 additions and 1 deletions

View File

@@ -21128,7 +21128,7 @@ namespace ts {
getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], UnionReduction.Subtype) :
leftType;
case SyntaxKind.EqualsToken:
const special = getSpecialPropertyAssignmentKind(left.parent as BinaryExpression);
const special = isBinaryExpression(left.parent) ? getSpecialPropertyAssignmentKind(left.parent) : SpecialPropertyAssignmentKind.None;
checkSpecialAssignment(special, right);
if (isJSSpecialPropertyAssignment(special)) {
return leftType;