@@ -440,9 +440,10 @@ export abstract class Node {
440
440
441
441
static createBlockStatement (
442
442
statements : Statement [ ] ,
443
+ label : IdentifierExpression | null ,
443
444
range : Range
444
445
) : BlockStatement {
445
- return new BlockStatement ( statements , range ) ;
446
+ return new BlockStatement ( statements , label , range ) ;
446
447
}
447
448
448
449
static createBreakStatement (
@@ -475,9 +476,10 @@ export abstract class Node {
475
476
static createDoStatement (
476
477
body : Statement ,
477
478
condition : Expression ,
479
+ label : IdentifierExpression | null ,
478
480
range : Range
479
481
) : DoStatement {
480
- return new DoStatement ( body , condition , range ) ;
482
+ return new DoStatement ( body , condition , label , range ) ;
481
483
}
482
484
483
485
static createEmptyStatement (
@@ -548,9 +550,10 @@ export abstract class Node {
548
550
condition : Expression ,
549
551
ifTrue : Statement ,
550
552
ifFalse : Statement | null ,
553
+ label : IdentifierExpression | null ,
551
554
range : Range
552
555
) : IfStatement {
553
- return new IfStatement ( condition , ifTrue , ifFalse , range ) ;
556
+ return new IfStatement ( condition , ifTrue , ifFalse , label , range ) ;
554
557
}
555
558
556
559
static createImportStatement (
@@ -607,18 +610,20 @@ export abstract class Node {
607
610
condition : Expression | null ,
608
611
incrementor : Expression | null ,
609
612
body : Statement ,
613
+ label : IdentifierExpression | null ,
610
614
range : Range
611
615
) : ForStatement {
612
- return new ForStatement ( initializer , condition , incrementor , body , range ) ;
616
+ return new ForStatement ( initializer , condition , incrementor , body , label , range ) ;
613
617
}
614
618
615
619
static createForOfStatement (
616
620
variable : Statement ,
617
621
iterable : Expression ,
618
622
body : Statement ,
623
+ label : IdentifierExpression | null ,
619
624
range : Range
620
625
) : ForOfStatement {
621
- return new ForOfStatement ( variable , iterable , body , range ) ;
626
+ return new ForOfStatement ( variable , iterable , body , label , range ) ;
622
627
}
623
628
624
629
static createFunctionDeclaration (
@@ -675,9 +680,10 @@ export abstract class Node {
675
680
static createSwitchStatement (
676
681
condition : Expression ,
677
682
cases : SwitchCase [ ] ,
683
+ label : IdentifierExpression | null ,
678
684
range : Range
679
685
) : SwitchStatement {
680
- return new SwitchStatement ( condition , cases , range ) ;
686
+ return new SwitchStatement ( condition , cases , label , range ) ;
681
687
}
682
688
683
689
static createSwitchCase (
@@ -700,9 +706,10 @@ export abstract class Node {
700
706
catchVariable : IdentifierExpression | null ,
701
707
catchStatements : Statement [ ] | null ,
702
708
finallyStatements : Statement [ ] | null ,
709
+ label : IdentifierExpression | null ,
703
710
range : Range
704
711
) : TryStatement {
705
- return new TryStatement ( bodyStatements , catchVariable , catchStatements , finallyStatements , range ) ;
712
+ return new TryStatement ( bodyStatements , catchVariable , catchStatements , finallyStatements , label , range ) ;
706
713
}
707
714
708
715
static createTypeDeclaration (
@@ -753,9 +760,10 @@ export abstract class Node {
753
760
static createWhileStatement (
754
761
condition : Expression ,
755
762
statement : Statement ,
763
+ label : IdentifierExpression | null ,
756
764
range : Range
757
765
) : WhileStatement {
758
- return new WhileStatement ( condition , statement , range ) ;
766
+ return new WhileStatement ( condition , statement , label , range ) ;
759
767
}
760
768
761
769
/** Tests if this node is a literal of the specified kind. */
@@ -1788,6 +1796,8 @@ export class BlockStatement extends Statement {
1788
1796
constructor (
1789
1797
/** Contained statements. */
1790
1798
public statements : Statement [ ] ,
1799
+ /** Label, if any. */
1800
+ public label : IdentifierExpression | null ,
1791
1801
/** Source range. */
1792
1802
range : Range
1793
1803
) {
@@ -1858,6 +1868,8 @@ export class DoStatement extends Statement {
1858
1868
public body : Statement ,
1859
1869
/** Condition when to repeat. */
1860
1870
public condition : Expression ,
1871
+ /** Label, if any. */
1872
+ public label : IdentifierExpression | null ,
1861
1873
/** Source range. */
1862
1874
range : Range
1863
1875
) {
@@ -2022,6 +2034,8 @@ export class ForStatement extends Statement {
2022
2034
public incrementor : Expression | null ,
2023
2035
/** Body statement being looped over. */
2024
2036
public body : Statement ,
2037
+ /** Label, if any. */
2038
+ public label : IdentifierExpression | null ,
2025
2039
/** Source range. */
2026
2040
range : Range
2027
2041
) {
@@ -2038,6 +2052,8 @@ export class ForOfStatement extends Statement {
2038
2052
public iterable : Expression ,
2039
2053
/** Body statement being looped over. */
2040
2054
public body : Statement ,
2055
+ /** Label, if any. */
2056
+ public label : IdentifierExpression | null ,
2041
2057
/** Source range. */
2042
2058
range : Range
2043
2059
) {
@@ -2108,6 +2124,8 @@ export class IfStatement extends Statement {
2108
2124
public ifTrue : Statement ,
2109
2125
/** Statement executed when condition is `false`. */
2110
2126
public ifFalse : Statement | null ,
2127
+ /** Label, if any. */
2128
+ public label : IdentifierExpression | null ,
2111
2129
/** Source range. */
2112
2130
range : Range
2113
2131
) {
@@ -2258,6 +2276,8 @@ export class SwitchStatement extends Statement {
2258
2276
public condition : Expression ,
2259
2277
/** Contained cases. */
2260
2278
public cases : SwitchCase [ ] ,
2279
+ /** Label, if any. */
2280
+ public label : IdentifierExpression | null ,
2261
2281
/** Source range. */
2262
2282
range : Range
2263
2283
) {
@@ -2288,6 +2308,8 @@ export class TryStatement extends Statement {
2288
2308
public catchStatements : Statement [ ] | null ,
2289
2309
/** Statements being executed afterwards, if a `finally` clause is present. */
2290
2310
public finallyStatements : Statement [ ] | null ,
2311
+ /** Label, if any. */
2312
+ public label : IdentifierExpression | null ,
2291
2313
/** Source range. */
2292
2314
range : Range
2293
2315
) {
@@ -2382,6 +2404,8 @@ export class WhileStatement extends Statement {
2382
2404
public condition : Expression ,
2383
2405
/** Body statement being looped over. */
2384
2406
public body : Statement ,
2407
+ /** Label, if any. */
2408
+ public label : IdentifierExpression | null ,
2385
2409
/** Source range. */
2386
2410
range : Range
2387
2411
) {
0 commit comments