revert change of trailing comment parsing

This commit is contained in:
Klaus Meinhardt 2019-01-27 17:41:20 +01:00
parent 68133e5fad
commit 451ff29263
2 changed files with 0 additions and 20 deletions

View file

@ -664,9 +664,6 @@ namespace ts {
let collecting = trailing;
let accumulator = initial;
if (pos === 0) {
if (collecting) {
return accumulator;
}
collecting = true;
const shebang = getShebang(text);
if (shebang) {

View file

@ -28,22 +28,5 @@ namespace ts {
assert.strictEqual(result!.length, 1);
assert.strictEqual(result![0].kind, SyntaxKind.SingleLineCommentTrivia);
});
it("returns no trailing comments at start of file", () => {
const result = getTrailingCommentRanges(noShebang, 0);
assert.isUndefined(result);
});
it("returns no trailing comments at start of file if shebang is present", () => {
const result = getTrailingCommentRanges(withShebang, 0);
assert.isUndefined(result);
});
it("returns trailing comments if position is not 0", () => {
const result = getTrailingCommentRanges(withTrailing, 1);
assert.isDefined(result);
assert.strictEqual(result!.length, 1);
assert.strictEqual(result![0].kind, SyntaxKind.MultiLineCommentTrivia);
});
});
}