From 78ced2450fab34a8bcca2d3aa9c27bdd803c47a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 17 Jul 2023 15:26:40 +0900 Subject: [PATCH] Comment --- crates/swc_ecma_transforms_base/src/rename/mod.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/swc_ecma_transforms_base/src/rename/mod.rs b/crates/swc_ecma_transforms_base/src/rename/mod.rs index 696a09365a35b..a35cf30dfdebe 100644 --- a/crates/swc_ecma_transforms_base/src/rename/mod.rs +++ b/crates/swc_ecma_transforms_base/src/rename/mod.rs @@ -251,7 +251,19 @@ where // (function-like nodes) does not have eval. This `eval` check includes // `eval` in children. // - // We calculate the top level map first, + // We calculate the top level map first, rename children, and then rename the + // top level. + // + // + // Order: + // + // 1. Top level map calculation + // 2. Per-unit map calculation + // 3. Per-unit renaming + // 4. Top level renaming + // + // This is because the the top level map may contain a mapping which conflicts + // with a map from one of the children. // // See https://github.com/swc-project/swc/pull/7615 if has_eval {