Breakpoint validation for export assignment

This commit is contained in:
Sheetal Nandi 2014-10-17 20:40:28 -07:00
parent 3663550d89
commit 2905217d4e
3 changed files with 24 additions and 0 deletions

View File

@ -119,6 +119,9 @@ module ts.BreakpointResolver {
case SyntaxKind.ThrowStatement:
return spanInThrowStatement(<ThrowStatement>node);
case SyntaxKind.ExportAssignment:
return spanInExportAssignment(<ExportAssignment>node);
case SyntaxKind.BinaryExpression:
case SyntaxKind.PostfixOperator:
case SyntaxKind.PrefixOperator:
@ -351,6 +354,10 @@ module ts.BreakpointResolver {
return textSpan(throwStatement, throwStatement.expression);
}
function spanInExportAssignment(exportAssignment: ExportAssignment): TypeScript.TextSpan {
return textSpan(exportAssignment, exportAssignment.exportName);
}
function spanInExpression(expression: Expression): TypeScript.TextSpan {
//TODO (pick this up later) for now lets fix do-while baseline if (node.parent.kind === SyntaxKind.DoStatement) {
// Set span as if on while keyword

View File

@ -0,0 +1,17 @@
1 >class a {
~~~~~~~~~~ => Pos: (0 to 9) SpanInfo: undefined
--------------------------------
2 > public c;
~~~~~~~~~~~~~~ => Pos: (10 to 23) SpanInfo: undefined
--------------------------------
3 >}
~~ => Pos: (24 to 25) SpanInfo: undefined
--------------------------------
4 >export = a;
~~~~~~~~~~~ => Pos: (26 to 36) SpanInfo: {"start":26,"length":10}
>export = a
>:=> (line 4, col 0) to (line 4, col 10)