mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 07:45:18 -06:00
Breakpoint validation for export assignment
This commit is contained in:
parent
3663550d89
commit
2905217d4e
@ -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
|
||||
|
||||
17
tests/baselines/reference/bpSpan_exportAssignment.baseline
Normal file
17
tests/baselines/reference/bpSpan_exportAssignment.baseline
Normal 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)
|
||||
Loading…
x
Reference in New Issue
Block a user