Add lint rule to check that Debug.assert calls do not eagerly interpolate strings (#17125)

* And lint rule to check that `Debug.assert` calls do not eagerly interpolate strings

* Use more specific 'assert' functions to avoid callbacks

* Respond to PR feedback
This commit is contained in:
Andy
2017-08-08 07:56:14 -07:00
committed by GitHub
parent a9a30d76fb
commit ceae613e4c
10 changed files with 95 additions and 17 deletions

View File

@@ -363,7 +363,7 @@ namespace ts.server {
return map(this.program.getSourceFiles(), sourceFile => {
const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.path);
if (!scriptInfo) {
Debug.assert(false, `scriptInfo for a file '${sourceFile.fileName}' is missing.`);
Debug.fail(`scriptInfo for a file '${sourceFile.fileName}' is missing.`);
}
return scriptInfo;
});