This repository was archived by the owner on Jan 19, 2019. It is now read-only.
File tree 5 files changed +27
-27
lines changed
5 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -588,15 +588,16 @@ function getTokenType(token) {
588
588
* @returns {ESTreeToken } the converted ESTreeToken
589
589
*/
590
590
function convertToken ( token , ast ) {
591
- const start = token . getStart ( ) ,
592
- value = ast . text . slice ( start , token . end ) ,
591
+ const start = ( token . kind === SyntaxKind . JsxText ) ? token . getFullStart ( ) : token . getStart ( ) ,
592
+ end = token . getEnd ( ) ,
593
+ value = ast . text . slice ( start , end ) ,
593
594
newToken = {
594
595
type : getTokenType ( token ) ,
595
596
value,
596
597
start,
597
- end : token . end ,
598
- range : [ start , token . end ] ,
599
- loc : getLoc ( token , ast )
598
+ end,
599
+ range : [ start , end ] ,
600
+ loc : getLocFor ( start , end , ast )
600
601
} ;
601
602
602
603
if ( newToken . type === "RegularExpression" ) {
Original file line number Diff line number Diff line change @@ -512,15 +512,15 @@ module.exports = {
512
512
} ,
513
513
{
514
514
"type" : "JSXText" ,
515
- "value" : "" ,
515
+ "value" : "\n " ,
516
516
"range" : [
517
- 60 ,
517
+ 47 ,
518
518
60
519
519
] ,
520
520
"loc" : {
521
521
"start" : {
522
- "line" : 4 ,
523
- "column" : 12
522
+ "line" : 3 ,
523
+ "column" : 13
524
524
} ,
525
525
"end" : {
526
526
"line" : 4 ,
@@ -566,15 +566,15 @@ module.exports = {
566
566
} ,
567
567
{
568
568
"type" : "JSXText" ,
569
- "value" : "" ,
569
+ "value" : "\n " ,
570
570
"range" : [
571
- 82 ,
571
+ 73 ,
572
572
82
573
573
] ,
574
574
"loc" : {
575
575
"start" : {
576
- "line" : 5 ,
577
- "column" : 8
576
+ "line" : 4 ,
577
+ "column" : 25
578
578
} ,
579
579
"end" : {
580
580
"line" : 5 ,
Original file line number Diff line number Diff line change @@ -459,15 +459,15 @@ module.exports = {
459
459
} ,
460
460
{
461
461
"type" : "JSXText" ,
462
- "value" : "" ,
462
+ "value" : "\n " ,
463
463
"range" : [
464
- 112 ,
464
+ 103 ,
465
465
112
466
466
] ,
467
467
"loc" : {
468
468
"start" : {
469
- "line" : 7 ,
470
- "column" : 8
469
+ "line" : 6 ,
470
+ "column" : 9
471
471
} ,
472
472
"end" : {
473
473
"line" : 7 ,
Original file line number Diff line number Diff line change @@ -276,15 +276,15 @@ module.exports = {
276
276
} ,
277
277
{
278
278
"type" : "JSXText" ,
279
- "value" : "" ,
279
+ "value" : "\n " ,
280
280
"range" : [
281
- 10 ,
281
+ 5 ,
282
282
10
283
283
] ,
284
284
"loc" : {
285
285
"start" : {
286
- "line" : 2 ,
287
- "column" : 4
286
+ "line" : 1 ,
287
+ "column" : 5
288
288
} ,
289
289
"end" : {
290
290
"line" : 2 ,
@@ -366,15 +366,15 @@ module.exports = {
366
366
} ,
367
367
{
368
368
"type" : "JSXText" ,
369
- "value" : "" ,
369
+ "value" : "\n " ,
370
370
"range" : [
371
- 18 ,
371
+ 17 ,
372
372
18
373
373
] ,
374
374
"loc" : {
375
375
"start" : {
376
- "line" : 3 ,
377
- "column" : 0
376
+ "line" : 2 ,
377
+ "column" : 11
378
378
} ,
379
379
"end" : {
380
380
"line" : 3 ,
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ const FIXTURES_DIR = "./tests/fixtures/ecma-features";
29
29
const filesWithOutsandingTSIssues = [
30
30
"jsx/embedded-tags" , // https://github.com/Microsoft/TypeScript/issues/7410
31
31
"jsx/namespaced-attribute-and-value-inserted" , // https://github.com/Microsoft/TypeScript/issues/7411
32
- "jsx/namespaced-name-and-attribute" , // https://github.com/Microsoft/TypeScript/issues/7411
33
- "jsx/multiple-blank-spaces"
32
+ "jsx/namespaced-name-and-attribute" // https://github.com/Microsoft/TypeScript/issues/7411
34
33
] ;
35
34
36
35
const testFiles = shelljs . find ( FIXTURES_DIR )
You can’t perform that action at this time.
0 commit comments