File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,7 +131,9 @@ define(function(require) {
131131 Group . prototype . removeChild = function ( child ) {
132132 var idx = util . indexOf ( this . _children , child ) ;
133133
134- this . _children . splice ( idx , 1 ) ;
134+ if ( idx >= 0 ) {
135+ this . _children . splice ( idx , 1 ) ;
136+ }
135137 child . parent = null ;
136138
137139 if ( this . _storage ) {
Original file line number Diff line number Diff line change @@ -425,7 +425,10 @@ define(
425425
426426 var animator = this . animation . animate ( target , { loop : loop } )
427427 . done ( function ( ) {
428- animators . splice ( el . __animators . indexOf ( animator ) , 1 ) ;
428+ var idx = util . indexOf ( el . __animators , animator ) ;
429+ if ( idx >= 0 ) {
430+ animators . splice ( idx , 1 ) ;
431+ }
429432 if ( animators . length === 0 ) {
430433 // 从animatingElements里移除
431434 var idx = util . indexOf ( animatingElements , el ) ;
@@ -454,7 +457,10 @@ define(
454457 }
455458 if ( len > 0 ) {
456459 var animatingElements = this . animatingElements ;
457- animatingElements . splice ( animatingElements . indexOf ( el ) , 1 ) ;
460+ var idx = util . indexOf ( animatingElements , el ) ;
461+ if ( idx >= 0 ) {
462+ animatingElements . splice ( idx , 1 ) ;
463+ }
458464 }
459465
460466 animators . length = 0 ;
You can’t perform that action at this time.
0 commit comments