mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 17:27:54 -05:00
Ensure comments before // @Filename are not part of the following virtual test file (#57579)
This commit is contained in:
@@ -1232,6 +1232,10 @@ export namespace TestCaseParser {
|
||||
else {
|
||||
// First metadata marker in the file
|
||||
currentFileName = testMetaData[2].trim();
|
||||
if (currentFileContent && ts.skipTrivia(currentFileContent, 0, /*stopAfterLineBreak*/ false, /*stopAtComments*/ false) !== currentFileContent.length) {
|
||||
throw new Error("Non-comment test content appears before the first '// @Filename' directive");
|
||||
}
|
||||
currentFileContent = "";
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user