Skip to content

Commit d86ca2d

Browse files
authored
fix(es/testing): Fix PluginCommentProxy (#9170)
**Related issue:** - Closes #9169
1 parent 3b7b2a1 commit d86ca2d

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

crates/swc_plugin_proxy/src/comments/plugin_comments_proxy.rs

+20-20
Original file line numberDiff line numberDiff line change
@@ -77,68 +77,68 @@ impl PluginCommentsProxy {
7777
#[swc_trace]
7878
impl Comments for PluginCommentsProxy {
7979
fn add_leading(&self, pos: BytePos, cmt: Comment) {
80-
swc_common::comments::COMMENTS.with(|comments| {
81-
comments.add_leading(pos, cmt);
80+
swc_common::comments::COMMENTS.with(|c| {
81+
c.add_leading(pos, cmt);
8282
});
8383
}
8484

8585
fn add_leading_comments(&self, pos: BytePos, comments: Vec<Comment>) {
86-
swc_common::comments::COMMENTS.with(|comments| {
87-
comments.add_leading_comments(pos, comments);
86+
swc_common::comments::COMMENTS.with(|c| {
87+
c.add_leading_comments(pos, comments);
8888
});
8989
}
9090

9191
fn has_leading(&self, pos: BytePos) -> bool {
92-
swc_common::comments::COMMENTS.with(|comments| comments.has_leading(pos))
92+
swc_common::comments::COMMENTS.with(|c| c.has_leading(pos))
9393
}
9494

9595
fn move_leading(&self, from: BytePos, to: BytePos) {
96-
swc_common::comments::COMMENTS.with(|comments| {
97-
comments.move_leading(from, to);
96+
swc_common::comments::COMMENTS.with(|c| {
97+
c.move_leading(from, to);
9898
});
9999
}
100100

101101
fn take_leading(&self, pos: BytePos) -> Option<Vec<Comment>> {
102-
swc_common::comments::COMMENTS.with(|comments| comments.take_leading(pos))
102+
swc_common::comments::COMMENTS.with(|c| c.take_leading(pos))
103103
}
104104

105105
fn get_leading(&self, pos: BytePos) -> Option<Vec<Comment>> {
106-
swc_common::comments::COMMENTS.with(|comments| comments.get_leading(pos))
106+
swc_common::comments::COMMENTS.with(|c| c.get_leading(pos))
107107
}
108108

109109
fn add_trailing(&self, pos: BytePos, cmt: Comment) {
110-
swc_common::comments::COMMENTS.with(|comments| {
111-
comments.add_trailing(pos, cmt);
110+
swc_common::comments::COMMENTS.with(|c| {
111+
c.add_trailing(pos, cmt);
112112
});
113113
}
114114

115115
fn add_trailing_comments(&self, pos: BytePos, comments: Vec<Comment>) {
116-
swc_common::comments::COMMENTS.with(|comments| {
117-
comments.add_trailing_comments(pos, comments);
116+
swc_common::comments::COMMENTS.with(|c| {
117+
c.add_trailing_comments(pos, comments);
118118
});
119119
}
120120

121121
fn has_trailing(&self, pos: BytePos) -> bool {
122-
swc_common::comments::COMMENTS.with(|comments| comments.has_trailing(pos))
122+
swc_common::comments::COMMENTS.with(|c| c.has_trailing(pos))
123123
}
124124

125125
fn move_trailing(&self, from: BytePos, to: BytePos) {
126-
swc_common::comments::COMMENTS.with(|comments| {
127-
comments.move_trailing(from, to);
126+
swc_common::comments::COMMENTS.with(|c| {
127+
c.move_trailing(from, to);
128128
});
129129
}
130130

131131
fn take_trailing(&self, pos: BytePos) -> Option<Vec<Comment>> {
132-
swc_common::comments::COMMENTS.with(|comments| comments.take_trailing(pos))
132+
swc_common::comments::COMMENTS.with(|c| c.take_trailing(pos))
133133
}
134134

135135
fn get_trailing(&self, pos: BytePos) -> Option<Vec<Comment>> {
136-
swc_common::comments::COMMENTS.with(|comments| comments.get_trailing(pos))
136+
swc_common::comments::COMMENTS.with(|c| c.get_trailing(pos))
137137
}
138138

139139
fn add_pure_comment(&self, pos: BytePos) {
140-
swc_common::comments::COMMENTS.with(|comments| {
141-
comments.add_pure_comment(pos);
140+
swc_common::comments::COMMENTS.with(|c| {
141+
c.add_pure_comment(pos);
142142
});
143143
}
144144
}

0 commit comments

Comments
 (0)