message: refactor(es/transforms/compat): Migrate to `VisitMut`
  swc_ecma_transforms_compat:
  - `export_namespace_from`: Migrate to `VisitMut`.
diff: use swc_common::DUMMY_SP;
  use swc_ecma_ast::*;
  use swc_ecma_utils::{IdentExt, IsDirective};
  -use swc_ecma_visit::{noop_fold_type, Fold};
  +use swc_ecma_visit::{as_folder, noop_fold_type, noop_visit_mut_type, Fold, VisitMut};
  -pub fn export_namespace_from() -> impl Fold {
  - ExportNamespaceFrom
  +pub fn export_namespace_from() -> impl Fold + VisitMut {
  + as_folder(ExportNamespaceFrom)
  }
  struct ExportNamespaceFrom;
  -/// TODO: VisitMut
  -impl Fold for ExportNamespaceFrom {
  - noop_fold_type!();
  +impl VisitMut for ExportNamespaceFrom {
  + noop_visit_mut_type!();
  - fn fold_module_items(&mut self, items: Vec<ModuleItem>) -> Vec<ModuleItem> {
  - // Imports
  - let mut stmts = Vec::with_capacity(items.len() + 4);
  - // Statements except import
  + fn visit_mut_module_items(&mut self, items: &mut Vec<ModuleItem>) {
  + let mut items_updated = Vec::with_capacity(items.len() + 4);
  + // Statements except imports
  let mut extra_stmts = Vec::with_capacity(items.len() + 4);
  -
  - for item in items {
  + for item in items.drain(..) {
  match item {
  - ModuleItem::Stmt(ref s) if s.is_use_strict() => stmts.push(item),
  + ModuleItem::Stmt(ref s) if s.is_use_strict() => items_updated.push(item),
  ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(mut export)) => {
  // Skip if it does not have namespace export
  if export.specifiers.iter().all(|s| match *s {
  @@ -36,7 +33,8 @@ impl Fold for ExportNamespaceFrom {
  ExportSpecifier::Namespace(ns) => {
  let local = ns.name.prefix("_").private();
  - stmts.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
  + items_updated.push(ModuleItem::ModuleDecl(ModuleDecl::Import(
  + ImportDecl {
  span: DUMMY_SP,
  specifiers: vec![ImportSpecifier::Namespace(
  ImportStarAsSpecifier {
  @@ -50,7 +48,8 @@ impl Fold for ExportNamespaceFrom {
  .expect("`export default from` requires source"),
  type_only: false,
  asserts: None,
  - })));
  + },
  + )));
  extra_stmts.push(ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(
  NamedExport {
  span: DUMMY_SP,
  @@ -74,15 +73,14 @@ impl Fold for ExportNamespaceFrom {
  extra_stmts.push(ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(export)));
  }
  }
  - ModuleItem::ModuleDecl(ModuleDecl::Import(..)) => stmts.push(item),
  + ModuleItem::ModuleDecl(ModuleDecl::Import(..)) => items_updated.push(item),
  _ => extra_stmts.push(item),
  }
  }
  - stmts.append(&mut extra_stmts);
  -
  - stmts.shrink_to_fit();
  + items_updated.append(&mut extra_stmts);
  + items_updated.shrink_to_fit();
  - stmts
  + *items = items_updated;
  }
  }
  