This repository was archived by the owner on Apr 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +1
-24
lines changed
packages/angular_devkit/build_optimizer/src/transforms Expand file tree Collapse file tree 2 files changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ export function findTopLevelFunctions(parentNode: ts.Node): ts.Node[] {
70
70
topLevelFunctions . push ( node . parent ) ;
71
71
} else if ( ( node . kind === ts . SyntaxKind . CallExpression
72
72
|| node . kind === ts . SyntaxKind . NewExpression )
73
- && ! isSuperCall ( node )
74
73
&& ! hasPureComment ( node )
75
74
) {
76
75
topLevelFunctions . push ( node ) ;
@@ -118,9 +117,3 @@ function hasPureComment(node: ts.Node) {
118
117
119
118
return leadingComment && leadingComment . some ( ( comment ) => comment . text === pureFunctionComment ) ;
120
119
}
121
-
122
- function isSuperCall ( node : ts . Node ) {
123
- const callExpr = node as ts . CallExpression ;
124
-
125
- return callExpr . expression && callExpr . expression . kind === ts . SyntaxKind . SuperKeyword ;
126
- }
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ describe('prefix-functions', () => {
83
83
expect ( oneLine `${ transform ( input ) } ` ) . toEqual ( oneLine `${ output } ` ) ;
84
84
} ) ;
85
85
86
- it ( 'doesn\'t add comment when inside function declarations or expressions' , ( ) => {
86
+ it ( 'doesn\'t adds comment when inside function declarations or expressions' , ( ) => {
87
87
const input = stripIndent `
88
88
function funcDecl() {
89
89
var newClazz = Clazz();
@@ -102,21 +102,5 @@ describe('prefix-functions', () => {
102
102
103
103
expect ( oneLine `${ transform ( input ) } ` ) . toEqual ( oneLine `${ output } ` ) ;
104
104
} ) ;
105
-
106
- it ( 'doesn\'t add comment to super calls' , ( ) => {
107
- const input = oneLine `
108
- class ExtendedClass extends BaseClass {
109
- constructor(e) {
110
- super(e);
111
- }
112
- }
113
- ` ;
114
- const output = stripIndent `
115
- ${ emptyImportsComment }
116
- ${ input }
117
- ` ;
118
-
119
- expect ( oneLine `${ transform ( input ) } ` ) . toEqual ( oneLine `${ output } ` ) ;
120
- } ) ;
121
105
} ) ;
122
106
} ) ;
You can’t perform that action at this time.
0 commit comments