<commit_before>package org.osflash.signals 
{
    /**
     * The SignalSlot class represents a signal slot.
     *
     * @author <NAME>
     */
	internal final class SignalSlot implements ISignalSlot
	{
		//
		// Note: We define all properties as internal here so we
		// can access them without the overhead of an implicit getter.
		//

		/**
		 * The pseudo-private next SignalSlot in the pool of SignalSlot objects.
		 * @private
		 */
		internal var _nextInPool: SignalSlot;

		/**
		 * The pseudo-private signal variable.
		 * @private
		 */
		internal var _signal:ISignal;

		/**
		 * The listener associated with this slot.
		 * @private
		 */
		internal var _listener:Function;

		/**
		 * Whether or not this listener is only executed
		 * @private
		 */
		internal var _isOnce:Boolean;

		/**
		 * The priority of this slot.
		 * @private
		 */
		internal var _priority:int;

		/**
		 * Creates and returns a new SignalSlot object.
		 *
		 * @param listener The listener associated with the slot.
		 * @param once Whether or not the listener should be executed only once.
		 * @param signal The signal associated with the slot.
		 * @param priority The priority of the slot.
		 */
		public function SignalSlot(listener:Function, once:Boolean = false, signal:ISignal = null, priority:int = 0)
		{
			_listener = listener;
			_isOnce = once;
			_signal = signal;
			_priority = priority;
		}

		/**
		 * @inheritDoc
		 */
		public function execute(valueObjects:Array):void
		{
			if (_isOnce) _signal.remove(_listener);
			_listener.apply(null, valueObjects);
		}

		/**
		 * @inheritDoc
		 */
		public function execute0():void
		{
			if (_isOnce) _signal.remove(_listener);
			_listener();
		}

		/**
		 * @inheritDoc
		 */
		public function execute1(value1:Object):void
		{
			if (_isOnce) _signal.remove(_listener);
			_listener(value1);
		}

		/**
		 * @inheritDoc
		 */
		public function execute2(value1:Object, value2:Object):void
		{
			if (_isOnce) _signal.remove(_listener);
			_listener(value1, value2);
		}

		/**
		 * @inheritDoc
		 */
		public function get listener():Function
		{
			return _listener;
		}

		/**
		 * @inheritDoc
		 */
		public function get isOnce():Boolean
		{
			return _isOnce;
		}

		/**
		 * @inheritDoc
		 */
		public function get priority():int
		{
			return _priority;
		}

		/**
		 * Creates and returns the string representation of the current object.
		 *
		 * @return The string representation of the current object.
		 */
		public function toString():String
		{
			return "[SignalSlot listener: "+_listener+", once: "+_isOnce+", priority: "+_priority+"]";
		}

		public function pause():void
		{
		}

		public function resume():void
		{
		}

		public function swap(newListener:Function):void
		{
		}
	}
}<commit_msg>Implemented pause/resume and swap in SignalSlot<commit_after>package org.osflash.signals 
{
    /**
     * The SignalSlot class represents a signal slot.
     *
     * @author <NAME>
	 * @author <NAME>
	 * @private
     */
	internal final class SignalSlot implements ISignalSlot
	{
		/**
		 * Private backing variable for the <code>signal</code> property.
		 * @private
		 */
		private var _signal:ISignal;

		/**
		 * Private backing variable for the <code>paused</code> property.
		 * @private
		 */
		private var _paused:Boolean;

		/**
		 * Private backing variable for the <code>listener</code> property.
		 *
		 * Visible in the signals package for fast access.
		 * @private
		 */
		internal var _listener:Function;

		/**
		 * Private backing variable for the <code>isOnce</code> property.
		 *
		 * Visible in the signals package for fast access.
		 * @private
		 */
		internal var _isOnce:Boolean;

		/**
		 * Private backing variable for the <code>priority</code> property.
		 *
		 * Visible in the signals package for fast access.
		 * @private
		 */
		internal var _priority:int;

		/**
		 * Creates and returns a new SignalSlot object.
		 *
		 * @param listener The listener associated with the slot.
		 * @param once Whether or not the listener should be executed only once.
		 * @param signal The signal associated with the slot.
		 * @param priority The priority of the slot.
		 *
		 * @throws ArgumentError An error is thrown if the given listener closure is <code>null</code>.
		 */
		public function SignalSlot(listener:Function, once:Boolean = false, signal:ISignal = null, priority:int = 0)
		{
			if (null == listener) throw new ArgumentError('Given listener is null.');

			_listener = listener;
			_isOnce = once;
			_signal = signal;
			_priority = priority;
		}

		/**
		 * @inheritDoc
		 */
		public function execute(valueObjects:Array):void
		{
			if (!_paused)
			{
				if (_isOnce) _signal.remove(_listener);
				_listener.apply(null, valueObjects);
			}
		}

		/**
		 * @inheritDoc
		 */
		public function execute0():void
		{
			if (!_paused)
			{
				if (_isOnce) _signal.remove(_listener);
				_listener();
			}
		}

		/**
		 * @inheritDoc
		 */
		public function execute1(value1:Object):void
		{
			if (!_paused)
			{
				if (_isOnce) _signal.remove(_listener);
				_listener(value1);
			}
		}

		/**
		 * @inheritDoc
		 */
		public function execute2(value1:Object, value2:Object):void
		{
			if (!_paused)
			{
				if (_isOnce) _signal.remove(_listener);
				_listener(value1, value2);
			}
		}

		/**
		 * @inheritDoc
		 */
		public function get listener():Function
		{
			return _listener;
		}

		/**
		 * @inheritDoc
		 */
		public function get isOnce():Boolean
		{
			return _isOnce;
		}

		/**
		 * @inheritDoc
		 */
		public function get priority():int
		{
			return _priority;
		}

		/**
		 * Creates and returns the string representation of the current object.
		 *
		 * @return The string representation of the current object.
		 */
		public function toString():String
		{
			return "[SignalSlot listener: "+_listener+", once: "+_isOnce+", priority: "+_priority+"]";
		}

		/**
		 * @inheritDoc
		 */
		public function get paused():Boolean
		{
			return _paused;
		}

		public function set paused(value:Boolean):void
		{
			_paused = value;
		}

		/**
		 * @inheritDoc
		 */
		public function pause():void
		{
			_paused = true;
		}

		/**
		 * @inheritDoc
		 */
		public function resume():void
		{
			_paused = false;
		}

		/**
		 * @inheritDoc
		 */
		public function swap(newListener:Function):void
		{
			if (null == newListener) throw new ArgumentError(
					'Given listener is null.\nDid you want to call pause() instead?');

			_listener = newListener;
		}
	}
}
{'fraction_non_alphanumeric': 0.11709348966368405, 'fraction_numerical': 0.0030854674483184203, 'mean_word_length': 2.7452339688041594, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '915422', 'n_tokens_mistral': 2401, 'n_tokens_neox': 1908, 'n_words': 569}