 	###
 	addHandler = (p1, p2, onFulfilled, onRejected) ->
 		# 2.2.1
-		if typeof onFulfilled == $function
+		if isFunction onFulfilled
 			p2._onFulfilled = onFulfilled
-		if typeof onRejected == $function
+		if isFunction onRejected
 			p2._onRejected = onRejected
 
 		p1[$hasUnhandledRejection] = false

	$tryCatchFn = null
	$tryErr = { e: null }
	$noop = {}
	$function = 'function'
	$object = 'object'
	$isNode = typeof process == $object

	###*
	 * Release the specified key of an object.

				settlePromise p, $rejected, xthen.e
				return

			if isFunction xthen
				if isLongStackTrace
					p[$prePromise] = x

