Fix bug: symbol.valueDeclaration not guaranteed to be defined (#26267)

This commit is contained in:
Andy
2018-08-07 12:13:45 -07:00
committed by GitHub
parent 32e99ba8f9
commit eaf0d59d35
6 changed files with 95 additions and 1 deletions
+1 -1
View File
@@ -20861,7 +20861,7 @@ namespace ts {
// If func.parent is a class and symbol is a (readonly) property of that class, or
// if func is a constructor and symbol is a (readonly) parameter property declared in it,
// then symbol is writeable here.
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
return !symbol.valueDeclaration || !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
}
return true;
}