Skip to content

Commit

Permalink
fix codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Feb 5, 2024
1 parent ae6debd commit 8910187
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/swc_ecma_quote_macros/src/ast/expr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use swc_ecma_ast::*;

impl_enum!(AssignTarget, [Simple, Pat]);
impl_enum!(AssignTarget, [Simple, Pat], true);
impl_enum!(
SimpleAssignTarget,
[
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_quote_macros/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ macro_rules! impl_enum {
($E:ident, [ $($v:ident),* ], true) => {
impl crate::ast::ToCode for $E {
fn to_code(&self, cx: &crate::ctxt::Ctx) -> syn::Expr {
if let Self::Ident(i) = self {
if let Some(i) = self.as_ident() {
if let Some(var_name) = i.sym.strip_prefix('$') {
if let Some(var) = cx.var(crate::ctxt::VarPos::$E, var_name) {
return var.get_expr();
Expand Down

0 comments on commit 8910187

Please sign in to comment.