Disallow duplicated AST nodes (#11807)
This commit is contained in:
@@ -30,7 +30,7 @@ const buildOptimizedSequenceExpression = ({ assign, call, path }) => {
|
||||
|
||||
call.callee = evalSequence;
|
||||
|
||||
path.scope.push({ id: placeholderNode });
|
||||
path.scope.push({ id: t.cloneNode(placeholderNode) });
|
||||
|
||||
return t.sequenceExpression([assign, call]);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ const buildOptimizedSequenceExpression = ({ assign, call, path }) => {
|
||||
return t.sequenceExpression([pipelineLeft, calledExpression.body]);
|
||||
}
|
||||
|
||||
path.scope.push({ id: placeholderNode });
|
||||
path.scope.push({ id: t.cloneNode(placeholderNode) });
|
||||
|
||||
if (param) {
|
||||
path.get("right").scope.rename(param.name, placeholderNode.name);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { types as t } from "@babel/core";
|
||||
|
||||
const updateTopicReferenceVisitor = {
|
||||
PipelinePrimaryTopicReference(path) {
|
||||
path.replaceWith(this.topicId);
|
||||
path.replaceWith(t.cloneNode(this.topicId));
|
||||
},
|
||||
PipelineTopicExpression(path) {
|
||||
path.skip();
|
||||
|
||||
Reference in New Issue
Block a user