@openrewrite/rewrite 8.96.5 → 8.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/java/tree.d.ts +2 -1
  2. package/dist/java/tree.d.ts.map +1 -1
  3. package/dist/java/tree.js.map +1 -1
  4. package/dist/java/visitor.d.ts +5 -0
  5. package/dist/java/visitor.d.ts.map +1 -1
  6. package/dist/java/visitor.js +264 -231
  7. package/dist/java/visitor.js.map +1 -1
  8. package/dist/javascript/dependency-workspace.d.ts +8 -2
  9. package/dist/javascript/dependency-workspace.d.ts.map +1 -1
  10. package/dist/javascript/dependency-workspace.js +36 -4
  11. package/dist/javascript/dependency-workspace.js.map +1 -1
  12. package/dist/javascript/templating/engine.d.ts +1 -0
  13. package/dist/javascript/templating/engine.d.ts.map +1 -1
  14. package/dist/javascript/templating/engine.js +28 -4
  15. package/dist/javascript/templating/engine.js.map +1 -1
  16. package/dist/javascript/templating/placeholder-replacement.d.ts +2 -0
  17. package/dist/javascript/templating/placeholder-replacement.d.ts.map +1 -1
  18. package/dist/javascript/templating/placeholder-replacement.js +24 -3
  19. package/dist/javascript/templating/placeholder-replacement.js.map +1 -1
  20. package/dist/javascript/visitor.d.ts.map +1 -1
  21. package/dist/javascript/visitor.js +135 -121
  22. package/dist/javascript/visitor.js.map +1 -1
  23. package/dist/rewrite-javascript-version.txt +1 -1
  24. package/package.json +1 -1
  25. package/src/java/tree.ts +2 -1
  26. package/src/java/visitor.ts +263 -230
  27. package/src/javascript/dependency-workspace.ts +35 -3
  28. package/src/javascript/templating/engine.ts +30 -3
  29. package/src/javascript/templating/placeholder-replacement.ts +24 -3
  30. package/src/javascript/visitor.ts +139 -121
@@ -64,18 +64,36 @@ class JavaVisitor extends visitor_1.TreeVisitor {
64
64
  async visitTypeName(nameTree, p) {
65
65
  return nameTree;
66
66
  }
67
+ /**
68
+ * Visits the children of `tree` through `visit` under a cursor that holds it, where a visit made it of the tree
69
+ * on the cursor, and puts the given cursor back after with the messages they left.
70
+ */
71
+ visitChildrenOf(tree, visit) {
72
+ var _a;
73
+ const given = this.cursor;
74
+ if (given.value === tree || ((_a = given.value) === null || _a === void 0 ? void 0 : _a.kind) !== tree.kind) {
75
+ return visit();
76
+ }
77
+ this.cursor = new tree_1.Cursor(tree, given.parent);
78
+ given.messages.forEach((value, key) => this.cursor.messages.set(key, value));
79
+ return visit().then(visited => {
80
+ this.cursor.messages.forEach((value, key) => given.messages.set(key, value));
81
+ this.cursor = given;
82
+ return visited;
83
+ });
84
+ }
67
85
  async visitAnnotatedType(annotatedType, p) {
68
86
  const expression = await this.visitExpression(annotatedType, p);
69
87
  if (!(expression === null || expression === void 0 ? void 0 : expression.kind) || expression.kind !== tree_2.J.Kind.AnnotatedType) {
70
88
  return expression;
71
89
  }
72
90
  annotatedType = expression;
73
- const updates = {
91
+ const updates = await this.visitChildrenOf(annotatedType, async () => ({
74
92
  prefix: await this.visitSpace(annotatedType.prefix, p),
75
93
  markers: await this.visitMarkers(annotatedType.markers, p),
76
94
  annotations: await (0, util_1.mapAsync)(annotatedType.annotations, a => this.visitDefined(a, p)),
77
95
  typeExpression: await this.visitDefined(annotatedType.typeExpression, p)
78
- };
96
+ }));
79
97
  return (0, util_1.updateIfChanged)(annotatedType, updates);
80
98
  }
81
99
  async visitAnnotation(annotation, p) {
@@ -84,12 +102,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
84
102
  return expression;
85
103
  }
86
104
  annotation = expression;
87
- const updates = {
105
+ const updates = await this.visitChildrenOf(annotation, async () => ({
88
106
  prefix: await this.visitSpace(annotation.prefix, p),
89
107
  markers: await this.visitMarkers(annotation.markers, p),
90
108
  annotationType: await this.visitTypeName(annotation.annotationType, p),
91
109
  arguments: await this.visitOptionalContainer(annotation.arguments, p)
92
- };
110
+ }));
93
111
  return (0, util_1.updateIfChanged)(annotation, updates);
94
112
  }
95
113
  async visitArrayAccess(arrayAccess, p) {
@@ -98,12 +116,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
98
116
  return expression;
99
117
  }
100
118
  arrayAccess = expression;
101
- const updates = {
119
+ const updates = await this.visitChildrenOf(arrayAccess, async () => ({
102
120
  prefix: await this.visitSpace(arrayAccess.prefix, p),
103
121
  markers: await this.visitMarkers(arrayAccess.markers, p),
104
122
  indexed: await this.visitDefined(arrayAccess.indexed, p),
105
123
  dimension: await this.visitDefined(arrayAccess.dimension, p)
106
- };
124
+ }));
107
125
  return (0, util_1.updateIfChanged)(arrayAccess, updates);
108
126
  }
109
127
  async visitArrayDimension(arrayDimension, p) {
@@ -120,17 +138,19 @@ class JavaVisitor extends visitor_1.TreeVisitor {
120
138
  return expression;
121
139
  }
122
140
  arrayType = expression;
123
- const updates = {
124
- prefix: await this.visitSpace(arrayType.prefix, p),
125
- markers: await this.visitMarkers(arrayType.markers, p),
126
- elementType: await this.visitDefined(arrayType.elementType, p),
127
- dimension: await this.visitLeftPadded(arrayType.dimension, p),
128
- type: await this.visitType(arrayType.type, p)
129
- };
130
- if (arrayType.annotations) {
131
- updates.annotations = await (0, util_1.mapAsync)(arrayType.annotations, a => this.visitDefined(a, p));
132
- }
133
- return (0, util_1.updateIfChanged)(arrayType, updates);
141
+ return this.visitChildrenOf(arrayType, async () => {
142
+ const updates = {
143
+ prefix: await this.visitSpace(arrayType.prefix, p),
144
+ markers: await this.visitMarkers(arrayType.markers, p),
145
+ elementType: await this.visitDefined(arrayType.elementType, p),
146
+ dimension: await this.visitLeftPadded(arrayType.dimension, p),
147
+ type: await this.visitType(arrayType.type, p)
148
+ };
149
+ if (arrayType.annotations) {
150
+ updates.annotations = await (0, util_1.mapAsync)(arrayType.annotations, a => this.visitDefined(a, p));
151
+ }
152
+ return (0, util_1.updateIfChanged)(arrayType, updates);
153
+ });
134
154
  }
