This repository was archived by the owner on Jan 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +27
-27
lines changed Expand file tree Collapse file tree 5 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -588,15 +588,16 @@ function getTokenType(token) {
588588 * @returns {ESTreeToken } the converted ESTreeToken
589589 */
590590function 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 ) ,
593594 newToken = {
594595 type : getTokenType ( token ) ,
595596 value,
596597 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 )
600601 } ;
601602
602603 if ( newToken . type === "RegularExpression" ) {
Original file line number Diff line number Diff line change @@ -512,15 +512,15 @@ module.exports = {
512512 } ,
513513 {
514514 "type" : "JSXText" ,
515- "value" : "" ,
515+ "value" : "\n " ,
516516 "range" : [
517- 60 ,
517+ 47 ,
518518 60
519519 ] ,
520520 "loc" : {
521521 "start" : {
522- "line" : 4 ,
523- "column" : 12
522+ "line" : 3 ,
523+ "column" : 13
524524 } ,
525525 "end" : {
526526 "line" : 4 ,
@@ -566,15 +566,15 @@ module.exports = {
566566 } ,
567567 {
568568 "type" : "JSXText" ,
569- "value" : "" ,
569+ "value" : "\n " ,
570570 "range" : [
571- 82 ,
571+ 73 ,
572572 82
573573 ] ,
574574 "loc" : {
575575 "start" : {
576- "line" : 5 ,
577- "column" : 8
576+ "line" : 4 ,
577+ "column" : 25
578578 } ,
579579 "end" : {
580580 "line" : 5 ,
Original file line number Diff line number Diff line change @@ -459,15 +459,15 @@ module.exports = {
459459 } ,
460460 {
461461 "type" : "JSXText" ,
462- "value" : "" ,
462+ "value" : "\n " ,
463463 "range" : [
464- 112 ,
464+ 103 ,
465465 112
466466 ] ,
467467 "loc" : {
468468 "start" : {
469- "line" : 7 ,
470- "column" : 8
469+ "line" : 6 ,
470+ "column" : 9
471471 } ,
472472 "end" : {
473473 "line" : 7 ,
Original file line number Diff line number Diff line change @@ -276,15 +276,15 @@ module.exports = {
276276 } ,
277277 {
278278 "type" : "JSXText" ,
279- "value" : "" ,
279+ "value" : "\n " ,
280280 "range" : [
281- 10 ,
281+ 5 ,
282282 10
283283 ] ,
284284 "loc" : {
285285 "start" : {
286- "line" : 2 ,
287- "column" : 4
286+ "line" : 1 ,
287+ "column" : 5
288288 } ,
289289 "end" : {
290290 "line" : 2 ,
@@ -366,15 +366,15 @@ module.exports = {
366366 } ,
367367 {
368368 "type" : "JSXText" ,
369- "value" : "" ,
369+ "value" : "\n " ,
370370 "range" : [
371- 18 ,
371+ 17 ,
372372 18
373373 ] ,
374374 "loc" : {
375375 "start" : {
376- "line" : 3 ,
377- "column" : 0
376+ "line" : 2 ,
377+ "column" : 11
378378 } ,
379379 "end" : {
380380 "line" : 3 ,
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ const FIXTURES_DIR = "./tests/fixtures/ecma-features";
2929const filesWithOutsandingTSIssues = [
3030 "jsx/embedded-tags" , // https://github.com/Microsoft/TypeScript/issues/7410
3131 "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
3433] ;
3534
3635const testFiles = shelljs . find ( FIXTURES_DIR )
You can’t perform that action at this time.
0 commit comments