We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c126733 commit 03e2484Copy full SHA for 03e2484
packages/ts-morph/src/manipulation/nodeHandlers/RangeHandler.ts
@@ -56,7 +56,7 @@ export class RangeHandler implements NodeHandler {
56
newNodeChildren.next();
57
58
// handle the rest
59
- while (!currentNodeChildren.done)
+ while (!currentNodeChildren.done && !newNodeChildren.done)
60
this.straightReplace(currentNodeChildren.next(), newNodeChildren.next(), newSourceFile);
61
62
// ensure the new children iterator is done too
0 commit comments