135
155
  async visitAssert(anAssert, p) {
136
156
  const statement = await this.visitStatement(anAssert, p);
@@ -138,12 +158,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
138
158
  return statement;
139
159
  }
140
160
  anAssert = statement;
141
- const updates = {
161
+ const updates = await this.visitChildrenOf(anAssert, async () => ({
142
162
  prefix: await this.visitSpace(anAssert.prefix, p),
143
163
  markers: await this.visitMarkers(anAssert.markers, p),
144
164
  condition: await this.visitDefined(anAssert.condition, p),
145
165
  detail: await this.visitOptionalLeftPadded(anAssert.detail, p)
146
- };
166
+ }));
147
167
  return (0, util_1.updateIfChanged)(anAssert, updates);
148
168
  }
149
169
  async visitAssignment(assignment, p) {
@@ -157,13 +177,13 @@ class JavaVisitor extends visitor_1.TreeVisitor {
157
177
  return statement;
158
178
  }
159
179
  assignment = statement;
160
- const updates = {
180
+ const updates = await this.visitChildrenOf(assignment, async () => ({
161
181
  prefix: await this.visitSpace(assignment.prefix, p),
162
182
  markers: await this.visitMarkers(assignment.markers, p),
163
183
  variable: await this.visitDefined(assignment.variable, p),
164
184
  assignment: await this.visitLeftPadded(assignment.assignment, p),
165
185
  type: await this.visitType(assignment.type, p)
166
- };
186
+ }));
167
187
  return (0, util_1.updateIfChanged)(assignment, updates);
168
188
  }
169
189
  async visitAssignmentOperation(assignOp, p) {
@@ -177,14 +197,14 @@ class JavaVisitor extends visitor_1.TreeVisitor {
177
197
  return statement;
178
198
  }
179
199
  assignOp = statement;
180
- const updates = {
200
+ const updates = await this.visitChildrenOf(assignOp, async () => ({
181
201
  prefix: await this.visitSpace(assignOp.prefix, p),
182
202
  markers: await this.visitMarkers(assignOp.markers, p),
183
203
  variable: await this.visitDefined(assignOp.variable, p),
184
204
  operator: await this.visitLeftPadded(assignOp.operator, p),
185
205
  assignment: await this.visitDefined(assignOp.assignment, p),
186
206
  type: await this.visitType(assignOp.type, p)
187
- };
207
+ }));
188
208
  return (0, util_1.updateIfChanged)(assignOp, updates);
189
209
  }
