( data )
| 58 | stack = !options.once && [], |
| 59 | // Fire callbacks |
| 60 | fire = function( data ) { |
| 61 | memory = options.memory && data; |
| 62 | fired = true; |
| 63 | firingIndex = firingStart || 0; |
| 64 | firingStart = 0; |
| 65 | firingLength = list.length; |
| 66 | firing = true; |
| 67 | for ( ; list && firingIndex < firingLength; firingIndex++ ) { |
| 68 | if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { |
| 69 | memory = false; // To prevent further calls using add |
| 70 | break; |
| 71 | } |
| 72 | } |
| 73 | firing = false; |
| 74 | if ( list ) { |
| 75 | if ( stack ) { |
| 76 | if ( stack.length ) { |
| 77 | fire( stack.shift() ); |
| 78 | } |
| 79 | } else if ( memory ) { |
| 80 | list = []; |
| 81 | } else { |
| 82 | self.disable(); |
| 83 | } |
| 84 | } |
| 85 | }, |
| 86 | // Actual Callbacks object |
| 87 | self = { |
| 88 | // Add a callback or a collection of callbacks to the list |
no test coverage detected
searching dependent graphs…