@@ -18,7 +18,7 @@ import { ngWalkerFactoryUtils } from './ngWalkerFactoryUtils';
18
18
import { Config } from './config' ;
19
19
20
20
import { logger } from '../util/logger' ;
21
- import { getDecoratorName } from '../util/utils' ;
21
+ import { getDecoratorName , maybeNodeArray } from '../util/utils' ;
22
22
23
23
const getDecoratorStringArgs = ( decorator : ts . Decorator ) => {
24
24
let baseExpr = < any > decorator . expression || { } ;
@@ -59,17 +59,17 @@ export class NgWalker extends Lint.RuleWalker {
59
59
} else if ( metadata instanceof DirectiveMetadata ) {
60
60
this . visitNgDirective ( metadata ) ;
61
61
}
62
- ( < ts . Decorator [ ] > declaration . decorators || [ ] ) . forEach ( this . visitClassDecorator . bind ( this ) ) ;
62
+ maybeNodeArray ( < ts . NodeArray < ts . Decorator > > declaration . decorators ) . forEach ( this . visitClassDecorator . bind ( this ) ) ;
63
63
super . visitClassDeclaration ( declaration ) ;
64
64
}
65
65
66
66
visitMethodDeclaration ( method : ts . MethodDeclaration ) {
67
- ( < ts . Decorator [ ] > method . decorators || [ ] ) . forEach ( this . visitMethodDecorator . bind ( this ) ) ;
67
+ maybeNodeArray ( < ts . NodeArray < ts . Decorator > > method . decorators ) . forEach ( this . visitMethodDecorator . bind ( this ) ) ;
68
68
super . visitMethodDeclaration ( method ) ;
69
69
}
70
70
71
71
visitPropertyDeclaration ( prop : ts . PropertyDeclaration ) {
72
- ( < ts . Decorator [ ] > prop . decorators || [ ] ) . forEach ( this . visitPropertyDecorator . bind ( this ) ) ;
72
+ maybeNodeArray ( < ts . NodeArray < ts . Decorator > > prop . decorators ) . forEach ( this . visitPropertyDecorator . bind ( this ) ) ;
73
73
super . visitPropertyDeclaration ( prop ) ;
74
74
}
75
75
@@ -227,10 +227,10 @@ export class NgWalker extends Lint.RuleWalker {
227
227
}
228
228
const sf = ts . createSourceFile ( path , `\`${ content } \`` , ts . ScriptTarget . ES5 ) ;
229
229
const original = sf . getFullText ;
230
- sf . getFullText = function ( ) {
230
+ sf . getFullText = ( ) => {
231
231
const text = original . apply ( sf ) ;
232
232
return text . substring ( 1 , text . length - 1 ) ;
233
- } . bind ( sf ) ;
233
+ } ;
234
234
return sf ;
235
235
}
236
236
}
0 commit comments