From e364fc74ce6d12b857322de34bdd9d25df671698 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Tue, 20 Aug 2024 23:36:35 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20tweak?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/oxc_minifier/src/plugins/inject_global_variables.rs | 2 +- crates/oxc_minifier/src/plugins/replace_global_defines.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/oxc_minifier/src/plugins/inject_global_variables.rs b/crates/oxc_minifier/src/plugins/inject_global_variables.rs index 4ca5358d93b9d7..3059ef802a8913 100644 --- a/crates/oxc_minifier/src/plugins/inject_global_variables.rs +++ b/crates/oxc_minifier/src/plugins/inject_global_variables.rs @@ -95,7 +95,7 @@ impl<'a> From<&InjectImport> for DotDefineState<'a> { fn from(inject: &InjectImport) -> Self { let parts = inject.specifier.local().split('.').map(CompactStr::from).collect::>(); let value = inject.replace_value.clone().unwrap(); - let dot_define = DotDefine { parts, value, postfix_wildcard: false }; + let dot_define = DotDefine { parts, value }; Self { dot_define, value_atom: None } } } diff --git a/crates/oxc_minifier/src/plugins/replace_global_defines.rs b/crates/oxc_minifier/src/plugins/replace_global_defines.rs index 77d92827a4f448..1d59933f147e13 100644 --- a/crates/oxc_minifier/src/plugins/replace_global_defines.rs +++ b/crates/oxc_minifier/src/plugins/replace_global_defines.rs @@ -29,7 +29,6 @@ pub struct DotDefine { /// Member expression parts pub parts: Vec, pub value: CompactStr, - pub postfix_wildcard: bool, } #[derive(Debug)] @@ -47,8 +46,8 @@ impl MetaPropertyDefine { } impl DotDefine { - fn new(parts: Vec, value: CompactStr, postfix_wildcard: bool) -> Self { - Self { parts, value, postfix_wildcard } + fn new(parts: Vec, value: CompactStr) -> Self { + Self { parts, value } } } @@ -80,7 +79,7 @@ impl ReplaceGlobalDefinesConfig { identifier_defines.push((CompactStr::new(key), CompactStr::new(value))); } IdentifierType::DotDefines { parts } => { - dot_defines.push(DotDefine::new(parts, CompactStr::new(value), false)); + dot_defines.push(DotDefine::new(parts, CompactStr::new(value))); } IdentifierType::ImportMeta { parts, postfix_wildcard } => { meta_proeperty_defines.push(MetaPropertyDefine::new(