@@ -18,7 +18,7 @@ import { ngWalkerFactoryUtils } from './ngWalkerFactoryUtils';
1818import { Config } from './config' ;
1919
2020import { logger } from '../util/logger' ;
21- import { getDecoratorName } from '../util/utils' ;
21+ import { getDecoratorName , maybeNodeArray } from '../util/utils' ;
2222
2323const getDecoratorStringArgs = ( decorator : ts . Decorator ) => {
2424 let baseExpr = < any > decorator . expression || { } ;
@@ -59,17 +59,17 @@ export class NgWalker extends Lint.RuleWalker {
5959 } else if ( metadata instanceof DirectiveMetadata ) {
6060 this . visitNgDirective ( metadata ) ;
6161 }
62- ( < ts . Decorator [ ] > declaration . decorators || [ ] ) . forEach ( this . visitClassDecorator . bind ( this ) ) ;
62+ maybeNodeArray ( < ts . NodeArray < ts . Decorator > > declaration . decorators ) . forEach ( this . visitClassDecorator . bind ( this ) ) ;
6363 super . visitClassDeclaration ( declaration ) ;
6464 }
6565
6666 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 ) ) ;
6868 super . visitMethodDeclaration ( method ) ;
6969 }
7070
7171 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 ) ) ;
7373 super . visitPropertyDeclaration ( prop ) ;
7474 }
7575
@@ -227,10 +227,10 @@ export class NgWalker extends Lint.RuleWalker {
227227 }
228228 const sf = ts . createSourceFile ( path , `\`${ content } \`` , ts . ScriptTarget . ES5 ) ;
229229 const original = sf . getFullText ;
230- sf . getFullText = function ( ) {
230+ sf . getFullText = ( ) => {
231231 const text = original . apply ( sf ) ;
232232 return text . substring ( 1 , text . length - 1 ) ;
233- } . bind ( sf ) ;
233+ } ;
234234 return sf ;
235235 }
236236}
0 commit comments