File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,7 +124,10 @@ function getAnnotation(node){
124124 }
125125
126126 for ( var i = 0 ; i < node . leadingComments . length ; i ++ ) {
127- let value = node . leadingComments [ i ] . value . trim ( ) ;
127+ let value = node . leadingComments [ i ] . value
128+ . replace ( / ^ [ \s \* ] * / , '' )
129+ . replace ( / [ \s \* ] * $ / , '' )
130+ . trim ( ) ;
128131
129132 if ( value === "@ngInject" ) {
130133 return true ;
Original file line number Diff line number Diff line change @@ -387,6 +387,17 @@ module.exports = {
387387 } ) ;
388388 }
389389 }
390+ } ,
391+ {
392+ name : "var x = /** @ngInject **/ function($scope)" ,
393+ input : function ( ) {
394+ var x = /** @ngInject **/ function ( $scope ) {
395+ } ;
396+ } ,
397+ expected : function ( ) {
398+ var x = /** @ngInject **/ function ( $scope ) { } ;
399+ x . $inject = [ "$scope" ]
400+ }
390401 }
391402 ] . map ( t => { t . explicit = true ; return t ; } )
392403}
You can’t perform that action at this time.
0 commit comments