190
210
  async visitBinary(binary, p) {
@@ -192,26 +212,15 @@ class JavaVisitor extends visitor_1.TreeVisitor {
192
212
  if (!(expression === null || expression === void 0 ? void 0 : expression.kind) || expression.kind !== tree_2.J.Kind.Binary) {
193
213
  return expression;
194
214
  }
195
- const given = this.cursor;
196
- if (expression !== binary && given.value === binary) {
197
- // the operands are visited under the binary that holds them, where a template reads their slots
198
- this.cursor = new tree_1.Cursor(expression, given.parent);
199
- given.messages.forEach((value, key) => this.cursor.messages.set(key, value));
200
- }
201
215
  binary = expression;
202
- const updates = {
216
+ const updates = await this.visitChildrenOf(binary, async () => ({
203
217
  prefix: await this.visitSpace(binary.prefix, p),
204
218
  markers: await this.visitMarkers(binary.markers, p),
205
219
  left: await this.visitDefined(binary.left, p),
206
220
  operator: await this.visitLeftPadded(binary.operator, p),
207
221
  right: await this.visitDefined(binary.right, p),
208
222
  type: await this.visitType(binary.type, p)
209
- };
210
- if (this.cursor !== given) {
211
- // what follows reads the cursor of the binary it was given, as for every other tree
212
- this.cursor.messages.forEach((value, key) => given.messages.set(key, value));
213
- this.cursor = given;
214
- }
223
+ }));
215
224
  return (0, util_1.updateIfChanged)(binary, updates);
216
225
  }
217
226
  async visitBlock(block, p) {
@@ -220,13 +229,13 @@ class JavaVisitor extends visitor_1.TreeVisitor {
220
229
  return statement;
221
230
  }
222
231
  block = statement;
223
- const updates = {
232
+ const updates = await this.visitChildrenOf(block, async () => ({
224
233
  prefix: await this.visitSpace(block.prefix, p),
225
234
  markers: await this.visitMarkers(block.markers, p),
226
235
  static: await this.visitRightPadded(block.static, p),
227
236
  statements: await (0, util_1.mapAsync)(block.statements, stmt => this.visitRightPadded(stmt, p)),
228
237
  end: await this.visitSpace(block.end, p)
229
- };
238
+ }));
230
239
  return (0, util_1.updateIfChanged)(block, updates);
231
240
  }
232
241
  async visitBreak(breakStatement, p) {
@@ -235,14 +244,16 @@ class JavaVisitor extends visitor_1.TreeVisitor {
235
244
  return statement;
236
245
  }
237
246
  breakStatement = statement;
238
- const updates = {
239
- prefix: await this.visitSpace(breakStatement.prefix, p),
240
- markers: await this.visitMarkers(breakStatement.markers, p)
241
- };
242
- if (breakStatement.label) {
243
- updates.label = await this.visitDefined(breakStatement.label, p);
244
- }
245
- return (0, util_1.updateIfChanged)(breakStatement, updates);
247
+ return this.visitChildrenOf(breakStatement, async () => {
248
+ const updates = {
249
+ prefix: await this.visitSpace(breakStatement.prefix, p),
250
+ markers: await this.visitMarkers(breakStatement.markers, p)
251
+ };
252
+ if (breakStatement.label) {
253
+ updates.label = await this.visitDefined(breakStatement.label, p);
254
+ }
255
+ return (0, util_1.updateIfChanged)(breakStatement, updates);
256
+ });
246
257
  }
247
258
  async visitCase(aCase, p) {
248
259
  const statement = await this.visitStatement(aCase, p);
@@ -250,17 +261,19 @@ class JavaVisitor extends visitor_1.TreeVisitor {
250
261
  return statement;
251
262
  }
252
263
  aCase = statement;
253
- const updates = {
254
- prefix: await this.visitSpace(aCase.prefix, p),
255
- markers: await this.visitMarkers(aCase.markers, p),
256
- caseLabels: await this.visitContainer(aCase.caseLabels, p),
257
- statements: await this.visitContainer(aCase.statements, p),
258
- body: await this.visitOptionalRightPadded(aCase.body, p)
259
- };
260
- if (aCase.guard) {
261
- updates.guard = await this.visitDefined(aCase.guard, p);
262
- }
263
- return (0, util_1.updateIfChanged)(aCase, updates);
264
+ return this.visitChildrenOf(aCase, async () => {
265
+ const updates = {
266
+ prefix: await this.visitSpace(aCase.prefix, p),
267
+ markers: await this.visitMarkers(aCase.markers, p),
268
+ caseLabels: await this.visitContainer(aCase.caseLabels, p),
269
+ statements: await this.visitContainer(aCase.statements, p),
270
+ body: await this.visitOptionalRightPadded(aCase.body, p)
271
+ };
272
+ if (aCase.guard) {
273
+ updates.guard = await this.visitDefined(aCase.guard, p);
274
+ }
275
+ return (0, util_1.updateIfChanged)(aCase, updates);
276
+ });
264
277
  }
265
278
  async visitClassDeclaration(classDecl, p) {
266
279
  const statement = await this.visitStatement(classDecl, p);
@@ -268,7 +281,7 @@ class JavaVisitor extends visitor_1.TreeVisitor {
268
281
  return statement;
269
282
  }
270
283
  classDecl = statement;
271
- const updates = {
284
+ const updates = await this.visitChildrenOf(classDecl, async () => ({
272
285
  prefix: await this.visitSpace(classDecl.prefix, p),
273
286
  markers: await this.visitMarkers(classDecl.markers, p),
274
287
  leadingAnnotations: await (0, util_1.mapAsync)(classDecl.leadingAnnotations, a => this.visitDefined(a, p)),
@@ -282,7 +295,7 @@ class JavaVisitor extends visitor_1.TreeVisitor {
282
295
  permitting: await this.visitOptionalContainer(classDecl.permitting, p),
283
296
  body: await this.visitDefined(classDecl.body, p),
284
297
  type: await this.visitType(classDecl.type, p)
285
- };
298
+ }));
286
299
  return (0, util_1.updateIfChanged)(classDecl, updates);
287
300
  }
288
301
  async visitClassDeclarationKind(kind, p) {
@@ -310,14 +323,16 @@ class JavaVisitor extends visitor_1.TreeVisitor {
310
323
  return statement;
311
324
  }
312
325
  continueStatement = statement;
313
- const updates = {
314
- prefix: await this.visitSpace(continueStatement.prefix, p),
315
- markers: await this.visitMarkers(continueStatement.markers, p)
316
- };
317
- if (continueStatement.label) {
318
- updates.label = await this.visitDefined(continueStatement.label, p);
319
- }
320
- return (0, util_1.updateIfChanged)(continueStatement, updates);
326
+ return this.visitChildrenOf(continueStatement, async () => {
327
+ const updates = {
328
+ prefix: await this.visitSpace(continueStatement.prefix, p),
329
+ markers: await this.visitMarkers(continueStatement.markers, p)
330
+ };
331
+ if (continueStatement.label) {
332
+ updates.label = await this.visitDefined(continueStatement.label, p);
333
+ }
334
+ return (0, util_1.updateIfChanged)(continueStatement, updates);
335
+ });
321
336
  }
322
337
  async visitControlParentheses(controlParens, p) {
323
338
  const expression = await this.visitExpression(controlParens, p);
@@ -325,11 +340,11 @@ class JavaVisitor extends visitor_1.TreeVisitor {
325
340
  return expression;
326
341
  }
327
342
  controlParens = expression;
328
- const updates = {
343
+ const updates = await this.visitChildrenOf(controlParens, async () => ({
329
344
  prefix: await this.visitSpace(controlParens.prefix, p),
330
345
  markers: await this.visitMarkers(controlParens.markers, p),
331
346
  tree: await this.visitRightPadded(controlParens.tree, p)
332
- };
347
+ }));
333
348
  return (0, util_1.updateIfChanged)(controlParens, updates);
334
349
  }
335
350
  async visitDeconstructionPattern(pattern, p) {
@@ -348,12 +363,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
348
363
  return statement;
349
364
  }
350
365
  doWhileLoop = statement;
351
- const updates = {
366
+ const updates = await this.visitChildrenOf(doWhileLoop, async () => ({
352
367
  prefix: await this.visitSpace(doWhileLoop.prefix, p),
353
368
  markers: await this.visitMarkers(doWhileLoop.markers, p),
354
369
  body: await this.visitRightPadded(doWhileLoop.body, p),
355
370
  whileCondition: await this.visitLeftPadded(doWhileLoop.whileCondition, p)
356
- };
371
+ }));
357
372
  return (0, util_1.updateIfChanged)(doWhileLoop, updates);
358
373
  }
359
374
  async visitEmpty(empty, p) {
@@ -391,11 +406,11 @@ class JavaVisitor extends visitor_1.TreeVisitor {
391
406
  return statement;
392
407
  }
393
408
  enumValueSet = statement;
394
- const updates = {
409
+ const updates = await this.visitChildrenOf(enumValueSet, async () => ({
395
410
  prefix: await this.visitSpace(enumValueSet.prefix, p),
396
411
  markers: await this.visitMarkers(enumValueSet.markers, p),
397
412
  enums: await (0, util_1.mapAsync)(enumValueSet.enums, e => this.visitRightPadded(e, p))
398
- };
413
+ }));
399
414
  return (0, util_1.updateIfChanged)(enumValueSet, updates);
400
415
  }
401
416
  async visitErroneous(erroneous, p) {
@@ -426,13 +441,13 @@ class JavaVisitor extends visitor_1.TreeVisitor {
426
441
  return statement;
427
442
  }
428
443
  fieldAccess = statement;
429
- const updates = {
444
+ const updates = await this.visitChildrenOf(fieldAccess, async () => ({
430
445
  prefix: await this.visitSpace(fieldAccess.prefix, p),
431
446
  markers: await this.visitMarkers(fieldAccess.markers, p),
432
447
  target: await this.visitDefined(fieldAccess.target, p),
433
448
  name: await this.visitLeftPadded(fieldAccess.name, p),
434
449
  type: await this.visitType(fieldAccess.type, p)
435
- };
450
+ }));
436
451
  return (0, util_1.updateIfChanged)(fieldAccess, updates);
437
452
  }
438
453
  async visitForEachLoop(forLoop, p) {
@@ -441,12 +456,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
441
456
  return statement;
442
457
  }
443
458
  forLoop = statement;
444
- const updates = {
459
+ const updates = await this.visitChildrenOf(forLoop, async () => ({
445
460
  prefix: await this.visitSpace(forLoop.prefix, p),
446
461
  markers: await this.visitMarkers(forLoop.markers, p),
447
462
  control: await this.visitDefined(forLoop.control, p),
448
463
  body: await this.visitRightPadded(forLoop.body, p)
449
- };
464
+ }));
450
465
  return (0, util_1.updateIfChanged)(forLoop, updates);
451
466
  }
