Skip to content

Commit e65f9b7

Browse files
Revert "JavaScript - add explicit error when cursor.parentTree is not a funct…" (#6344)
This reverts commit accb797.
1 parent ac3e68e commit e65f9b7

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

  • rewrite-javascript/rewrite/src/javascript/templating

rewrite-javascript/rewrite/src/javascript/templating/engine.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,6 @@ export class TemplateApplier {
699699
}
700700

701701
private wrapTree(originalTree: J, resultToUse: J) {
702-
if (this.cursor && (!("parentTree" in this.cursor) || typeof this.cursor?.parentTree !== "function")) {
703-
throw new Error("Wrong cursor: " + JSON.stringify(this.cursor) + " when visiting " + JSON.stringify(originalTree));
704-
}
705702
const parentTree = this.cursor?.parentTree()?.value;
706703

707704
// Only apply wrapping logic if we have parent context

0 commit comments

Comments
 (0)