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

This commit is contained in:
Andy authored and GitHub committed 2018-08-07 12:13:45 -07:00
1 parent 32e99ba8f9
commit eaf0d59d35
6 files changed
+95 -1

No files matched your search

+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;
}