Skip to content

Commit

Permalink
Fix mozilla#533 AstNode.setParent() causes a position error
Browse files Browse the repository at this point in the history
  • Loading branch information
nabice committed Apr 23, 2019
1 parent 33ac813 commit 03c12c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/org/mozilla/javascript/ast/AstNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ public void setParent(AstNode parent) {

// Convert position back to absolute.
if (this.parent != null) {
setRelative(-this.parent.getPosition());
setRelative(-this.parent.getAbsolutePosition());
}

this.parent = parent;
if (parent != null) {
setRelative(parent.getPosition());
setRelative(parent.getAbsolutePosition());
}
}

Expand Down

0 comments on commit 03c12c2

Please sign in to comment.