File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ function inspectAssignment(path, ctx){
227
227
228
228
function inspectDeclarator ( path , ctx ) {
229
229
const node = path . node ;
230
- if ( ! isFunctionExpressionOrArrow ( node . init ) ) {
230
+ if ( ! isFunctionExpressionOrArrow ( node . init ) && ! t . isClassExpression ( node . init ) ) {
231
231
return ;
232
232
}
233
233
@@ -270,7 +270,14 @@ function inspectClassMethod(path, ctx){
270
270
const ancestry = path . getAncestry ( ) ;
271
271
for ( var i = 0 ; i < ancestry . length ; i ++ ) {
272
272
let ancestor = ancestry [ i ] ;
273
- if ( ancestor . isClassDeclaration ( ) ) {
273
+
274
+ // Adds the variable declaration of 'MyClass' to the suspects in the case of
275
+ // let MyClass = class MyClass {
276
+ // /* @ngInject */
277
+ // constructor() {
278
+ // }
279
+ // }
280
+ if ( ancestor . isClassDeclaration ( ) || ancestor . isClassExpression ( ) ) {
274
281
addSuspect ( ancestor , ctx , ! annotation ) ;
275
282
return ;
276
283
}
You can’t perform that action at this time.
0 commit comments