Skip to content

Commit cb57b8a

Browse files
committed
tweak
1 parent f8571f9 commit cb57b8a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/languages/ts.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,24 +161,24 @@ export default (options = {}) => {
161161
/** @type {boolean[]} */
162162
const multiline_nodes = [];
163163

164-
const children = nodes.map((node, i) => {
165-
const child = context.new();
166-
if (node) child.visit(node);
164+
const children = nodes.map((child, i) => {
165+
const child_context = context.new();
166+
if (child) child_context.visit(child);
167167

168-
multiline_nodes[i] = child.multiline;
168+
multiline_nodes[i] = child_context.multiline;
169169

170-
if (i < nodes.length - 1 || !node) {
171-
child.write(separator);
170+
if (i < nodes.length - 1 || !child) {
171+
child_context.write(separator);
172172
}
173173

174-
if (node && flush_trailing_comments(child, node.loc.end)) {
174+
if (child && flush_trailing_comments(child_context, child.loc.end)) {
175175
multiline = true;
176176
}
177177

178-
length += child.measure() + 1;
179-
multiline ||= child.multiline;
178+
length += child_context.measure() + 1;
179+
multiline ||= child_context.multiline;
180180

181-
return child;
181+
return child_context;
182182
});
183183

184184
multiline ||= length > 60;

0 commit comments

Comments
 (0)