@@ -1686,119 +1686,6 @@ namespace ts {
1686
1686
return convertIterationStatementBodyIfNecessary ( node ) ;
1687
1687
}
1688
1688
1689
- // // TODO(rbuckton): Switch to using __values helper for for..of?
1690
- // function visitForOfStatement2(node: ForOfStatement): OneOrMany<Statement> {
1691
- // // [source]
1692
- // // for (let v of expr) {
1693
- // // }
1694
- // //
1695
- // // [output]
1696
- // // var __values = ...;
1697
- // // try {
1698
- // // for (_a = __values(expr), _b = _a.next(); !_b.done || (_a = void 0); _b = _a.next()) {
1699
- // // var v = _b.value;
1700
- // // }
1701
- // // }
1702
- // // finally {
1703
- // // if (_a && typeof _a.return === "function") _a.return();
1704
- // // }
1705
- // // var _a, b;
1706
-
1707
- // const iterator = createTempVariable();
1708
- // const iteratorResult = createTempVariable();
1709
- // hoistVariableDeclaration(iterator);
1710
- // hoistVariableDeclaration(iteratorResult);
1711
- // const expression = visitNode(node.expression, visitor, isExpression);
1712
- // const initializer = node.initializer;
1713
- // const statements: Statement[] = [];
1714
- // if (isVariableDeclarationList(initializer)) {
1715
- // const variable = getMutableClone(initializer.declarations[0]);
1716
- // variable.initializer = createPropertyAccess(iteratorResult, "value");
1717
- // statements.push(
1718
- // createVariableStatement(
1719
- // /*modifiers*/ undefined,
1720
- // createVariableDeclarationList(
1721
- // isBindingPattern(variable.name)
1722
- // ? flattenVariableDestructuring(variable, /*value*/ undefined, visitor)
1723
- // : [variable]
1724
- // )
1725
- // )
1726
- // );
1727
- // }
1728
- // else {
1729
- // statements.push(
1730
- // createStatement(
1731
- // createAssignment(
1732
- // <Expression>node.initializer,
1733
- // createPropertyAccess(iteratorResult, "value")
1734
- // )
1735
- // )
1736
- // );
1737
- // }
1738
-
1739
- // if (isBlock(node.statement)) {
1740
- // addNodes(statements, visitNodes((<Block>node.statement).statements, visitor, isStatement));
1741
- // }
1742
- // else {
1743
- // addNodes(statements, visitNodes(createNodeArray([node.statement]), visitor, isStatement));
1744
- // }
1745
-
1746
- // return createTryFinally(
1747
- // createBlock([
1748
- // createFor(
1749
- // createComma(
1750
- // createAssignment(
1751
- // iterator,
1752
- // createCall(
1753
- // createIdentifier("__values"),
1754
- // [expression]
1755
- // )
1756
- // ),
1757
- // createAssignment(
1758
- // iteratorResult,
1759
- // createCall(
1760
- // createPropertyAccess(iterator, "next"),
1761
- // []
1762
- // )
1763
- // )
1764
- // ),
1765
- // createLogicalOr(
1766
- // createLogicalNot(createPropertyAccess(iteratorResult, "done")),
1767
- // createAssignment(iterator, createVoidZero())
1768
- // ),
1769
- // createAssignment(
1770
- // iteratorResult,
1771
- // createCall(
1772
- // createPropertyAccess(iterator, "next"),
1773
- // []
1774
- // )
1775
- // ),
1776
- // createBlock(statements)
1777
- // )
1778
- // ]),
1779
- // createBlock([
1780
- // createIf(
1781
- // createLogicalAnd(
1782
- // iterator,
1783
- // createStrictEquality(
1784
- // createTypeOf(
1785
- // createPropertyAccess(iterator, "return")
1786
- // ),
1787
- // createLiteral("function")
1788
- // )
1789
- // ),
1790
- // createStatement(
1791
- // createCall(
1792
- // createPropertyAccess(iterator, "return"),
1793
- // [],
1794
- // /*location*/ node.expression
1795
- // )
1796
- // )
1797
- // )
1798
- // ])
1799
- // );
1800
- // }
1801
-
1802
1689
/**
1803
1690
* Visits a ForOfStatement and converts it into a compatible ForStatement.
1804
1691
*
0 commit comments