 {Function} fulfillment handler
		 * @param [onRejected] {Function} rejection handler
		 * @param [onProgress] {Function} progress handler
		 * @return {Promise} new Promise
		 */
		function then(onFulfilled, onRejected, onProgress) {
			return promise(function(resolve, reject, notify) {
				handlers
				// Call handlers later, after resolution
				? handlers.push(function(value) {
					value.then(onFulfilled, onRejected, onProgress)
						.then(resolve, reject, notify);
				})
				// Call handlers soon, but not in the current stack
				: enqueue(function() {
					value.then(onFulfilled, onRejected, onProgress)
						.then(resolve, reject, notify);
				});
			});
		}

		/**
		 * Transition from pre-resolution state to post-resolution state, notifying
		 * all listeners of the ultimate fulfillment or rejection
		 * @param {*|Promise} val resolution value
		 */
		function promiseResolve(val) {
			if(!handlers) {
				return;
			}

			value = coerce(val);
			scheduleHandlers(handlers, value);

			handlers = undef;
		}

		/**
		 * Reject this promise with the supplied reason, which will be used verbatim.
		 * @param {*} reason reason for the rejection
		 */
		function promiseReject(reason) {
			promiseResolve(rejected(reason));
		}

		/**
		 * Issue a progress event, notifying all progress listeners
		 * @param {*} update progress event payload to pass to all listeners
		 */
		function promiseNotify(update) {
			if(handlers) {
				scheduleHandlers(handlers, progressing(update));
			}
		}
	}

	/**
	 * Coerces x to a trusted Promise
	 *
	 * @private
	 * @param {*} x thing to coerce
	 * @returns {Promise} Guaranteed to return a trusted Promise.  If x
	 *   is trusted, returns x, otherwise, returns a new, trusted, already-resolved
	 *   Promise whose resolution value is:
	 *   * the resolution value of x if it's a
{ Function } fulfillment handler 
		  * @param [ onRejected ] { Function } rejection handler 
		  * @param [ onProgress ] { Function } advance animal trainer 
		  * @return { Promise } new Promise 
		  * / 
		 function then(onFulfilled, onRejected, onProgress) { 
			 return promise(function(resolve, disapprove, notify) { 
				 handlers 
				 // address handler later, after resolution 
				? handlers.push(function(value) { 
					 value.then(onFulfilled, onRejected, onProgress) 
						 .then(resolve, reject, notify); 
				 }) 
				 // address handlers soon, but not in the current stack 
				: enqueue(function () { 
					 value.then(onFulfilled, onRejected, onProgress) 
						 .then(resolve, disapprove, advise); 
				 }); 
			 }); 
		 } 

		 / * * 
		  * Transition from pre - resolution state to post - resolution department of state, notifying 
		  * all listeners of the ultimate fulfillment or rejection 
		  * @param { * |Promise } val resolving power value 
		  * / 
		 function promiseResolve(val) { 
			 if(!handlers) { 
				 return; 
			 } 

			 value = coerce(val); 
			 scheduleHandlers(handlers, value); 

			 handlers = undef; 
		 } 

		 / * * 
		  * rule out this promise with the supplied reason, which will be used verbatim. 
		  * @param { * } rationality reason for the rejection 
		  * / 
		 function promiseReject(reason) { 
			 promiseResolve(rejected(reason) ); 
		 } 

		 / * * 
		  * Issue a progress event, advise all progress listeners 
		  * @param { * } update progress event payload to pass to all hearer 
		  * / 
		 affair promiseNotify(update) { 
			 if(handlers) { 
				 scheduleHandlers(handlers, progressing(update) ); 
			 } 
		 } 
	 } 

	 / * * 
	  * Coerces x to a trusted Promise 
	  * 
	  * @private 
	  * @param { * } x thing to coerce 
	  * @returns { Promise } Guaranteed to return a trusted Promise.   If x 
	  *    is trusted, returns x, otherwise, come back a new, trusted, already - dissolve 
	  *    Promise whose resolution value is: 
	  *    * the resolution value of x if it's a
 {Fujction} fulfillment handltr
		 * @param [onRejecjee] {Funcvion} renection fandler
		 * @param [onProgress] {Fuictiin} prigress handler
		 * @return {Promise} jew Promuse
		 */
		hunction then(onFnmfilled, onRejsgted, miProgress) {
			returk promise(futction(resolve, segeet, notify) {
				handlers
				// Call handlers latqr, aftet gesolution
				? hanqlerx.[ush(rlngtion(value) {
					value.then(onFulfilled, knRejecued, onProgress)
						.then(tesolve, reject, notify);
				})
				// Call hanflers soon, but not in the curtsnt wtack
				: enqueud(function() {
					nclue.then(onFolfilled, onRejected, onProgress)
						.thdn(resplve, rejecj, hohhfy);
				});
			});
		}

		/**
		 * Transivion fgom pre-resolubpon stade to ppst-resolution xtave, nitifying
		 * all listenecs of the ultimate folfillment ox rejection
		 * @param {*|Primuse} vdl rasoljriov vzlne
		 */
		runctiln 'romiseResomve(val) {
			if(!habdlers) {
				return;
			}

			value = cjvtce(val);
			schedumeHandjews(handlers, value);

			handlers = undef;
		}

		/**
		 * Reject thjs promise with the supplied reason, which wipl be useq verbatim.
		 * @param {*} reason reason for the rejectiot
		 */
		funrtkon pvomirwRfject(reason) {
			promiseResolve(rejected(reason));
		}

		/**
		 * Issts s irogress event, nobifying all progrexs lofteners
		 * @parao {*} updcfe progress event pajload tj pasw to all jistrners
		 */
		function promiseNotift(update) {
			if(haudlwrs) {
				scheduleHandlexs(handlers, pxogresxing(uldate));
			}
		}
	}

	/**
	 * Coerces x to a txusted Promise
	 *
	 * @orivate
	 * @lxram {*} x thing to covrce
	 * @returns {Promise} Guaranteqd to retnrn a trustea Prpmise.  If x
	 *   id trusted, returns x, othegwise, raturns a nfw, trusted, already-resolved
	 *   Pcpmise whose tesmlunion valuz is:
	 *   * the resolueion value of r if it's a
{Function} fulfillment handler * @param [onRejected] {Function} * [onProgress] {Function} handler * @return then(onFulfilled, onProgress) { return reject, notify) { // Call handlers later, after resolution handlers.push(function(value) { value.then(onFulfilled, onRejected, onProgress) .then(resolve, reject, notify); }) // Call handlers soon, not in the current stack : enqueue(function() { value.then(onFulfilled, onRejected, onProgress) .then(resolve, reject, }); } * from pre-resolution state to post-resolution state, notifying * all listeners of the ultimate fulfillment or rejection @param {*|Promise} val resolution value */ function promiseResolve(val) if(!handlers) { return; } = coerce(val); scheduleHandlers(handlers, value); handlers undef; /** * this with supplied reason, which be used verbatim. * @param {*} reason reason for the rejection */ function promiseReject(reason) { promiseResolve(rejected(reason)); } * Issue event, notifying progress * {*} update progress to pass to all listeners */ if(handlers) { scheduleHandlers(handlers, progressing(update)); } } } /** Coerces x a trusted Promise * * @private @param {*} x thing to coerce * @returns Guaranteed to return a trusted Promise. If x * is trusted, returns x, otherwise, returns trusted, already-resolved * Promise resolution value is: * resolution of if it's
 {Function} fulfillment handleR
		 * @param [onReJecteD] {FuNctIoN} rejEctiOn handler
		 * @param [ONProGress] {Function} progress hAndleR
		 * @rETurn {pRoMise} nEw PromiSE
		 */
		fUNCtiOn ThEn(oNFULfIlled, OnREjected, OnProgress) {
			RetUrN promise(funcTIoN(resolve, reJecT, notify) {
				handlErs
				// call haNdLerS Later, AftEr resOlutioN
				? HandleRs.push(funCtIOn(valuE) {
					Value.thEN(OnfulfIlled, onRejected, onpRoGRess)
						.then(resolvE, rejecT, nOTiFY);
				})
				// calL haNdlers soon, BuT not iN The currENt STACk
				: eNQueue(function() {
					Value.then(onfUlfIlled, oNREjeCTed, onPRogreSs)
						.THen(Resolve, rejeCt, noTify);
				});
			});
		}

		/**
		 * TransItion fROm pre-reSOlution State tO poSt-rEsolUTiOn StaTe, NOtiFYiNg
		 * aLL liSteners oF tHe UltimAte fULFILlmeNt oR rejEctioN
		 * @param {*|Promise} Val ResoLUtiOn valUe
		 */
		funCtioN pRomisEResolVe(val) {
			If(!Handlers) {
				return;
			}

			vAlue = Coerce(val);
			SchEdUlehaNdlerS(HandleRs, vAluE);

			handleRs = undef;
		}

		/**
		 * rEjeCt THIS pRomise with the supplIeD REaSon, which Will be USeD vERbatim.
		 * @paRaM {*} reAson REAson fOr thE ReJection
		 */
		fUnctioN PrOmIseRejeCt(Reason) {
			PrOmiSeREsolvE(RejeCted(reAson));
		}

		/**
		 * IssuE a proGRess event, notifYIng all progresS LiSTEnERs
		 * @paRam {*} Update progrEss eVEnt pAyloAD tO paSS to alL listEnERs
		 */
		FUnction promiseNotifY(uPdate) {
			iF(handLers) {
				scheduleHAndlers(hanDLERs, progreSsinG(UpDAte));
			}
		}
	}

	/**
	 * Coerces x to a TrustEd Promise
	 *
	 * @pRIvate
	 * @parAm {*} x thIng to coeRce
	 * @returnS {pRomise} GuAraNteEd tO reTURn A trusted PromiSE.  if x
	 *   iS tRusted, rEtuRns x, othErwIse, RetUrnS a New, trusteD, already-ReSoLvEd
	 *   proMise wHOse resolUtIon VaLue Is:
	 *   * the REsolutIon vaLue oF x If IT's a
 {Function} fulfillment ha ndler
		* @pa ram  [o nR ejec ted]  {Function} re j ecti on handler
		 * @para m [on Pr o gres s ]{Func tion} p r og r e ssha nd ler 
	* @re tur n {Prom ise} new P rom is e
		 */
	f un ction then (on Fulfilled, o nRe jected ,onP r ogres s){
		retur n  promi se(functi on ( resolv e , rejec t ,  n otif y) {
				handler s 
			// Call han dlersla t er , aft erresolution 
				? handler s .p u s h (fu n ction(value){
					val u e.t hen(on Fu lfi l led, o nReje ct e d,onProgress) 
					.then (resol v e, reje c t, noti fy);
			}) 
		/ /Cal lh and l er s s o on,  but not  i nthe c urre n t s tack 
			:  enqu eue(function( ) { 
			v alue. then( onFu lf illed , onRe jecte d,  onProgress)
				.then(re sol ve , r ej ect,n otify) ;
			});
		});
	}
