assets/itsa-mojitonthefly.client.js
function (type) {
            var targets = this._targets.slice(),
                known   = {},
                args    = arguments.length > 1 && toArray(arguments, 1, true),
                target, subs,
                i, j, jlen, guid, callback;

            // Add index 0 and 1 entries for use in Y.bind.apply(Y, args) below.
            // Index 0 will be set to the callback, and index 1 will be left as null
            // resulting in Y.bind.apply(Y, [callback, null, arg0,...argN])
            if (args) {
                args.unshift(null, null);
            }

            // Breadth-first notification order, mimicking resolution order
            // Note: Not caching a length comparator because this pushes to the end
            // of the targets array as it iterates.
            for (i = 0; i < targets.length; ++i) {
                target = targets[i];

                if (targets[i]._evts) {
                    // Not that this should ever happen, but don't push known
                    // promise targets onto the list again. That would make for an
                    // infinite loop
                    guid = Y.stamp(targets[i]);

                    if (known[guid]) {
                        continue;
                    }

                    known[guid] = 1;

                    // Queue any child promises to get notified
                    targets.push.apply(targets, targets[i]._evts.targets);

                    // Notify subscribers
                    subs = target._evts.subs[type];

                    if (subs) {
                        for (j = 0, jlen = subs.length; j < jlen; ++j) {
                            callback = subs[j];

                            if (args) {
                                args[0]  = callback;
                                callback = Y.bind.apply(Y, args);
                            }

                            // Force async to mimic resolution lifecycle, and
                            // each callback in its own event loop turn to
                            // avoid swallowing errors and errors breaking the
                            // current js thread.
                            // TODO: would synchronous notifications be better?
                            Y.soon(callback);
                        }
                    }
                }
            }

            return this;
        }
function (type) {
            var targets = this._targets.slice(),
                known   = {},
                args    = arguments.length > 1 && toArray(arguments, 1, true),
                target, subs,
                i, j, jlen, guid, callback;

            // Add index 0 and 1 entries for use in Y.bind.apply(Y, args) below.
            // Index 0 will be set to the callback, and index 1 will be left as null
            // resulting in Y.bind.apply(Y, [callback, null, arg0,...argN])
            if (args) {
                args.unshift(null, null);
            }

            // Breadth-first notification order, mimicking resolution order
            // Note: Not caching a length comparator because this pushes to the end
            // of the targets array as it iterates.
            for (i = 0; i < targets.length; ++i) {
                target = targets[i];

                if (targets[i]._evts) {
                    // Not that this should ever happen, but don't push known
                    // promise targets onto the list again. That would make for an
                    // infinite loop
                    guid = Y.stamp(targets[i]);

                    if (known[guid]) {
                        continue;
                    }

                    known[guid] = 1;

                    // Queue any child promises to get notified
                    targets.push.apply(targets, targets[i]._evts.targets);

                    // Notify subscribers
                    subs = target._evts.subs[type];

                    if (subs) {
                        for (j = 0, jlen = subs.length; j < jlen; ++j) {
                            callback = subs[j];

                            if (args) {
                                args[0]  = callback;
                                callback = Y.bind.apply(Y, args);
                            }

                            // Force async to mimic resolution lifecycle, and
                            // each callback in its own event loop turn to
                            // avoid swallowing errors and errors breaking the
                            // current js thread.
                            // TODO: would synchronous notifications be better?
                            Y.soon(callback);
                        }
                    }
                }
            }

            return this;
        }
function ( type ) { var targets = this . _targets . slice ( ) , known = { } , args = arguments . length > 1 && toArray ( arguments , 1 , true ) , target , subs , i , j , jlen , guid , callback ; // Add index 0 and 1 entries for use in Y.bind.apply(Y, args) below. // Index 0 will be set to the callback, and index 1 will be left as null // resulting in Y.bind.apply(Y, [callback, null, arg0,...argN]) if ( args ) { args . unshift ( null , null ) ; } // Breadth-first notification order, mimicking resolution order // Note: Not caching a length comparator because this pushes to the end // of the targets array as it iterates. for ( i = 0 ; i < targets . length ; ++ i ) { target = targets [ i ] ; if ( targets [ i ] . _evts ) { // Not that this should ever happen, but don't push known // promise targets onto the list again. That would make for an // infinite loop guid = Y . stamp ( targets [ i ] ) ; if ( known [ guid ] ) { continue ; } known [ guid ] = 1 ; // Queue any child promises to get notified targets . push . apply ( targets , targets [ i ] . _evts . targets ) ; // Notify subscribers subs = target . _evts . subs [ type ] ; if ( subs ) { for ( j = 0 , jlen = subs . length ; j < jlen ; ++ j ) { callback = subs [ j ] ; if ( args ) { args [ 0 ] = callback ; callback = Y . bind . apply ( Y , args ) ; } // Force async to mimic resolution lifecycle, and // each callback in its own event loop turn to // avoid swallowing errors and errors breaking the // current js thread. // TODO: would synchronous notifications be better? Y . soon ( callback ) ; } } } } return this ; }
Notify registered Promises and their children of an event. Subscription
callbacks will be passed additional _args_ parameters.

@method fire
@param {String} type The name of the event to notify subscribers of
@param {Any*} [args*] Arguments to pass to the callbacks
@return {Promise.EventNotifier} this instance
@chainable
Notify registered Promises and their children of an event . Subscription callbacks will be passed additional _args_ parameters .