From 9962c9c98d8a30623b4680303e398ae57da6d6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sun, 19 Jan 2025 16:55:44 +0900 Subject: [PATCH] doc(es/parallel): Improve document of `Parallel` (#9896) **Description:** Document that `after_*` is not used for `visit_*_par` --- .changeset/friendly-crews-breathe.md | 6 ++++++ crates/swc_ecma_utils/src/parallel.rs | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/friendly-crews-breathe.md diff --git a/.changeset/friendly-crews-breathe.md b/.changeset/friendly-crews-breathe.md new file mode 100644 index 000000000000..e25384b257f4 --- /dev/null +++ b/.changeset/friendly-crews-breathe.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_utils: patch +--- + +doc(es/parallel): Improve document of `Parallel` diff --git a/crates/swc_ecma_utils/src/parallel.rs b/crates/swc_ecma_utils/src/parallel.rs index 1fadf4f8a4e9..43becc71d568 100644 --- a/crates/swc_ecma_utils/src/parallel.rs +++ b/crates/swc_ecma_utils/src/parallel.rs @@ -22,9 +22,15 @@ pub trait Parallel: swc_common::sync::Send + swc_common::sync::Sync { fn merge(&mut self, other: Self); /// Invoked after visiting all [Stmt]s, possibly in parallel. + /// + /// + /// Note: `visit_*_par` never calls this. fn after_stmts(&mut self, _stmts: &mut Vec) {} /// Invoked after visiting all [ModuleItem]s, possibly in parallel. + /// + /// + /// Note: `visit_*_par` never calls this. fn after_module_items(&mut self, _stmts: &mut Vec) {} }