452
467
  async visitForEachLoopControl(control, p) {
@@ -464,12 +479,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
464
479
  return statement;
465
480
  }
466
481
  forLoop = statement;
467
- const updates = {
482
+ const updates = await this.visitChildrenOf(forLoop, async () => ({
468
483
  prefix: await this.visitSpace(forLoop.prefix, p),
469
484
  markers: await this.visitMarkers(forLoop.markers, p),
470
485
  control: await this.visitDefined(forLoop.control, p),
471
486
  body: await this.visitRightPadded(forLoop.body, p)
472
- };
487
+ }));
473
488
  return (0, util_1.updateIfChanged)(forLoop, updates);
474
489
  }
475
490
  async visitForLoopControl(control, p) {
@@ -503,16 +518,18 @@ class JavaVisitor extends visitor_1.TreeVisitor {
503
518
  return statement;
504
519
  }
505
520
  iff = statement;
506
- const updates = {
507
- prefix: await this.visitSpace(iff.prefix, p),
508
- markers: await this.visitMarkers(iff.markers, p),
509
- ifCondition: await this.visitDefined(iff.ifCondition, p),
510
- thenPart: await this.visitRightPadded(iff.thenPart, p)
511
- };
512
- if (iff.elsePart) {
513
- updates.elsePart = await this.visitDefined(iff.elsePart, p);
514
- }
515
- return (0, util_1.updateIfChanged)(iff, updates);
521
+ return this.visitChildrenOf(iff, async () => {
522
+ const updates = {
523
+ prefix: await this.visitSpace(iff.prefix, p),
524
+ markers: await this.visitMarkers(iff.markers, p),
525
+ ifCondition: await this.visitDefined(iff.ifCondition, p),
526
+ thenPart: await this.visitRightPadded(iff.thenPart, p)
527
+ };
528
+ if (iff.elsePart) {
529
+ updates.elsePart = await this.visitDefined(iff.elsePart, p);
530
+ }
531
+ return (0, util_1.updateIfChanged)(iff, updates);
532
+ });
516
533
  }
517
534
  async visitElse(anElse, p) {
518
535
  const updates = {
@@ -538,20 +555,22 @@ class JavaVisitor extends visitor_1.TreeVisitor {
538
555
  return expression;
539
556
  }
540
557
  instanceOf = expression;
541
- const updates = {
542
- prefix: await this.visitSpace(instanceOf.prefix, p),
543
- markers: await this.visitMarkers(instanceOf.markers, p),
544
- expression: await this.visitRightPadded(instanceOf.expression, p),
545
- class: await this.visitDefined(instanceOf.class, p),
546
- type: await this.visitType(instanceOf.type, p)
547
- };
548
- if (instanceOf.pattern) {
549
- updates.pattern = await this.visitDefined(instanceOf.pattern, p);
550
- }
551
- if (instanceOf.modifier) {
552
- updates.modifier = await this.visitDefined(instanceOf.modifier, p);
553
- }
554
- return (0, util_1.updateIfChanged)(instanceOf, updates);
558
+ return this.visitChildrenOf(instanceOf, async () => {
559
+ const updates = {
560
+ prefix: await this.visitSpace(instanceOf.prefix, p),
561
+ markers: await this.visitMarkers(instanceOf.markers, p),
562
+ expression: await this.visitRightPadded(instanceOf.expression, p),
563
+ class: await this.visitDefined(instanceOf.class, p),
564
+ type: await this.visitType(instanceOf.type, p)
565
+ };
566
+ if (instanceOf.pattern) {
567
+ updates.pattern = await this.visitDefined(instanceOf.pattern, p);
568
+ }
569
+ if (instanceOf.modifier) {
570
+ updates.modifier = await this.visitDefined(instanceOf.modifier, p);
571
+ }
572
+ return (0, util_1.updateIfChanged)(instanceOf, updates);
573
+ });
555
574
  }
556
575
  async visitIntersectionType(intersectionType, p) {
557
576
  const expression = await this.visitExpression(intersectionType, p);
@@ -559,11 +578,11 @@ class JavaVisitor extends visitor_1.TreeVisitor {
559
578
  return expression;
560
579
  }
561
580
  intersectionType = expression;
562
- const updates = {
581
+ const updates = await this.visitChildrenOf(intersectionType, async () => ({
563
582
  prefix: await this.visitSpace(intersectionType.prefix, p),
564
583
  markers: await this.visitMarkers(intersectionType.markers, p),
565
584
  bounds: await this.visitContainer(intersectionType.bounds, p)
566
- };
585
+ }));
567
586
  return (0, util_1.updateIfChanged)(intersectionType, updates);
568
587
  }
569
588
  async visitLabel(label, p) {
@@ -572,12 +591,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
572
591
  return statement;
573
592
  }
574
593
  label = statement;
575
- const updates = {
594
+ const updates = await this.visitChildrenOf(label, async () => ({
576
595
  prefix: await this.visitSpace(label.prefix, p),
577
596
  markers: await this.visitMarkers(label.markers, p),
578
597
  label: await this.visitRightPadded(label.label, p),
579
598
  statement: await this.visitDefined(label.statement, p)
580
- };
599
+ }));
581
600
  return (0, util_1.updateIfChanged)(label, updates);
582
601
  }
583
602
  async visitLambda(lambda, p) {
@@ -591,14 +610,14 @@ class JavaVisitor extends visitor_1.TreeVisitor {
591
610
  return statement;
592
611
  }
593
612
  lambda = statement;
594
- const updates = {
613
+ const updates = await this.visitChildrenOf(lambda, async () => ({
595
614
  prefix: await this.visitSpace(lambda.prefix, p),
596
615
  markers: await this.visitMarkers(lambda.markers, p),
597
616
  parameters: await this.visitDefined(lambda.parameters, p),
598
617
  arrow: await this.visitSpace(lambda.arrow, p),
599
618
  body: await this.visitDefined(lambda.body, p),
600
619
  type: await this.visitType(lambda.type, p)
601
- };
620
+ }));
602
621
  return (0, util_1.updateIfChanged)(lambda, updates);
603
622
  }
