lib/packages/core-classes.js
function(event_name, fn, context, listener_args, listeners_by_event) {

		// otherwise, listener would be called on window object
		if (Lava.schema.DEBUG && !context) Lava.t('Listener was created without a context');

		// note 1: member count for a plain object like this must not exceed 8
		// otherwise, chrome will slow down greatly (!)
		// note 2: there is no 'remove()' method inside the listener, cause depending on implementation,
		// it may either slow down script execution or lead to memory leaks
		var listener = {
			event_name: event_name,
			fn: fn,
			fn_original: fn,
			context: context,
			listener_args: listener_args
		};

		if (listeners_by_event[event_name] != null) {

			listeners_by_event[event_name].push(listener);

		} else {

			listeners_by_event[event_name] = [listener];

		}

		return listener;

	}
function(event_name, fn, context, listener_args, listeners_by_event) {

		// otherwise, listener would be called on window object
		if (Lava.schema.DEBUG && !context) Lava.t('Listener was created without a context');

		// note 1: member count for a plain object like this must not exceed 8
		// otherwise, chrome will slow down greatly (!)
		// note 2: there is no 'remove()' method inside the listener, cause depending on implementation,
		// it may either slow down script execution or lead to memory leaks
		var listener = {
			event_name: event_name,
			fn: fn,
			fn_original: fn,
			context: context,
			listener_args: listener_args
		};

		if (listeners_by_event[event_name] != null) {

			listeners_by_event[event_name].push(listener);

		} else {

			listeners_by_event[event_name] = [listener];

		}

		return listener;

	}
function ( event_name , fn , context , listener_args , listeners_by_event ) { // otherwise, listener would be called on window object if ( Lava . schema . DEBUG && ! context ) Lava . t ( 'Listener was created without a context' ) ; // note 1: member count for a plain object like this must not exceed 8 // otherwise, chrome will slow down greatly (!) // note 2: there is no 'remove()' method inside the listener, cause depending on implementation, // it may either slow down script execution or lead to memory leaks var listener = { event_name : event_name , fn : fn , fn_original : fn , context : context , listener_args : listener_args } ; if ( listeners_by_event [ event_name ] != null ) { listeners_by_event [ event_name ] . push ( listener ) ; } else { listeners_by_event [ event_name ] = [ listener ] ; } return listener ; }
Create the listener construct and push it into the listeners array for given event name

@param {string} event_name The name of event
@param {function} fn The callback
@param {Object} context The owner of the callback
@param {*} listener_args Static listener arguments
@param {Object.<string, Array.<_tListener>>} listeners_by_event {@link Lava.mixin.Observable#_listeners} or {@link Lava.mixin.Properties#_property_listeners}
@returns {_tListener} Listener structure
Create the listener construct and push it into the listeners array for given event name