Merge branch 'assertOnMissingNodes' into release-1.1

This commit is contained in:
Mohamed Hegazy
2014-09-19 12:43:52 -07:00
3 changed files with 858 additions and 1 deletions

View File

@@ -654,7 +654,7 @@ module ts {
// applying some stricter checks on that node.
function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void {
var span = getErrorSpanForNode(node);
var start = skipTrivia(file.text, span.pos);
var start = span.end > span.pos ? skipTrivia(file.text, span.pos) : span.pos;
var length = span.end - start;
file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2));