604
623
  async visitLambdaParameters(params, p) {
@@ -628,7 +647,7 @@ class JavaVisitor extends visitor_1.TreeVisitor {
628
647
  return expression;
629
648
  }
630
649
  memberRef = expression;
631
- const updates = {
650
+ const updates = await this.visitChildrenOf(memberRef, async () => ({
632
651
  prefix: await this.visitSpace(memberRef.prefix, p),
633
652
  markers: await this.visitMarkers(memberRef.markers, p),
634
653
  containing: await this.visitRightPadded(memberRef.containing, p),
@@ -637,37 +656,39 @@ class JavaVisitor extends visitor_1.TreeVisitor {
637
656
  type: await this.visitType(memberRef.type, p),
638
657
  methodType: await this.visitType(memberRef.methodType, p),
639
658
  variableType: await this.visitType(memberRef.variableType, p)
640
- };
659
+ }));
641
660
  return (0, util_1.updateIfChanged)(memberRef, updates);
642
661
  }
643
662
  async visitMethodDeclaration(method, p) {
644
- var _a;
645
663
  const statement = await this.visitStatement(method, p);
646
664
  if (!(statement === null || statement === void 0 ? void 0 : statement.kind) || statement.kind !== tree_2.J.Kind.MethodDeclaration) {
647
665
  return statement;
648
666
  }
649
667
  method = statement;
650
- const updates = {
651
- prefix: await this.visitSpace(method.prefix, p),
652
- markers: await this.visitMarkers(method.markers, p),
653
- leadingAnnotations: await (0, util_1.mapAsync)(method.leadingAnnotations, a => this.visitDefined(a, p)),
654
- modifiers: await (0, util_1.mapAsync)(method.modifiers, m => this.visitDefined(m, p)),
655
- nameAnnotations: await (0, util_1.mapAsync)(method.nameAnnotations, a => this.visitDefined(a, p)),
656
- name: await this.visitDefined(method.name, p),
657
- parameters: await this.visitContainer(method.parameters, p),
658
- dimensionsAfterName: await (0, util_1.mapAsync)((_a = method.dimensionsAfterName) !== null && _a !== void 0 ? _a : [], dim => this.visitLeftPadded(dim, p)),
659
- throws: method.throws && await this.visitContainer(method.throws, p),
660
- body: method.body && await this.visitDefined(method.body, p),
661
- defaultValue: await this.visitOptionalLeftPadded(method.defaultValue, p),
662
- methodType: await this.visitType(method.methodType, p)
663
- };
664
- if (method.typeParameters) {
665
- updates.typeParameters = await this.visitDefined(method.typeParameters, p);
666
- }
667
- if (method.returnTypeExpression) {
668
- updates.returnTypeExpression = await this.visitDefined(method.returnTypeExpression, p);
669
- }
670
- return (0, util_1.updateIfChanged)(method, updates);
668
+ return this.visitChildrenOf(method, async () => {
669
+ var _a;
670
+ const updates = {
671
+ prefix: await this.visitSpace(method.prefix, p),
672
+ markers: await this.visitMarkers(method.markers, p),
673
+ leadingAnnotations: await (0, util_1.mapAsync)(method.leadingAnnotations, a => this.visitDefined(a, p)),
674
+ modifiers: await (0, util_1.mapAsync)(method.modifiers, m => this.visitDefined(m, p)),
675
+ nameAnnotations: await (0, util_1.mapAsync)(method.nameAnnotations, a => this.visitDefined(a, p)),
676
+ name: await this.visitDefined(method.name, p),
677
+ parameters: await this.visitContainer(method.parameters, p),
678
+ dimensionsAfterName: await (0, util_1.mapAsync)((_a = method.dimensionsAfterName) !== null && _a !== void 0 ? _a : [], dim => this.visitLeftPadded(dim, p)),
679
+ throws: method.throws && await this.visitContainer(method.throws, p),
680
+ body: method.body && await this.visitDefined(method.body, p),
681
+ defaultValue: await this.visitOptionalLeftPadded(method.defaultValue, p),
682
+ methodType: await this.visitType(method.methodType, p)
683
+ };
684
+ if (method.typeParameters) {
685
+ updates.typeParameters = await this.visitDefined(method.typeParameters, p);
686
+ }
687
+ if (method.returnTypeExpression) {
688
+ updates.returnTypeExpression = await this.visitDefined(method.returnTypeExpression, p);
689
+ }
690
+ return (0, util_1.updateIfChanged)(method, updates);
691
+ });
671
692
  }
672
693
  async visitMethodInvocation(method, p) {
673
694
  const expression = await this.visitExpression(method, p);
@@ -680,7 +701,7 @@ class JavaVisitor extends visitor_1.TreeVisitor {
680
701
  return statement;
681
702
  }
682
703
  method = statement;
683
- const updates = {
704
+ const updates = await this.visitChildrenOf(method, async () => ({
684
705
  prefix: await this.visitSpace(method.prefix, p),
685
706
  markers: await this.visitMarkers(method.markers, p),
686
707
  select: await this.visitOptionalRightPadded(method.select, p),
@@ -688,7 +709,7 @@ class JavaVisitor extends visitor_1.TreeVisitor {
688
709
  name: await this.visitDefined(method.name, p),
689
710
  arguments: await this.visitContainer(method.arguments, p),
690
711
  methodType: await this.visitType(method.methodType, p)
691
- };
712
+ }));
692
713
  return (0, util_1.updateIfChanged)(method, updates);
693
714
  }
694
715
  async visitModifier(modifier, p) {
@@ -713,17 +734,19 @@ class JavaVisitor extends visitor_1.TreeVisitor {
713
734
  return expression;
714
735
  }
715
736
  newArray = expression;
716
- const updates = {
717
- prefix: await this.visitSpace(newArray.prefix, p),
718
- markers: await this.visitMarkers(newArray.markers, p),
719
- dimensions: await (0, util_1.mapAsync)(newArray.dimensions, dim => this.visitDefined(dim, p)),
720
- initializer: await this.visitOptionalContainer(newArray.initializer, p),
721
- type: await this.visitType(newArray.type, p)
722
- };
723
- if (newArray.typeExpression) {
724
- updates.typeExpression = await this.visitDefined(newArray.typeExpression, p);
725
- }
726
- return (0, util_1.updateIfChanged)(newArray, updates);
737
+ return this.visitChildrenOf(newArray, async () => {
738
+ const updates = {
739
+ prefix: await this.visitSpace(newArray.prefix, p),
740
+ markers: await this.visitMarkers(newArray.markers, p),
741
+ dimensions: await (0, util_1.mapAsync)(newArray.dimensions, dim => this.visitDefined(dim, p)),
742
+ initializer: await this.visitOptionalContainer(newArray.initializer, p),
743
+ type: await this.visitType(newArray.type, p)
744
+ };
745
+ if (newArray.typeExpression) {
746
+ updates.typeExpression = await this.visitDefined(newArray.typeExpression, p);
747
+ }
748
+ return (0, util_1.updateIfChanged)(newArray, updates);
749
+ });
727
750
  }
728
751
  async visitNewClass(newClass, p) {
729
752
  const expression = await this.visitExpression(newClass, p);
@@ -736,23 +759,25 @@ class JavaVisitor extends visitor_1.TreeVisitor {
736
759
  return statement;
737
760
  }
738
761
  newClass = statement;
739
- const updates = {
740
- prefix: await this.visitSpace(newClass.prefix, p),
741
- markers: await this.visitMarkers(newClass.markers, p),
742
- new: await this.visitSpace(newClass.new, p),
743
- arguments: await this.visitContainer(newClass.arguments, p),
744
- constructorType: await this.visitType(newClass.constructorType, p)
745
- };
746
- if (newClass.enclosing) {
747
- updates.enclosing = await this.visitRightPadded(newClass.enclosing, p);
748
- }
749
- if (newClass.class) {
750
- updates.class = await this.visitDefined(newClass.class, p);
751
- }
752
- if (newClass.body) {
753
- updates.body = await this.visitDefined(newClass.body, p);
754
- }
755
- return (0, util_1.updateIfChanged)(newClass, updates);
762
+ return this.visitChildrenOf(newClass, async () => {
763
+ const updates = {
764
+ prefix: await this.visitSpace(newClass.prefix, p),
765
+ markers: await this.visitMarkers(newClass.markers, p),
766
+ new: await this.visitSpace(newClass.new, p),
767
+ arguments: await this.visitContainer(newClass.arguments, p),
768
+ constructorType: await this.visitType(newClass.constructorType, p)
769
+ };
770
+ if (newClass.enclosing) {
771
+ updates.enclosing = await this.visitRightPadded(newClass.enclosing, p);
772
+ }
773
+ if (newClass.class) {
774
+ updates.class = await this.visitDefined(newClass.class, p);
775
+ }
776
+ if (newClass.body) {
777
+ updates.body = await this.visitDefined(newClass.body, p);
778
+ }
779
+ return (0, util_1.updateIfChanged)(newClass, updates);
780
+ });
756
781
  }
757
782
  async visitNullableType(nullableType, p) {
758
783
  const expression = await this.visitExpression(nullableType, p);
@@ -760,12 +785,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
760
785
  return expression;
761
786
  }
762
787
  nullableType = expression;
763
- const updates = {
788
+ const updates = await this.visitChildrenOf(nullableType, async () => ({
764
789
  prefix: await this.visitSpace(nullableType.prefix, p),
765
790
  markers: await this.visitMarkers(nullableType.markers, p),
766
791
  annotations: await (0, util_1.mapAsync)(nullableType.annotations, a => this.visitDefined(a, p)),
767
792
  typeTree: await this.visitRightPadded(nullableType.typeTree, p)
768
- };
793
+ }));
769
794
  return (0, util_1.updateIfChanged)(nullableType, updates);
770
795
  }
771
796
  async visitPackage(aPackage, p) {
@@ -785,13 +810,13 @@ class JavaVisitor extends visitor_1.TreeVisitor {
785
810
  return expression;
786
811
  }
787
812
  parameterizedType = expression;
788
- const updates = {
813
+ const updates = await this.visitChildrenOf(parameterizedType, async () => ({
789
814
  prefix: await this.visitSpace(parameterizedType.prefix, p),
790
815
  markers: await this.visitMarkers(parameterizedType.markers, p),
791
816
  class: await this.visitTypeName(parameterizedType.class, p),
792
817
  typeParameters: await this.visitOptionalContainer(parameterizedType.typeParameters, p),
793
818
  type: await this.visitType(parameterizedType.type, p)
794
- };
819
+ }));
795
820
  return (0, util_1.updateIfChanged)(parameterizedType, updates);
796
821
  }
797
822
  async visitParentheses(parentheses, p) {
@@ -800,11 +825,11 @@ class JavaVisitor extends visitor_1.TreeVisitor {
800
825
  return expression;
801
826
  }
802
827
  parentheses = expression;
803
- const updates = {
828
+ const updates = await this.visitChildrenOf(parentheses, async () => ({
804
829
  prefix: await this.visitSpace(parentheses.prefix, p),
805
830
  markers: await this.visitMarkers(parentheses.markers, p),
806
831
  tree: await this.visitRightPadded(parentheses.tree, p)
807
- };
832
+ }));
808
833
  return (0, util_1.updateIfChanged)(parentheses, updates);
809
834
  }
810
835
  async visitParenthesizedTypeTree(parTypeTree, p) {
@@ -813,12 +838,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
813
838
  return expression;
814
839
  }
815
840
  parTypeTree = expression;
816
- const updates = {
841
+ const updates = await this.visitChildrenOf(parTypeTree, async () => ({
817
842
  prefix: await this.visitSpace(parTypeTree.prefix, p),
818
843
  markers: await this.visitMarkers(parTypeTree.markers, p),
819
844
  annotations: await (0, util_1.mapAsync)(parTypeTree.annotations, a => this.visitDefined(a, p)),
820
845
  parenthesizedType: await this.visitDefined(parTypeTree.parenthesizedType, p)
821
- };
846
+ }));
822
847
  return (0, util_1.updateIfChanged)(parTypeTree, updates);
823
848
  }
