Add support for //@check directives

This commit is contained in:
Mohamed Hegazy committed 2017-03-06 13:50:27 -08:00
1 parent 0b1fff7e66
commit 9f0c5ce141
4 files changed
+9 -1

No files matched your search

+5
View File
@@ -5817,6 +5817,7 @@ namespace ts {
const typeReferenceDirectives: FileReference[] = [];
const amdDependencies: { path: string; name: string }[] = [];
let amdModuleName: string;
let hasCheckDirective = false;
// Keep scanning all the leading trivia in the file until we get to something that
// isn't trivia. Any single line comment will be analyzed to see if it is a
@@ -5878,6 +5879,9 @@ namespace ts {
amdDependencies.push(amdDependency);
}
}
const checkDirectiveRegEx = /^\/\/\s*@check\s*/gim;
hasCheckDirective = hasCheckDirective || !!checkDirectiveRegEx.exec(comment);
}
}
@@ -5885,6 +5889,7 @@ namespace ts {
sourceFile.typeReferenceDirectives = typeReferenceDirectives;
sourceFile.amdDependencies = amdDependencies;
sourceFile.moduleName = amdModuleName;
sourceFile.hasCheckDirective = hasCheckDirective;
}
function setExternalModuleIndicator(sourceFile: SourceFile) {