 	 * We can call these functions, once our operation is completed.
 	###
 	constructor: (executor) ->
-		self = @
-
-		executor (val) ->
-			self._trigger $resolved, val
-		, (val) ->
-			self._trigger $rejected, val
+		executor genTrigger(@, $resolved), genTrigger(@, $rejected)
 
 	###*
 	 * Appends fulfillment and rejection handlers to the promise,

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

	$circularErrorInfo = 'circular promise resolution chain'


			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.