824
849
  async visitPrimitive(primitive, p) {
@@ -840,14 +865,16 @@ class JavaVisitor extends visitor_1.TreeVisitor {
840
865
  return statement;
841
866
  }
842
867
  ret = statement;
843
- const updates = {
844
- prefix: await this.visitSpace(ret.prefix, p),
845
- markers: await this.visitMarkers(ret.markers, p)
846
- };
847
- if (ret.expression) {
848
- updates.expression = await this.visitDefined(ret.expression, p);
849
- }
850
- return (0, util_1.updateIfChanged)(ret, updates);
868
+ return this.visitChildrenOf(ret, async () => {
869
+ const updates = {
870
+ prefix: await this.visitSpace(ret.prefix, p),
871
+ markers: await this.visitMarkers(ret.markers, p)
872
+ };
873
+ if (ret.expression) {
874
+ updates.expression = await this.visitDefined(ret.expression, p);
875
+ }
876
+ return (0, util_1.updateIfChanged)(ret, updates);
877
+ });
851
878
  }
852
879
  async visitSwitch(aSwitch, p) {
853
880
  const statement = await this.visitStatement(aSwitch, p);
@@ -855,12 +882,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
855
882
  return statement;
856
883
  }
857
884
  aSwitch = statement;
858
- const updates = {
885
+ const updates = await this.visitChildrenOf(aSwitch, async () => ({
859
886
  prefix: await this.visitSpace(aSwitch.prefix, p),
860
887
  markers: await this.visitMarkers(aSwitch.markers, p),
861
888
  selector: await this.visitDefined(aSwitch.selector, p),
862
889
  cases: await this.visitDefined(aSwitch.cases, p)
863
- };
890
+ }));
864
891
  return (0, util_1.updateIfChanged)(aSwitch, updates);
