Skip to content

Commit

Permalink
Updagte
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 18, 2024
1 parent 0b19c48 commit ed52c8f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
20 changes: 8 additions & 12 deletions packages/emotion/transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,13 +588,13 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
args: expr.args,
callee: CallExpr {
span: DUMMY_SP,
type_args: None,
callee: Ident::new(i.sym.clone(), i.span, i.ctxt)
.as_callee(),
args,
..Default::default()
}
.as_callee(),
..Default::default()
};
}
}
Expand Down Expand Up @@ -671,7 +671,7 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
if self.options.auto_label.unwrap_or(false) {
object_props.push(PropOrSpread::Prop(Box::new(
Prop::KeyValue(KeyValueProp {
key: PropName::Ident(Ident::new(
key: PropName::Ident(IdentName::new(
"label".into(),
DUMMY_SP,
)),
Expand Down Expand Up @@ -732,7 +732,7 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
}
args
},
type_args: None,
..Default::default()
});
}
}
Expand All @@ -754,10 +754,9 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
}
}
return Expr::Call(CallExpr {
span: DUMMY_SP,
callee: i.take().as_callee(),
args,
type_args: None,
..Default::default()
});
}
}
Expand All @@ -774,7 +773,7 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
if self.options.auto_label.unwrap_or(false) {
object_props.push(PropOrSpread::Prop(Box::new(
Prop::KeyValue(KeyValueProp {
key: PropName::Ident(Ident::new(
key: PropName::Ident(IdentName::new(
"label".into(),
DUMMY_SP,
)),
Expand All @@ -793,11 +792,7 @@ impl<C: Comments> Fold for EmotionTransformer<C> {

self.comments.add_pure_comment(member_expr.span.lo());
return Expr::Call(CallExpr {
span: DUMMY_SP,
type_args: None,
callee: CallExpr {
type_args: None,
span: DUMMY_SP,
callee: i.take().as_callee(),
args: vec![
prop.take().sym.as_arg(),
Expand All @@ -807,9 +802,11 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
})
.as_arg(),
],
..Default::default()
}
.as_callee(),
args,
..Default::default()
});
}
}
Expand All @@ -820,7 +817,6 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
{
self.comments.add_pure_comment(member_expr.span.lo());
return Expr::Call(CallExpr {
span: DUMMY_SP,
callee: member_expr.take().as_callee(),
args: {
let mut args = self.create_args_from_tagged_tpl(
Expand All @@ -836,7 +832,7 @@ impl<C: Comments> Fold for EmotionTransformer<C> {
}
args
},
type_args: None,
..Default::default()
});
}
}
Expand Down
12 changes: 6 additions & 6 deletions packages/jest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ impl Jest {
) => match &*callee.obj {
Expr::Ident(i) if i.sym == *"jest" => match prop {
_ if HOIST_METHODS.contains(&*prop.sym) => {
hoisted.push(T::from_stmt(stmt));
hoisted.push(T::from(stmt));
}
_ => new.push(T::from_stmt(stmt)),
_ => new.push(T::from(stmt)),
},
_ => new.push(T::from_stmt(stmt)),
_ => new.push(T::from(stmt)),
},
_ => new.push(T::from_stmt(stmt)),
_ => new.push(T::from(stmt)),
},
_ => new.push(T::from_stmt(stmt)),
_ => new.push(T::from(stmt)),
},

_ => new.push(T::from_stmt(stmt)),
_ => new.push(T::from(stmt)),
},
Err(node) => new.push(node),
};
Expand Down
12 changes: 3 additions & 9 deletions packages/loadable-components/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,16 @@ where
key: PropName::Ident(quote_ident!("chunkName")),
function: Box::new(Function {
params: clone_params(func),
decorators: Default::default(),
span: DUMMY_SP,
body: Some(BlockStmt {
span: DUMMY_SP,
stmts: vec![Stmt::Return(ReturnStmt {
span: DUMMY_SP,
arg: Some(Box::new(self.replace_chunk_name(import))),
})],
..Default::default()
}),
is_generator: false,
is_async: false,
type_params: Default::default(),
return_type: Default::default(),
..Default::default()
}),
}
}
Expand All @@ -347,8 +344,6 @@ where
decorators: Default::default(),
pat: Pat::Ident(quote_ident!("props").into()),
}],
decorators: Default::default(),
span: DUMMY_SP,
body: Some(
quote!(
"
Expand All @@ -370,8 +365,7 @@ where
),
is_generator: false,
is_async: false,
type_params: Default::default(),
return_type: Default::default(),
..Default::default()
}),
}
}
Expand Down

0 comments on commit ed52c8f

Please sign in to comment.