Don't insert the same node into the AST multiple times (fixes babel/babili#556) (#6054)
This commit is contained in:
@@ -73,7 +73,11 @@ export default function() {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
path.replaceWith(remap);
|
||||
path.replaceWith(
|
||||
// Clone the node before inserting it to ensure that different nodes in the AST are represented
|
||||
// by different objects.
|
||||
t.cloneWithoutLoc(remap),
|
||||
);
|
||||
}
|
||||
this.requeueInParent(path);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user