Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 451ff29

Browse filesBrowse files
committed
revert change of trailing comment parsing
1 parent 68133e5 commit 451ff29
Copy full SHA for 451ff29

2 files changed

-20Lines changed: 0 additions & 20 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/scanner.ts‎

Copy file name to clipboardExpand all lines: src/compiler/scanner.ts
-3Lines 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) {
Collapse file

‎src/testRunner/unittests/comments.ts‎

Copy file name to clipboardExpand all lines: src/testRunner/unittests/comments.ts
-17Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.