()
| 69 | |
| 70 | // Fire callbacks |
| 71 | fire = function() { |
| 72 | |
| 73 | // Enforce single-firing |
| 74 | locked = locked || options.once; |
| 75 | |
| 76 | // Execute callbacks for all pending executions, |
| 77 | // respecting firingIndex overrides and runtime changes |
| 78 | fired = firing = true; |
| 79 | for ( ; queue.length; firingIndex = -1 ) { |
| 80 | memory = queue.shift(); |
| 81 | while ( ++firingIndex < list.length ) { |
| 82 | |
| 83 | // Run callback and check for early termination |
| 84 | if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && |
| 85 | options.stopOnFalse ) { |
| 86 | |
| 87 | // Jump to end and forget the data so .add doesn't re-fire |
| 88 | firingIndex = list.length; |
| 89 | memory = false; |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | // Forget the data if we're done with it |
| 95 | if ( !options.memory ) { |
| 96 | memory = false; |
| 97 | } |
| 98 | |
| 99 | firing = false; |
| 100 | |
| 101 | // Clean up if we're done firing for good |
| 102 | if ( locked ) { |
| 103 | |
| 104 | // Keep an empty list if we have data for future add calls |
| 105 | if ( memory ) { |
| 106 | list = []; |
| 107 | |
| 108 | // Otherwise, this object is spent |
| 109 | } else { |
| 110 | list = ""; |
| 111 | } |
| 112 | } |
| 113 | }, |
| 114 | |
| 115 | // Actual Callbacks object |
| 116 | self = { |
no test coverage detected
searching dependent graphs…