Skip to content

Commit 451ff29

Browse files
committed
revert change of trailing comment parsing
1 parent 68133e5 commit 451ff29

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/compiler/scanner.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,6 @@ namespace ts {
664664
let collecting = trailing;
665665
let accumulator = initial;
666666
if (pos === 0) {
667-
if (collecting) {
668-
return accumulator;
669-
}
670667
collecting = true;
671668
const shebang = getShebang(text);
672669
if (shebang) {

src/testRunner/unittests/comments.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,5 @@ namespace ts {
2828
assert.strictEqual(result!.length, 1);
2929
assert.strictEqual(result![0].kind, SyntaxKind.SingleLineCommentTrivia);
3030
});
31-
32-
it("returns no trailing comments at start of file", () => {
33-
const result = getTrailingCommentRanges(noShebang, 0);
34-
assert.isUndefined(result);
35-
});
36-
37-
it("returns no trailing comments at start of file if shebang is present", () => {
38-
const result = getTrailingCommentRanges(withShebang, 0);
39-
assert.isUndefined(result);
40-
});
41-
42-
it("returns trailing comments if position is not 0", () => {
43-
const result = getTrailingCommentRanges(withTrailing, 1);
44-
assert.isDefined(result);
45-
assert.strictEqual(result!.length, 1);
46-
assert.strictEqual(result![0].kind, SyntaxKind.MultiLineCommentTrivia);
47-
});
4831
});
4932
}

0 commit comments

Comments
 (0)