TypeScript/tests/cases/compiler/destructuringControlFlowNoCrash.ts
Orta Therox dd84bc1dc9
Handles creating a reasonable AST when destructuring into a parens'd expresssion (#40115)
* Handles creating a lgical AST when destructuring  into a parens

* Adds an async example
2020-10-05 14:12:47 -04:00

18 lines
323 B
TypeScript

// legal JS, if nonsensical, which also triggers the issue
const {
date,
} = (inspectedElement: any) => 0;
date.toISOString();
// Working flow code
const {
date2,
} = (inspectedElement: any).props;
date2.toISOString();
// It could also be an async function
const { constructor } = async () => {};