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', () => {
2323
2424 expect ( expressions ) . toContain ( 'super(1)' ) ;
2525 } ) ;
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+ } ) ;
2641} ) ;
2742
2843describe ( 'usage example' , ( ) => {
Original file line number Diff line number Diff line change @@ -475,6 +475,7 @@ expression
475475 )
476476 | expression ' [' expression ' ]'
477477 | methodCall
478+ | SUPER superSuffix
478479 | NEW creator
479480 | ' (' typeType ' )' expression
480481 | expression postfix=(' ++' | ' --' )
@@ -524,7 +525,7 @@ lambdaBody
524525primary
525526 : ' (' expression ' )'
526527 | THIS
527- | SUPER superSuffix
528+ | SUPER
528529 | literal
529530 | IDENTIFIER
530531 | typeTypeOrVoid ' .' CLASS
You can’t perform that action at this time.
0 commit comments