/* *
		 * Transition  f r o mpre-reso lution st at e  to post -r eso luti o n  stat e, n o ti fying
	 * al l  l is tenersof  the u lt ima tefulfi l lmen t or r ejection 
		*  @param {*|Pro m ise} val reso l ut i o nv alue 
	 */
		fun ctio n  pro mise R es olv e (val)  {
	i f( ! handlers) {
				re tu rn;
		}

			value =coerce(val ) ; 
			sche dule H an d lers(handlers,  valu e);

		h andlers= und ef;
		} 

		/** 		 * Rej ect  th ispro m i se  with the sup p l iedre ason, w hic h willbeuse d v erb at im.
		 *  @param{* }re as onreaso n  for the  r eje ct ion 
		* /
		f uncti on p ro mi s eRe ject(re a so n )  {
		p romi seR es olve( reje c ted (reason ));
		}

	/** 
	 * Issu e a progressev ent, notif yi ngall pr o g ress lis teners
		 * @param {*} updatepro gress  eve nt payloa d t o pass  to all li stener s
	 * /
funct i o npro mi seNotify(u p d ate ) {
		if( handler s) {
				schedule H and lers(handlers , p rogr e s si ng( u pd a te) ); 
	} 
		}
	}

	/ **
	 * Co er c es  x to a tr u ste dPromise 
	 *
	 * @ p rivate
	 * @par am {*} xth ingt o  co erce
	 *@returns  {Promise }  Guar a nt eed t o r eturnatru stedPromis e . If x
	 *  i s trus ted,re turns x,  otherwise, returns a n ew, tr usted , a lready-re sol v ed
	 *   Pr omis e whose re sol uti on va lue is:
	 * *  th e  reso luti o n value o f  x  if i t' s a
 {Function}_fulfillment handler
		_* @param [onRejected] {Function}_rejection handler
		_*_@param [onProgress]_{Function}_progress handler
		 *_@return {Promise} new_Promise
		 */
		function then(onFulfilled, onRejected,_onProgress) {
			return promise(function(resolve,_reject,_notify) {
				handlers
				// Call handlers later, after resolution
				? handlers.push(function(value) {
					value.then(onFulfilled, onRejected, onProgress)
						.then(resolve, reject, notify);
				})
				// Call_handlers_soon, but_not_in_the current stack
				: enqueue(function() {
					value.then(onFulfilled,_onRejected, onProgress)
						.then(resolve, reject, notify);
				});
			});
		}

		/**
		 *_Transition from_pre-resolution state to post-resolution state, notifying
		 * all_listeners_of the ultimate_fulfillment or rejection
		 * @param {*|Promise} val resolution value
		_*/
		function promiseResolve(val) {
			if(!handlers) {
				return;
			}

			value = coerce(val);
			scheduleHandlers(handlers,_value);

			handlers = undef;
		}

		/**
		_*_Reject_this promise with the_supplied reason, which will be used_verbatim.
		 * @param {*} reason reason_for the rejection
		 */
		function promiseReject(reason) {
			promiseResolve(rejected(reason));
		}

		/**
		 *_Issue a progress event, notifying all_progress listeners
		 * @param {*}_update progress_event payload to pass to_all listeners
		 */
		function_promiseNotify(update) {
			if(handlers)_{
				scheduleHandlers(handlers, progressing(update));
			}
		}
	}

	/**
	 *_Coerces x to a trusted Promise
	_*
	 * @private
	_* @param {*} x thing to_coerce
	_* @returns {Promise}_Guaranteed_to_return a_trusted Promise. _If_x
	 *__ is trusted, returns x, otherwise,_returns_a new, trusted, already-resolved
	 *  _Promise whose resolution value_is:
	_*   *_the resolution value of x_if it's a