Skip to content

Commit eb78983

Browse files
committed
Name filename_hash property consistently with usage
1 parent 8033993 commit eb78983

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

swc/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ pub struct Context {
2929

3030
struct TransformVisitor {
3131
plugin_config: PluginConfig,
32-
hash: String,
32+
filename_hash: String,
3333
local_idents: HashSet<String>,
3434
variable_count: u32,
3535
current_var_declarator: Option<String>,
3636
current_object_prop_declarator: Option<String>,
3737
}
3838

3939
impl TransformVisitor {
40-
pub fn new(plugin_config: PluginConfig, hash: String) -> Self {
40+
pub fn new(plugin_config: PluginConfig, filename_hash: String) -> Self {
4141
Self {
4242
plugin_config,
43-
hash,
43+
filename_hash,
4444
local_idents: HashSet::new(),
4545
variable_count: 0,
4646
current_var_declarator: None,
@@ -128,7 +128,12 @@ impl VisitMut for TransformVisitor {
128128
};
129129

130130
// Append hash and counter
131-
write!(&mut variable_name, "{}{}", self.hash, self.variable_count).unwrap();
131+
write!(
132+
&mut variable_name,
133+
"{}{}",
134+
self.filename_hash, self.variable_count
135+
)
136+
.unwrap();
132137
self.variable_count += 1;
133138

134139
call_expr.args.insert(

0 commit comments

Comments
 (0)