Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
183acba
commit e15a5c7
Showing
4 changed files
with
214 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/babel-parser/test/fixtures/comments/regression/11469/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class A { | ||
test() { | ||
// this.member = 'value'; | ||
} | ||
|
||
/* Trailing comment */ | ||
} | ||
|
||
class B { | ||
test() { | ||
// this.member = 'value'; | ||
} | ||
} | ||
|
||
class C { | ||
test() {} | ||
// this.member = 'value'; | ||
} |
177 changes: 177 additions & 0 deletions
177
packages/babel-parser/test/fixtures/comments/regression/11469/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":193,"loc":{"start":{"line":1,"column":0},"end":{"line":18,"column":1}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":193,"loc":{"start":{"line":1,"column":0},"end":{"line":18,"column":1}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"A"}, | ||
"name": "A" | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":8,"end":82,"loc":{"start":{"line":1,"column":8},"end":{"line":7,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "ClassMethod", | ||
"start":12,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, | ||
"static": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6},"identifierName":"test"}, | ||
"name": "test" | ||
}, | ||
"computed": false, | ||
"kind": "method", | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":19,"end":54,"loc":{"start":{"line":2,"column":9},"end":{"line":4,"column":3}}, | ||
"body": [], | ||
"directives": [], | ||
"innerComments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " this.member = 'value';", | ||
"start":25,"end":50,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":29}} | ||
} | ||
] | ||
}, | ||
"trailingComments": [ | ||
{ | ||
"type": "CommentBlock", | ||
"value": " Trailing comment ", | ||
"start":58,"end":80,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":24}} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":84,"end":140,"loc":{"start":{"line":9,"column":0},"end":{"line":13,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":90,"end":91,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":7},"identifierName":"B"}, | ||
"name": "B" | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":92,"end":140,"loc":{"start":{"line":9,"column":8},"end":{"line":13,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "ClassMethod", | ||
"start":96,"end":138,"loc":{"start":{"line":10,"column":2},"end":{"line":12,"column":3}}, | ||
"static": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":96,"end":100,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":6},"identifierName":"test"}, | ||
"name": "test" | ||
}, | ||
"computed": false, | ||
"kind": "method", | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":103,"end":138,"loc":{"start":{"line":10,"column":9},"end":{"line":12,"column":3}}, | ||
"body": [], | ||
"directives": [], | ||
"innerComments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " this.member = 'value';", | ||
"start":109,"end":134,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":29}} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":142,"end":193,"loc":{"start":{"line":15,"column":0},"end":{"line":18,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":148,"end":149,"loc":{"start":{"line":15,"column":6},"end":{"line":15,"column":7},"identifierName":"C"}, | ||
"name": "C" | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":150,"end":193,"loc":{"start":{"line":15,"column":8},"end":{"line":18,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "ClassMethod", | ||
"start":154,"end":163,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":11}}, | ||
"static": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":154,"end":158,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":6},"identifierName":"test"}, | ||
"name": "test" | ||
}, | ||
"computed": false, | ||
"kind": "method", | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":161,"end":163,"loc":{"start":{"line":16,"column":9},"end":{"line":16,"column":11}}, | ||
"body": [], | ||
"directives": [] | ||
}, | ||
"trailingComments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " this.member = 'value';", | ||
"start":166,"end":191,"loc":{"start":{"line":17,"column":2},"end":{"line":17,"column":27}} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
}, | ||
"comments": [ | ||
{ | ||
"type": "CommentLine", | ||
"value": " this.member = 'value';", | ||
"start":25,"end":50,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":29}} | ||
}, | ||
{ | ||
"type": "CommentBlock", | ||
"value": " Trailing comment ", | ||
"start":58,"end":80,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":24}} | ||
}, | ||
{ | ||
"type": "CommentLine", | ||
"value": " this.member = 'value';", | ||
"start":109,"end":134,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":29}} | ||
}, | ||
{ | ||
"type": "CommentLine", | ||
"value": " this.member = 'value';", | ||
"start":166,"end":191,"loc":{"start":{"line":17,"column":2},"end":{"line":17,"column":27}} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ Bar | |
/*:: <R>*/ | ||
|
||
/*g*/ | ||
{} | ||
/*h*/ | ||
|
||
{ | ||
/*h*/ | ||
} | ||
/*i*/ |