File tree 5 files changed +35
-38
lines changed
parser/tests/lib/__snapshots__
5 files changed +35
-38
lines changed Original file line number Diff line number Diff line change @@ -21333,12 +21333,12 @@ Object {
21333
21333
"line": 4,
21334
21334
},
21335
21335
"start": Object {
21336
- "column": 14 ,
21336
+ "column": 22 ,
21337
21337
"line": 4,
21338
21338
},
21339
21339
},
21340
21340
"range": Array [
21341
- 116 ,
21341
+ 124 ,
21342
21342
140,
21343
21343
],
21344
21344
"right": Object {
@@ -21439,12 +21439,12 @@ Object {
21439
21439
"line": 5,
21440
21440
},
21441
21441
"start": Object {
21442
- "column": 14 ,
21442
+ "column": 31 ,
21443
21443
"line": 5,
21444
21444
},
21445
21445
},
21446
21446
"range": Array [
21447
- 156 ,
21447
+ 173 ,
21448
21448
197,
21449
21449
],
21450
21450
"right": Object {
@@ -24453,12 +24453,12 @@ Object {
24453
24453
"line": 4,
24454
24454
},
24455
24455
"start": Object {
24456
- "column": 14 ,
24456
+ "column": 24 ,
24457
24457
"line": 4,
24458
24458
},
24459
24459
},
24460
24460
"range": Array [
24461
- 120 ,
24461
+ 130 ,
24462
24462
146,
24463
24463
],
24464
24464
"right": Object {
@@ -24559,12 +24559,12 @@ Object {
24559
24559
"line": 5,
24560
24560
},
24561
24561
"start": Object {
24562
- "column": 14 ,
24562
+ "column": 33 ,
24563
24563
"line": 5,
24564
24564
},
24565
24565
},
24566
24566
"range": Array [
24567
- 162 ,
24567
+ 181 ,
24568
24568
205,
24569
24569
],
24570
24570
"right": Object {
@@ -25579,12 +25579,12 @@ Object {
25579
25579
"line": 4,
25580
25580
},
25581
25581
"start": Object {
25582
- "column": 14 ,
25582
+ "column": 21 ,
25583
25583
"line": 4,
25584
25584
},
25585
25585
},
25586
25586
"range": Array [
25587
- 114 ,
25587
+ 121 ,
25588
25588
137,
25589
25589
],
25590
25590
"right": Object {
@@ -25685,12 +25685,12 @@ Object {
25685
25685
"line": 5,
25686
25686
},
25687
25687
"start": Object {
25688
- "column": 14 ,
25688
+ "column": 30 ,
25689
25689
"line": 5,
25690
25690
},
25691
25691
},
25692
25692
"range": Array [
25693
- 153 ,
25693
+ 169 ,
25694
25694
193,
25695
25695
],
25696
25696
"right": Object {
@@ -26633,12 +26633,12 @@ Object {
26633
26633
"line": 3,
26634
26634
},
26635
26635
"start": Object {
26636
- "column": 14 ,
26636
+ "column": 23 ,
26637
26637
"line": 3,
26638
26638
},
26639
26639
},
26640
26640
"range": Array [
26641
- 68 ,
26641
+ 77 ,
26642
26642
103,
26643
26643
],
26644
26644
"right": Object {
Original file line number Diff line number Diff line change @@ -1318,6 +1318,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
1318
1318
left : parameter ,
1319
1319
right : convertChild ( node . initializer )
1320
1320
} ) ;
1321
+
1322
+ if ( node . modifiers ) {
1323
+ // AssignmentPattern should not contain modifiers in range
1324
+ result . range [ 0 ] = parameter . range [ 0 ] ;
1325
+ result . loc = getLocFor ( result . range [ 0 ] , result . range [ 1 ] , ast ) ;
1326
+ }
1321
1327
} else {
1322
1328
parameter = result = convert ( {
1323
1329
node : node . name ,
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ export function hasModifier(
161
161
* @param node TypeScript AST node
162
162
* @returns returns last modifier if present or null
163
163
*/
164
- export function getLastModifier ( node : ts . Node ) : ts . Node | null {
164
+ export function getLastModifier ( node : ts . Node ) : ts . Modifier | null {
165
165
return (
166
166
( ! ! node . modifiers &&
167
167
! ! node . modifiers . length &&
Original file line number Diff line number Diff line change @@ -341,15 +341,6 @@ tester.addFixturePatternConfig('typescript/basics', {
341
341
'abstract-class-with-abstract-method' , // babel parse errors
342
342
'abstract-class-with-optional-method' , // babel parse errors
343
343
'declare-class-with-optional-method' , // babel parse errors
344
- /**
345
- * Was expected to be fixed by PR into Babel: https://github.com/babel/babel/pull/9284
346
- * But not fixed in Babel 7.3
347
- * TODO: Investigate differences
348
- */
349
- 'class-with-private-parameter-properties' ,
350
- 'class-with-protected-parameter-properties' ,
351
- 'class-with-public-parameter-properties' ,
352
- 'class-with-readonly-parameter-properties' ,
353
344
/**
354
345
* Was expected to be fixed by PR into Babel: https://github.com/babel/babel/pull/9302
355
346
* But not fixed in Babel 7.3
Original file line number Diff line number Diff line change @@ -21291,12 +21291,12 @@ Object {
21291
21291
"line": 4,
21292
21292
},
21293
21293
"start": Object {
21294
- "column": 14 ,
21294
+ "column": 22 ,
21295
21295
"line": 4,
21296
21296
},
21297
21297
},
21298
21298
"range": Array [
21299
- 116 ,
21299
+ 124 ,
21300
21300
140,
21301
21301
],
21302
21302
"right": Object {
@@ -21397,12 +21397,12 @@ Object {
21397
21397
"line": 5,
21398
21398
},
21399
21399
"start": Object {
21400
- "column": 14 ,
21400
+ "column": 31 ,
21401
21401
"line": 5,
21402
21402
},
21403
21403
},
21404
21404
"range": Array [
21405
- 156 ,
21405
+ 173 ,
21406
21406
197,
21407
21407
],
21408
21408
"right": Object {
@@ -24408,12 +24408,12 @@ Object {
24408
24408
"line": 4,
24409
24409
},
24410
24410
"start": Object {
24411
- "column": 14 ,
24411
+ "column": 24 ,
24412
24412
"line": 4,
24413
24413
},
24414
24414
},
24415
24415
"range": Array [
24416
- 120 ,
24416
+ 130 ,
24417
24417
146,
24418
24418
],
24419
24419
"right": Object {
@@ -24514,12 +24514,12 @@ Object {
24514
24514
"line": 5,
24515
24515
},
24516
24516
"start": Object {
24517
- "column": 14 ,
24517
+ "column": 33 ,
24518
24518
"line": 5,
24519
24519
},
24520
24520
},
24521
24521
"range": Array [
24522
- 162 ,
24522
+ 181 ,
24523
24523
205,
24524
24524
],
24525
24525
"right": Object {
@@ -25533,12 +25533,12 @@ Object {
25533
25533
"line": 4,
25534
25534
},
25535
25535
"start": Object {
25536
- "column": 14 ,
25536
+ "column": 21 ,
25537
25537
"line": 4,
25538
25538
},
25539
25539
},
25540
25540
"range": Array [
25541
- 114 ,
25541
+ 121 ,
25542
25542
137,
25543
25543
],
25544
25544
"right": Object {
@@ -25639,12 +25639,12 @@ Object {
25639
25639
"line": 5,
25640
25640
},
25641
25641
"start": Object {
25642
- "column": 14 ,
25642
+ "column": 30 ,
25643
25643
"line": 5,
25644
25644
},
25645
25645
},
25646
25646
"range": Array [
25647
- 153 ,
25647
+ 169 ,
25648
25648
193,
25649
25649
],
25650
25650
"right": Object {
@@ -26586,12 +26586,12 @@ Object {
26586
26586
"line": 3,
26587
26587
},
26588
26588
"start": Object {
26589
- "column": 14 ,
26589
+ "column": 23 ,
26590
26590
"line": 3,
26591
26591
},
26592
26592
},
26593
26593
"range": Array [
26594
- 68 ,
26594
+ 77 ,
26595
26595
103,
26596
26596
],
26597
26597
"right": Object {
You can’t perform that action at this time.
0 commit comments