helper-module-transforms: dereference imported template tag (#10934)
* Dereference imported template tag * apply fix for OptionalCallExpression as well
This commit is contained in:
committed by
Huáng Jùnliàng
parent
e9dc74e787
commit
b91720c1cc
@@ -182,7 +182,9 @@ const rewriteReferencesVisitor = {
|
||||
ref.loc = path.node.loc;
|
||||
|
||||
if (
|
||||
path.parentPath.isCallExpression({ callee: path.node }) &&
|
||||
(path.parentPath.isCallExpression({ callee: path.node }) ||
|
||||
path.parentPath.isOptionalCallExpression({ callee: path.node }) ||
|
||||
path.parentPath.isTaggedTemplateExpression({ tag: path.node })) &&
|
||||
t.isMemberExpression(ref)
|
||||
) {
|
||||
path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref]));
|
||||
|
||||
Reference in New Issue
Block a user