865
892
  }
866
893
  async visitSwitchExpression(switchExpr, p) {
@@ -869,13 +896,13 @@ class JavaVisitor extends visitor_1.TreeVisitor {
869
896
  return expression;
870
897
  }
871
898
  switchExpr = expression;
872
- const updates = {
899
+ const updates = await this.visitChildrenOf(switchExpr, async () => ({
873
900
  prefix: await this.visitSpace(switchExpr.prefix, p),
874
901
  markers: await this.visitMarkers(switchExpr.markers, p),
875
902
  selector: await this.visitDefined(switchExpr.selector, p),
876
903
  cases: await this.visitDefined(switchExpr.cases, p),
877
904
  type: await this.visitType(switchExpr.type, p)
878
- };
905
+ }));
879
906
  return (0, util_1.updateIfChanged)(switchExpr, updates);
880
907
  }
881
908
  async visitSynchronized(sync, p) {
@@ -884,12 +911,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
884
911
  return statement;
885
912
  }
886
913
  sync = statement;
887
- const updates = {
914
+ const updates = await this.visitChildrenOf(sync, async () => ({
888
915
  prefix: await this.visitSpace(sync.prefix, p),
889
916
  markers: await this.visitMarkers(sync.markers, p),
890
917
  lock: await this.visitDefined(sync.lock, p),
891
918
  body: await this.visitDefined(sync.body, p)
892
- };
919
+ }));
893
920
  return (0, util_1.updateIfChanged)(sync, updates);
894
921
  }
895
922
  async visitTernary(ternary, p) {
@@ -903,14 +930,14 @@ class JavaVisitor extends visitor_1.TreeVisitor {
903
930
  return statement;
904
931
  }
905
932
  ternary = statement;
906
- const updates = {
933
+ const updates = await this.visitChildrenOf(ternary, async () => ({
907
934
  prefix: await this.visitSpace(ternary.prefix, p),
908
935
  markers: await this.visitMarkers(ternary.markers, p),
909
936
  condition: await this.visitDefined(ternary.condition, p),
910
937
  truePart: await this.visitLeftPadded(ternary.truePart, p),
911
938
  falsePart: await this.visitLeftPadded(ternary.falsePart, p),
912
939
  type: await this.visitType(ternary.type, p)
913
- };
940
+ }));
914
941
  return (0, util_1.updateIfChanged)(ternary, updates);
915
942
  }
916
943
  async visitThrow(thrown, p) {
@@ -919,11 +946,11 @@ class JavaVisitor extends visitor_1.TreeVisitor {
919
946
  return statement;
920
947
  }
921
948
  thrown = statement;
922
- const updates = {
949
+ const updates = await this.visitChildrenOf(thrown, async () => ({
923
950
  prefix: await this.visitSpace(thrown.prefix, p),
924
951
  markers: await this.visitMarkers(thrown.markers, p),
925
952
  exception: await this.visitDefined(thrown.exception, p)
926
- };
953
+ }));
927
954
  return (0, util_1.updateIfChanged)(thrown, updates);
928
955
  }
929
956
  async visitTry(tryable, p) {
@@ -932,14 +959,14 @@ class JavaVisitor extends visitor_1.TreeVisitor {
932
959
  return statement;
933
960
  }
934
961
  tryable = statement;
935
- const updates = {
962
+ const updates = await this.visitChildrenOf(tryable, async () => ({
936
963
  prefix: await this.visitSpace(tryable.prefix, p),
937
964
  markers: await this.visitMarkers(tryable.markers, p),
938
965
  resources: await this.visitOptionalContainer(tryable.resources, p),
939
966
  body: await this.visitDefined(tryable.body, p),
940
967
  catches: await (0, util_1.mapAsync)(tryable.catches, c => this.visitDefined(c, p)),
941
968
  finally: await this.visitOptionalLeftPadded(tryable.finally, p)
942
- };
969
+ }));
943
970
  return (0, util_1.updateIfChanged)(tryable, updates);
944
971
  }
945
972
  async visitTryResource(resource, p) {
@@ -965,12 +992,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
965
992
  return expression;
966
993
  }
967
994
  typeCast = expression;
968
- const updates = {
995
+ const updates = await this.visitChildrenOf(typeCast, async () => ({
969
996
  prefix: await this.visitSpace(typeCast.prefix, p),
970
997
  markers: await this.visitMarkers(typeCast.markers, p),
971
998
  class: await this.visitDefined(typeCast.class, p),
972
999
  expression: await this.visitDefined(typeCast.expression, p)
973
- };
1000
+ }));
974
1001
  return (0, util_1.updateIfChanged)(typeCast, updates);
975
1002
  }
976
1003
  async visitTypeParameter(typeParam, p) {
@@ -1004,13 +1031,13 @@ class JavaVisitor extends visitor_1.TreeVisitor {
1004
1031
  return statement;
1005
1032
  }
1006
1033
  unary = statement;
1007
- const updates = {
1034
+ const updates = await this.visitChildrenOf(unary, async () => ({
1008
1035
  prefix: await this.visitSpace(unary.prefix, p),
1009
1036
  markers: await this.visitMarkers(unary.markers, p),
1010
1037
  operator: await this.visitLeftPadded(unary.operator, p),
1011
1038
  expression: await this.visitDefined(unary.expression, p),
1012
1039
  type: await this.visitType(unary.type, p)
1013
- };
1040
+ }));
1014
1041
  return (0, util_1.updateIfChanged)(unary, updates);
1015
1042
  }
