Skip to content

Commit e860d48

Browse files
committed
Stop searching for comment directive if the previous line is not empty
1 parent 168be30 commit e860d48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/program.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1802,9 +1802,9 @@ namespace ts {
18021802
return line;
18031803
}
18041804

1805-
// Stop searching if the line is not empty and not a comment
1805+
// Stop searching if the line is not empty
18061806
const lineText = file.text.slice(lineStarts[line], lineStarts[line + 1]).trim();
1807-
if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) {
1807+
if (lineText !== "") {
18081808
return -1;
18091809
}
18101810

0 commit comments

Comments
 (0)