fix: exclude TemplateLiteral expression from isConstant

This commit is contained in:
zhiyuanzmj 2024-12-07 21:57:07 +08:00
parent 1d6003c043
commit f08cdcabfb

View File

@ -323,7 +323,7 @@ export const isConstant = (
isConstant((property as any).value) isConstant((property as any).value)
); );
} }
if (t.isLiteral(node)) { if (t.isLiteral(node) && !t.isTemplateLiteral(node)) {
return true; return true;
} }
return false; return false;