File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,21 @@ describe('parser', () => {
23
23
24
24
expect ( expressions ) . toContain ( 'super(1)' ) ;
25
25
} ) ;
26
+
27
+ it ( 'should allow super alone as expression' , ( ) => {
28
+ const tree = parse ( `
29
+ class B extends A {
30
+ public B() {
31
+ super;
32
+ }
33
+ }
34
+ ` ) ;
35
+
36
+ const expressions = [ ] ;
37
+ walk ( { enterExpression : ( c ) => expressions . push ( c . text ) } , tree ) ;
38
+
39
+ expect ( expressions ) . toContain ( 'super' ) ;
40
+ } ) ;
26
41
} ) ;
27
42
28
43
describe ( 'usage example' , ( ) => {
Original file line number Diff line number Diff line change @@ -475,6 +475,7 @@ expression
475
475
)
476
476
| expression ' [' expression ' ]'
477
477
| methodCall
478
+ | SUPER superSuffix
478
479
| NEW creator
479
480
| ' (' typeType ' )' expression
480
481
| expression postfix=(' ++' | ' --' )
@@ -524,7 +525,7 @@ lambdaBody
524
525
primary
525
526
: ' (' expression ' )'
526
527
| THIS
527
- | SUPER superSuffix
528
+ | SUPER
528
529
| literal
529
530
| IDENTIFIER
530
531
| typeTypeOrVoid ' .' CLASS
You can’t perform that action at this time.
0 commit comments