 			setTimeout
 
 	###*
-	 * Push new handler to current promise.
-	 * @private
-	 * @param {Yaku} self
-	 * @param {Function} onFulfilled It will be called when self is resolved.
-	 * @param {Function} onRejected It will be called when self is rejected.
-	 * @param {Function} resolve Call it to make a promise resolve.
-	 * @param {Function} reject Call it to make a promise reject.
-	###
-	addHandler = (self, onFulfilled, onRejected, resolve, reject) ->
-		offset = self._hCount
-		self[offset] = onFulfilled
-		self[offset + 1] = onRejected
-		self[offset + 2] = resolve
-		self[offset + 3] = reject
-		self._hCount += $groupNum
-
-		if self._state != $pending
-			resolveHanlers self, offset
-
-		return
-
-	###*
 	 * Resolve or reject primise with value x. The x can also be a thenable.
 	 * @private
 	 * @param  {Any | Thenable} x A normal value or a thenable.

			reject e
			return $tryErr

	getX = (self, offset, handler) ->
		try
			handler self._value
		catch e
			self[offset + 3] e
			return $tryErr

	###*
	 * Decide how handlers works.
	 * @private
	 * @param  {Yaku} self
	 * @param  {Integer} offset The offset of the handler group.
	###
	resolveHanlers = (self, offset) ->
		# Trick: Reuse the value of state as the handler selector.
		# The "i + state" shows the math nature of promise.
		handler = self[offset + self._state]

		if typeof handler == 'function'
			nextTick ->
				x = getX self, offset, handler
				return if x == $tryErr

				# Prevent circular chain.
				if x == self[offset + 4] and x
					return x[offset + 1]? new TypeError $circularErrorInfo

				resolveValue x, self[offset + 2], self[offset + 3]
		else
			self[offset + 2 + self._state] self._value

		return

	###*
	 * It will produce a trigger function to user.
	 * Such as the resolve and reject in this `new Yaku (resolve, reject) ->`.
	 * @private
	 * @param  {Yaku} self
	 * @param  {Integer} state The value is one of `$pending`, `$resolved` or `$rejected`.
	 * @return {Function} `(value) -> undefined` A resolve or reject function.
	###
	genTrigger = (self, state) -> (value) ->
		return if self._state != $pending

		self._state = state
		self._value = value

		offset = 0

		while offset < self._hCount
			resolveHanlers self, offset

			offset += $groupNum

		return


	 * then these values will be passed to 2 and 3.
	 * @private
	###

	$circularErrorInfo = 'circular promise resolution chain'

