Exported variables can have breakpoint even if they do not have initializer

This commit is contained in:
Sheetal Nandi 2014-10-21 18:09:05 -07:00
parent e464a3d6fb
commit e87f18cc63
3 changed files with 78 additions and 3 deletions

View File

@ -270,7 +270,7 @@ module ts.BreakpointResolver {
: undefined;
// Breakpoint is possible in variableDeclaration only if there is initialization
if (variableDeclaration.initializer) {
if (variableDeclaration.initializer || (variableDeclaration.flags & NodeFlags.Export)) {
if (declarations && declarations[0] === variableDeclaration) {
if (isParentVariableStatement) {
// First declaration - include var keyword

View File

@ -16,8 +16,75 @@
>:=> (line 3, col 0) to (line 3, col 10)
--------------------------------
4 >var c2, d2 = 10;
~~~~~~~ => Pos: (37 to 43) SpanInfo: undefined
4 >var c2, d2 = 10;
~~~~~~~~~ => Pos: (44 to 52) SpanInfo: {"start":45,"length":7}
~~~~~~~~~~ => Pos: (44 to 53) SpanInfo: {"start":45,"length":7}
>d2 = 10
>:=> (line 4, col 8) to (line 4, col 15)
>:=> (line 4, col 8) to (line 4, col 15)
--------------------------------
5 >module m {
~~~~~~~~~~~ => Pos: (54 to 64) SpanInfo: {"start":54,"length":146}
>module m {
> var x1;
> var x2 = 10, x3 = 10;
> var x4, x5;
> export var xx1;
> export var xx2 = 10, xx3 = 10;
> export var xx4, xx5;
>}
>:=> (line 5, col 0) to (line 12, col 1)
--------------------------------
6 > var x1;
~~~~~~~~~~~~ => Pos: (65 to 76) SpanInfo: undefined
--------------------------------
7 > var x2 = 10, x3 = 10;
~~~~~~~~~~~~~~~~ => Pos: (77 to 92) SpanInfo: {"start":81,"length":11}
>var x2 = 10
>:=> (line 7, col 4) to (line 7, col 15)
7 > var x2 = 10, x3 = 10;
~~~~~~~~~~ => Pos: (93 to 102) SpanInfo: {"start":94,"length":7}
>x3 = 10
>:=> (line 7, col 17) to (line 7, col 24)
--------------------------------
8 > var x4, x5;
~~~~~~~~~~~~~~~~ => Pos: (103 to 118) SpanInfo: undefined
--------------------------------
9 > export var xx1;
~~~~~~~~~~~~~~~~~~~~ => Pos: (119 to 138) SpanInfo: {"start":123,"length":14}
>export var xx1
>:=> (line 9, col 4) to (line 9, col 18)
--------------------------------
10 > export var xx2 = 10, xx3 = 10;
~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (139 to 162) SpanInfo: {"start":143,"length":19}
>export var xx2 = 10
>:=> (line 10, col 4) to (line 10, col 23)
10 > export var xx2 = 10, xx3 = 10;
~~~~~~~~~~~ => Pos: (163 to 173) SpanInfo: {"start":164,"length":8}
>xx3 = 10
>:=> (line 10, col 25) to (line 10, col 33)
--------------------------------
11 > export var xx4, xx5;
~~~~~~~~~~~~~~~~~~~ => Pos: (174 to 192) SpanInfo: {"start":178,"length":14}
>export var xx4
>:=> (line 11, col 4) to (line 11, col 18)
11 > export var xx4, xx5;
~~~~~~ => Pos: (193 to 198) SpanInfo: {"start":194,"length":3}
>xx5
>:=> (line 11, col 20) to (line 11, col 23)
--------------------------------
12 >}
~ => Pos: (199 to 199) SpanInfo: {"start":199,"length":1}
>}
>:=> (line 12, col 0) to (line 12, col 1)

View File

@ -6,5 +6,13 @@
////var b;
////var c = 10, d, e;
////var c2, d2 = 10;
////module m {
//// var x1;
//// var x2 = 10, x3 = 10;
//// var x4, x5;
//// export var xx1;
//// export var xx2 = 10, xx3 = 10;
//// export var xx4, xx5;
////}
verify.baselineCurrentFileBreakpointLocations();