 
 		return
 
+	isThenable = (x) ->
+		x and typeof x.then == 'function'
+
 	# Push new handler to current promise.
 	addHandler = (self, onFulfilled, onRejected, resolve, reject) ->
 		offset = self._thenCount * 4

		new Promise (resolve, reject) ->
			addHandler self, onFulfilled, onRejected, resolve, reject
		, true

# ********************** Private **********************


			if x == self
				return self._handlers[offset + 3] new TypeError $resolveSelf

			if isThenable x
				# If the promise is a Yaku instance
				# (not some thing like the Bluebird or jQuery Defer),
				# we can do some performance optimization.
