Skip to content

Commit

Permalink
refactor: 🔥 remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Mar 1, 2024
1 parent bf18427 commit fb23bbb
Showing 1 changed file with 0 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,105 +141,6 @@ impl<'a> VisitMut for RootTransformer<'a> {
} else {
None
};

// let source = import_decl.src.value.to_string();

// if let Some(imported_module_id) =
// self.import_source_to_module_id.get(&source)
// {
// if let Some(mapped_exports) = self
// .concatenate_context
// .modules_in_scope
// .get(imported_module_id)
// {
// items = Some(vec![]);
//
// for import_specifier in &import_decl.specifiers {
// match import_specifier {
// ImportSpecifier::Named(named_specifier) => {
// // handle conflict name in top level
//
// let imported_symbol = if let Some(imported) =
// &named_specifier.imported
// && let ModuleExportName::Ident(imported_ident) =
// imported
// {
// imported_ident.sym.to_string()
// } else {
// named_specifier.local.sym.to_string()
// };
//
// let mapped_export =
// mapped_exports.get(&imported_symbol).unwrap();
//
// if !named_specifier
// .local
// .sym
// .to_string()
// .eq(mapped_export)
// {
// let var_decl_stmt: Stmt =
// quote_ident!(mapped_export.clone())
// .into_var_decl(
// VarDeclKind::Var,
// named_specifier.local.clone().into(),
// )
// .into();
// if let Some(a) = items.as_mut() {
// a.push(var_decl_stmt.into());
// }
// }
// }
// ImportSpecifier::Default(default_specifier) => {
// if let Some(ex) = mapped_exports.get("default") {
// let stmt: Stmt = quote_ident!(ex.clone())
// .into_var_decl(
// VarDeclKind::Var,
// default_specifier.local.clone().into(),
// )
// .into();
//
// items.as_mut().unwrap().push(stmt.into());
// } else {
// println!(
// "try get defaut from {}({}) in {}",
// source,
// imported_module_id.id,
// self.current_module_id.id
// );
// println!("the map {:?}", mapped_exports);
//
// let stmt: Stmt = quote_expr!(DUMMY_SP, null)
// .into_var_decl(
// VarDeclKind::Var,
// default_specifier.local.clone().into(),
// )
// .into();
//
// items.as_mut().unwrap().push(stmt.into());
// }
// }
// ImportSpecifier::Namespace(namespace) => {
// let mapped_namespace = mapped_exports.get("*").unwrap();
//
// if !namespace.local.sym.to_string().eq(mapped_namespace)
// {
// let var_decl_stmt: Stmt =
// quote_ident!(mapped_namespace.clone())
// .into_var_decl(
// VarDeclKind::Var,
// namespace.local.clone().into(),
// )
// .into();
// if let Some(a) = items.as_mut() {
// a.push(var_decl_stmt.into());
// }
// }
// }
// }
// }
// }
// }
}
ModuleDecl::ExportDecl(_) => {}
ModuleDecl::ExportNamed(export_named) => {
Expand Down

0 comments on commit fb23bbb

Please sign in to comment.