File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ var $$CoreAnimateQueueProvider = function() {
163163var $AnimateProvider = [ '$provide' , function ( $provide ) {
164164 var provider = this ;
165165
166- this . $$registeredAnimations = [ ] ;
166+ this . $$registeredAnimations = Object . create ( null ) ;
167167
168168 /**
169169 * @ngdoc method
Original file line number Diff line number Diff line change @@ -115,6 +115,21 @@ describe("$animate", function() {
115115 inject ( ) ;
116116 } ) ;
117117
118+ it ( "should register the animation and be available for lookup" , function ( ) {
119+ var provider ;
120+ module ( function ( $animateProvider ) {
121+ provider = $animateProvider ;
122+ } ) ;
123+ inject ( function ( ) {
124+ // by using hasOwnProperty we know for sure that the lookup object is an empty object
125+ // instead of inhertiting properties from its original prototype.
126+ expect ( provider . $$registeredAnimations . hasOwnProperty ) . toBeFalsy ( ) ;
127+
128+ provider . register ( '.filter' , noop ) ;
129+ expect ( provider . $$registeredAnimations [ 'filter' ] ) . toBe ( '.filter-animation' ) ;
130+ } ) ;
131+ } ) ;
132+
118133 it ( "should apply and retain inline styles on the element that is animated" , inject ( function ( $animate , $rootScope ) {
119134 var element = jqLite ( '<div></div>' ) ;
120135 var parent = jqLite ( '<div></div>' ) ;
You can’t perform that action at this time.
0 commit comments