Filter undefined from binding elements with initialisers without undefined in the type (#38122)

* Filter undefined from binding elts w/o undefined-containing inits

* use getTypeOfInitializer instead

* improve comment based on Wesleys suggestion
This commit is contained in:
Nathan Shively-Sanders
2020-04-22 15:45:15 -07:00
committed by GitHub
parent ef83109dbf
commit 032aa90289
6 changed files with 22 additions and 3 deletions

View File

@@ -6,3 +6,4 @@ const fAnnotated: typeof fInferred = ({ a = 0 } = {}) => a;
declare var t: { s: string } | undefined;
const { s } = t;
function fst({ s } = t) { }