Move bug URLs into assert messages

This commit is contained in:
Andrew Casey 2018-01-26 11:12:34 -08:00
parent 8ec36e988d
commit 9bc0d33512
2 changed files with 6 additions and 9 deletions

View File

@ -687,14 +687,13 @@ namespace ts {
: skipTrivia(sourceFile.text, errorNode.pos);
// These asserts should all be satisfied for a properly constructed `errorNode`.
// Upstream from https://github.com/Microsoft/TypeScript/issues/20809.
if (isMissing) {
Debug.assert(pos === errorNode.pos);
Debug.assert(pos === errorNode.end);
Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");
Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");
}
else {
Debug.assert(pos >= errorNode.pos);
Debug.assert(pos <= errorNode.end);
Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");
Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");
}
return createTextSpanFromBounds(pos, errorNode.end);

View File

@ -336,13 +336,11 @@ namespace ts.refactor.extractSymbol {
Return = 1 << 2
}
// This assert is upstream from https://github.com/Microsoft/TypeScript/issues/20809.
// We believe it's true because the node is from the (unmodified) tree.
Debug.assert(nodeToCheck.pos <= nodeToCheck.end);
Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");
// This assert is upstream from https://github.com/Microsoft/TypeScript/issues/20809.
// For understanding how skipTrivia functioned:
Debug.assert(!positionIsSynthesized(nodeToCheck.pos));
Debug.assert(!positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809");
if (!isStatement(nodeToCheck) && !(isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) {
return [createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)];