1016
1043
  async visitUnknown(unknown, p) {
@@ -1024,11 +1051,11 @@ class JavaVisitor extends visitor_1.TreeVisitor {
1024
1051
  return statement;
1025
1052
  }
1026
1053
  unknown = statement;
1027
- const updates = {
1054
+ const updates = await this.visitChildrenOf(unknown, async () => ({
1028
1055
  prefix: await this.visitSpace(unknown.prefix, p),
1029
1056
  markers: await this.visitMarkers(unknown.markers, p),
1030
1057
  source: await this.visitDefined(unknown.source, p)
1031
- };
1058
+ }));
1032
1059
  return (0, util_1.updateIfChanged)(unknown, updates);
1033
1060
  }
1034
1061
  async visitUnknownSource(source, p) {
@@ -1044,20 +1071,22 @@ class JavaVisitor extends visitor_1.TreeVisitor {
1044
1071
  return statement;
1045
1072
  }
1046
1073
  varDecls = statement;
1047
- const updates = {
1048
- prefix: await this.visitSpace(varDecls.prefix, p),
1049
- markers: await this.visitMarkers(varDecls.markers, p),
1050
- leadingAnnotations: await (0, util_1.mapAsync)(varDecls.leadingAnnotations, a => this.visitDefined(a, p)),
1051
- modifiers: await (0, util_1.mapAsync)(varDecls.modifiers, m => this.visitDefined(m, p)),
1052
- variables: await (0, util_1.mapAsync)(varDecls.variables, v => this.visitRightPadded(v, p))
1053
- };
1054
- if (varDecls.typeExpression) {
1055
- updates.typeExpression = await this.visitDefined(varDecls.typeExpression, p);
1056
- }
1057
- if (varDecls.varargs) {
1058
- updates.varargs = await this.visitSpace(varDecls.varargs, p);
1059
- }
1060
- return (0, util_1.updateIfChanged)(varDecls, updates);
1074
+ return this.visitChildrenOf(varDecls, async () => {
1075
+ const updates = {
1076
+ prefix: await this.visitSpace(varDecls.prefix, p),
1077
+ markers: await this.visitMarkers(varDecls.markers, p),
1078
+ leadingAnnotations: await (0, util_1.mapAsync)(varDecls.leadingAnnotations, a => this.visitDefined(a, p)),
1079
+ modifiers: await (0, util_1.mapAsync)(varDecls.modifiers, m => this.visitDefined(m, p)),
1080
+ variables: await (0, util_1.mapAsync)(varDecls.variables, v => this.visitRightPadded(v, p))
1081
+ };
1082
+ if (varDecls.typeExpression) {
1083
+ updates.typeExpression = await this.visitDefined(varDecls.typeExpression, p);
1084
+ }
1085
+ if (varDecls.varargs) {
1086
+ updates.varargs = await this.visitSpace(varDecls.varargs, p);
1087
+ }
1088
+ return (0, util_1.updateIfChanged)(varDecls, updates);
1089
+ });
1061
1090
  }
1062
1091
  async visitVariable(variable, p) {
1063
1092
  const updates = {
@@ -1076,12 +1105,12 @@ class JavaVisitor extends visitor_1.TreeVisitor {
1076
1105
  return statement;
1077
1106
  }
1078
1107
  whileLoop = statement;
1079
- const updates = {
1108
+ const updates = await this.visitChildrenOf(whileLoop, async () => ({
1080
1109
  prefix: await this.visitSpace(whileLoop.prefix, p),
1081
1110
  markers: await this.visitMarkers(whileLoop.markers, p),
1082
1111
  condition: await this.visitDefined(whileLoop.condition, p),
1083
1112
  body: await this.visitRightPadded(whileLoop.body, p)
1084
- };
1113
+ }));
1085
1114
  return (0, util_1.updateIfChanged)(whileLoop, updates);
1086
1115
  }
1087
1116
  async visitWildcard(wildcard, p) {
@@ -1090,15 +1119,17 @@ class JavaVisitor extends visitor_1.TreeVisitor {
1090
1119
  return expression;
1091
1120
  }
1092
1121
  wildcard = expression;
1093
- const updates = {
1094
- prefix: await this.visitSpace(wildcard.prefix, p),
1095
- markers: await this.visitMarkers(wildcard.markers, p),
1096
- bound: await this.visitOptionalLeftPadded(wildcard.bound, p)
1097
- };
1098
- if (wildcard.boundedType) {
1099
- updates.boundedType = await this.visitTypeName(wildcard.boundedType, p);
1100
- }
1101
- return (0, util_1.updateIfChanged)(wildcard, updates);
1122
+ return this.visitChildrenOf(wildcard, async () => {
1123
+ const updates = {
1124
+ prefix: await this.visitSpace(wildcard.prefix, p),
1125
+ markers: await this.visitMarkers(wildcard.markers, p),
1126
+ bound: await this.visitOptionalLeftPadded(wildcard.bound, p)
1127
+ };
1128
+ if (wildcard.boundedType) {
1129
+ updates.boundedType = await this.visitTypeName(wildcard.boundedType, p);
1130
+ }
1131
+ return (0, util_1.updateIfChanged)(wildcard, updates);
1132
+ });
1102
1133
  }
1103
1134
  async visitYield(aYield, p) {
1104
1135
  const statement = await this.visitStatement(aYield, p);
@@ -1106,15 +1137,17 @@ class JavaVisitor extends visitor_1.TreeVisitor {
1106
1137
  return statement;
1107
1138
  }
1108
1139
  aYield = statement;
1109
- const updates = {
1110
- prefix: await this.visitSpace(aYield.prefix, p),
1111
- markers: await this.visitMarkers(aYield.markers, p)
1112
- };
1113
- // a bare `yield` has no value
1114
- if (aYield.value) {
1115
- updates.value = await this.visitDefined(aYield.value, p);
1116
- }
1117
- return (0, util_1.updateIfChanged)(aYield, updates);
1140
+ return this.visitChildrenOf(aYield, async () => {
1141
+ const updates = {
1142
+ prefix: await this.visitSpace(aYield.prefix, p),
1143
+ markers: await this.visitMarkers(aYield.markers, p)
1144
+ };
1145
+ // a bare `yield` has no value
1146
+ if (aYield.value) {
1147
+ updates.value = await this.visitDefined(aYield.value, p);
1148
+ }
1149
+ return (0, util_1.updateIfChanged)(aYield, updates);
1150
+ });
1118
1151
  }
1119
1152
  async visitOptionalRightPadded(right, p) {
1120
1153
  return right ? this.visitRightPadded(right, p) : undefined;