lib/collection/event.js
function (definition) {
        if (!definition) {
            return;
        }

        var result,
            script = definition.script;

        if (Script.isScript(script)) {
            result = script;
        }
        else if (_.isArray(script) || _.isString(script)) {
            result = new Script({ exec: script });
        }
        else if (_.isObject(script)) {
            result = new Script(script);
        }

        _.mergeDefined(this, /** @lends Event.prototype */ {
            /**
             * Name of the event that this instance is intended to listen to.
             * @type {String}
             */
            listen: _.isString(definition.listen) ? definition.listen.toLowerCase() : undefined,

            /**
             * The script that is to be executed when this event is triggered.
             * @type {Script}
             */
            script: result
        });
    }
function (definition) {
        if (!definition) {
            return;
        }

        var result,
            script = definition.script;

        if (Script.isScript(script)) {
            result = script;
        }
        else if (_.isArray(script) || _.isString(script)) {
            result = new Script({ exec: script });
        }
        else if (_.isObject(script)) {
            result = new Script(script);
        }

        _.mergeDefined(this, /** @lends Event.prototype */ {
            /**
             * Name of the event that this instance is intended to listen to.
             * @type {String}
             */
            listen: _.isString(definition.listen) ? definition.listen.toLowerCase() : undefined,

            /**
             * The script that is to be executed when this event is triggered.
             * @type {Script}
             */
            script: result
        });
    }
function ( definition ) { if ( ! definition ) { return ; } var result , script = definition . script ; if ( Script . isScript ( script ) ) { result = script ; } else if ( _ . isArray ( script ) || _ . isString ( script ) ) { result = new Script ( { exec : script } ) ; } else if ( _ . isObject ( script ) ) { result = new Script ( script ) ; } _ . mergeDefined ( this , /** @lends Event.prototype */ { /**
             * Name of the event that this instance is intended to listen to.
             * @type {String}
             */ listen : _ . isString ( definition . listen ) ? definition . listen . toLowerCase ( ) : undefined , /**
             * The script that is to be executed when this event is triggered.
             * @type {Script}
             */ script : result } ) ; }
Update an event.

@param {Event~definition} definition
Update an event .