(function(){vare,t;(function(){varn={},r={};e=function(e,t,r){n[e]={deps:t,callback:r}};t=function(e){if(r[e]){returnr[e]}r[e]={};vari=n[e],o=i.deps,s=i.callback,f=[],c;for(vara=0,u=o.length;a<u;a++){if(o[a]==="exports"){f.push(c={})}else{f.push(t(o[a]))}}varv=s.apply(this,f);returnr[e]=c||v}})();e("rsvp/all",["rsvp/defer","exports"],function(e,t){"use strict";varn=e.defer;functionr(e){vart=[],r=n(),i=e.length;if(i===0){r.resolve([])}varo=function(e){returnfunction(t){s(e,t)}};vars=function(e,n){t[e]=n;if(--i===0){r.resolve(t)}};varf=function(e){r.reject(e)};for(varc=0;c<e.length;c++){if(e[c]&&typeofe[c].then==="function"){e[c].then(o(c),f)}else{s(c,e[c])}}returnr.promise}t.all=r});e("rsvp/async",["exports"],function(e){"use strict";vart=typeofwindow!=="undefined"?window:{};varn=t.MutationObserver||t.WebKitMutationObserver;varr;if(typeofprocess!=="undefined"&&{}.toString.call(process)==="[object process]"){r=function(e,t){process.nextTick(function(){e.call(t)})}}elseif(n){vari=[];varo=newn(function(){vare=i.slice();i=[];e.forEach(function(e){vart=e[0],n=e[1];t.call(n)})});vars=document.createElement("div");o.observe(s,{attributes:true});window.addEventListener("unload",function(){o.disconnect();o=null});r=function(e,t){i.push([e,t]);s.setAttribute("drainQueue","drainQueue")}}else{r=function(e,t){setTimeout(function(){e.call(t)},1)}}e.async=r});e("rsvp/config",["rsvp/async","exports"],function(e,t){"use strict";varn=e.async;varr={};r.async=n;t.config=r});e("rsvp/defer",["rsvp/promise","exports"],function(e,t){"use strict";varn=e.Promise;functionr(){vare={};vart=newn(function(t,n){e.resolve=t;e.reject=n});e.promise=t;returne}t.defer=r});e("rsvp/events",["exports"],function(e){"use strict";vart=function(e,t){this.type=e;for(varnint){if(!t.hasOwnProperty(n)){continue}this[n]=t[n]}};varn=function(e,t){for(varn=0,r=e.length;n<r;n++){if(e[n][0]===t){returnn}}return-1};varr=function(e){vart=e._promiseCallbacks;if(!t){t=e._promiseCallbacks={}}returnt};vari={mixin:function(e){e.on=this.on;e.off=this.off;e.trigger=this.trigger;returne},on:function(e,t,i){varo=r(this),s,f;e=e.split(/\s+/);i=i||this;while(f=e.shift()){s=o[f];if(!s){s=o[f]=[]}if(n(s,t)===-1){s.push([t,i])}}},off:function(e,t){vari=r(this),o,s,f;e=e.split(/\s+/);while(s=e.shift()){if(!t){i[s]=[];continue}o=i[s];f=n(o,t);if(f!==-1){o.splice(f,1)}}},trigger:function(e,n){vari=r(this),o,s,f,c,a;if(o=i[e]){for(varu=0;u<o.length;u++){s=o[u];f=s[0];c=s[1];if(typeofn!=="object"){n={detail:n}}a=newt(e,n);f.call(c,a)}}}};e.EventTarget=i});e("rsvp/hash",["rsvp/defer","exports"],function(e,t){"use strict";varn=e.defer;functionr(e){vart=0;for(varnine){t++}returnt}functioni(e){vart={},i=n(),o=r(e);if(o===0){i.resolve({})}vars=function(e){returnfunction(t){f(e,t)}};varf=function(e,n){t[e]=n;if(--o===0){i.resolve(t)}};varc=function(e){i.reject(e)};for(varaine){if(e[a]&&typeofe[a].then==="function"){e[a].then(s(a),c)}else{f(a,e[a])}}returni.promise}t.hash=i});e("rsvp/node",["rsvp/promise","rsvp/all","exports"],function(e,t,n){"use strict";varr=e.Promise;vari=t.all;functiono(e,t){returnfunction(n,r){if(n){t(n)}elseif(arguments.length>2){e(Array.prototype.slice.call(arguments,1))}else{e(r)}}}functions(e){returnfunction(){vart=Array.prototype.slice.call(arguments),n,s;varf=newr(function(e,t){n=e;s=t});i(t).then(function(t){t.push(o(n,s));try{e.apply(this,t)}catch(r){s(r)}});returnf}}n.denodeify=s});e("rsvp/promise",["rsvp/config","rsvp/events","exports"],function(e,t,n){"use strict";varr=e.config;vari=t.EventTarget;varo=function(){};vars=function(e){vart=this;if(typeofe!=="function"){thrownewTypeError("You must pass a resolver function as the sole argument to the promise constructor")}if(!(tinstanceofs)){returnnews(e)}varn=function(e){c(t,e);n=o;r=o};varr=function(e){u(t,e);n=o;r=o};this.on("promise:resolved",function(e){this.trigger("success",{detail:e.detail})},this);this.on("promise:failed",function(e){this.trigger("error",{detail:e.detail})},this);e(n,r)};varf=function(e,t,n,r){vari=typeofn==="function",o,s,f,a;if(i){try{o=n(r.detail);f=true}catch(v){a=true;s=v}}else{o=r.detail;f=true}if(o&&typeofo.then==="function"){o.then(function(e){c(t,e)},function(e){u(t,e)})}elseif(i&&f){c(t,o)}elseif(a){u(t,s)}elseif(e==="resolve"){c(t,o)}elseif(e==="reject"){u(t,o)}};s.prototype={constructor:s,then:function(e,t){varn=news(function(){});if(this.isFulfilled){r.async(function(){f("resolve",n,e,{detail:this.fulfillmentValue})},this)}if(this.isRejected){r.async(function(){f("reject",n,t,{detail:this.rejectedReason})},this)}this.on("promise:resolved",function(t){f("resolve",n,e,t)});this.on("promise:failed",function(e){f("reject",n,t,e)});returnn}};i.mixin(s.prototype);functionc(e,t){if(t&&typeoft.then==="function"){t.then(function(t){c(e,t)},function(t){u(e,t)})}else{a(e,t)}}functiona(e,t){r.async(function(){e.trigger("promise:resolved",{detail:t});e.isFulfilled=true;e.fulfillmentValue=t})}functionu(e,t){r.async(function(){e.trigger("promise:failed",{detail:t});e.isRejected=true;e.rejectedReason=t})}n.Promise=s});e("rsvp",["rsvp/events","rsvp/promise","rsvp/node","rsvp/all","rsvp/hash","rsvp/defer","rsvp/config","exports"],function(e,t,n,r,i,o,s,f){"use strict";varc=e.EventTarget;vara=t.Promise;varu=n.denodeify;varv=r.all;varl=i.hash;varp=o.defer;varh=s.config;functiond(e,t){h[e]=t}f.Promise=a;f.EventTarget=c;f.all=v;f.hash=l;f.defer=p;f.denodeify=u;f.configure=d});window.RSVP=t("rsvp")})();
(function(){vare,t;(function(){varn={},r={};e=function(e,t,r){n[e]={deps:t,callback:r}};t=function(e){if(r[e]){returnr[e]}r[e]={};vari=n[e],o=i.deps,s=i.callback,f=[],c;for(varu=0,a=o.length;u<a;u++){if(o[u]==="exports"){f.push(c={})}else{f.push(t(o[u]))}}varv=s.apply(this,f);returnr[e]=c||v}})();e("rsvp/all",["rsvp/defer","exports"],function(e,t){"use strict";varn=e.defer;functionr(e){vart=[],r=n(),i=e.length;if(i===0){r.resolve([])}varo=function(e){returnfunction(t){s(e,t)}};vars=function(e,n){t[e]=n;if(--i===0){r.resolve(t)}};varf=function(e){r.reject(e)};for(varc=0;c<e.length;c++){if(e[c]&&typeofe[c].then==="function"){e[c].then(o(c),f)}else{s(c,e[c])}}returnr.promise}t.all=r});e("rsvp/async",["exports"],function(e){"use strict";vart=typeofwindow!=="undefined"?window:{};varn=t.MutationObserver||t.WebKitMutationObserver;varr;if(typeofprocess!=="undefined"&&{}.toString.call(process)==="[object process]"){r=function(e,t){process.nextTick(function(){e.call(t)})}}elseif(n){vari=[];varo=newn(function(){vare=i.slice();i=[];e.forEach(function(e){vart=e[0],n=e[1];t.call(n)})});vars=document.createElement("div");o.observe(s,{attributes:true});window.addEventListener("unload",function(){o.disconnect();o=null});r=function(e,t){i.push([e,t]);s.setAttribute("drainQueue","drainQueue")}}else{r=function(e,t){setTimeout(function(){e.call(t)},1)}}e.async=r});e("rsvp/config",["rsvp/async","exports"],function(e,t){"use strict";varn=e.async;varr={};r.async=n;t.config=r});e("rsvp/defer",["rsvp/promise","exports"],function(e,t){"use strict";varn=e.Promise;functionr(){vare={};vart=newn(function(t,n){e.resolve=t;e.reject=n});e.promise=t;returne}t.defer=r});e("rsvp/events",["exports"],function(e){"use strict";vart=function(e,t){this.type=e;for(varnint){if(!t.hasOwnProperty(n)){continue}this[n]=t[n]}};varn=function(e,t){for(varn=0,r=e.length;n<r;n++){if(e[n][0]===t){returnn}}return-1};varr=function(e){vart=e._promiseCallbacks;if(!t){t=e._promiseCallbacks={}}returnt};vari={mixin:function(e){e.on=this.on;e.off=this.off;e.trigger=this.trigger;returne},on:function(e,t,i){varo=r(this),s,f;e=e.split(/\s+/);i=i||this;while(f=e.shift()){s=o[f];if(!s){s=o[f]=[]}if(n(s,t)===-1){s.push([t,i])}}},off:function(e,t){vari=r(this),o,s,f;e=e.split(/\s+/);while(s=e.shift()){if(!t){i[s]=[];continue}o=i[s];f=n(o,t);if(f!==-1){o.splice(f,1)}}},trigger:function(e,n){vari=r(this),o,s,f,c,u;if(o=i[e]){for(vara=0;a<o.length;a++){s=o[a];f=s[0];c=s[1];if(typeofn!=="object"){n={detail:n}}u=newt(e,n);f.call(c,u)}}}};e.EventTarget=i});e("rsvp/hash",["rsvp/defer","exports"],function(e,t){"use strict";varn=e.defer;functionr(e){vart=0;for(varnine){t++}returnt}functioni(e){vart={},i=n(),o=r(e);if(o===0){i.resolve({})}vars=function(e){returnfunction(t){f(e,t)}};varf=function(e,n){t[e]=n;if(--o===0){i.resolve(t)}};varc=function(e){i.reject(e)};for(varuine){if(e[u]&&typeofe[u].then==="function"){e[u].then(s(u),c)}else{f(u,e[u])}}returni.promise}t.hash=i});e("rsvp/node",["rsvp/promise","rsvp/all","exports"],function(e,t,n){"use strict";varr=e.Promise;vari=t.all;functiono(e,t){returnfunction(n,r){if(n){t(n)}elseif(arguments.length>2){e(Array.prototype.slice.call(arguments,1))}else{e(r)}}}functions(e){returnfunction(){vart=Array.prototype.slice.call(arguments),n,s;varf=newr(function(e,t){n=e;s=t});i(t).then(function(t){t.push(o(n,s));try{e.apply(this,t)}catch(r){s(r)}});returnf}}n.denodeify=s});e("rsvp/promise",["rsvp/config","rsvp/events","exports"],function(e,t,n){"use strict";varr=e.config;vari=t.EventTarget;varo=function(){};vars=function(e){vart=this;if(typeofe!=="function"){thrownewTypeError("You must pass a resolver function as the sole argument to the promise constructor")}if(!(tinstanceofs)){returnnews(e)}varn=function(e){c(t,e);n=o;r=o};varr=function(e){a(t,e);n=o;r=o};this.on("promise:resolved",function(e){this.trigger("success",{detail:e.detail})},this);this.on("promise:failed",function(e){this.trigger("error",{detail:e.detail})},this);e(n,r)};varf=function(e,t,n,r){vari=typeofn==="function",o,s,f,u;if(i){try{o=n(r.detail);f=true}catch(v){u=true;s=v}}else{o=r.detail;f=true}if(o&&typeofo.then==="function"){o.then(function(e){c(t,e)},function(e){a(t,e)})}elseif(i&&f){c(t,o)}elseif(u){a(t,s)}elseif(e==="resolve"){c(t,o)}elseif(e==="reject"){a(t,o)}};s.prototype={constructor:s,then:function(e,t){varn=news(function(){});if(this.isFulfilled){r.async(function(){f("resolve",n,e,{detail:this.fulfillmentValue})},this)}if(this.isRejected){r.async(function(){f("reject",n,t,{detail:this.rejectedReason})},this)}this.on("promise:resolved",function(t){f("resolve",n,e,t)});this.on("promise:failed",function(e){f("reject",n,t,e)});returnn}};i.mixin(s.prototype);functionc(e,t){if(t&&typeoft.then==="function"){t.then(function(t){c(e,t)},function(t){a(e,t)})}else{u(e,t)}}functionu(e,t){r.async(function(){e.trigger("promise:resolved",{detail:t});e.isFulfilled=true;e.fulfillmentValue=t})}functiona(e,t){r.async(function(){e.trigger("promise:failed",{detail:t});e.isRejected=true;e.rejectedReason=t})}n.Promise=s});e("rsvp/resolve",["rsvp/promise","exports"],function(e,t){"use strict";varn=e.Promise;functionr(e){returntypeofe==="function"||typeofe==="object"&&e!==null}functioni(e){vart=newn(function(t,n){vari;try{if(r(e)){i=e.then;if(typeofi==="function"){i.call(e,t,n)}else{t(e)}}else{t(e)}}catch(o){n(o)}});returnt}t.resolve=i});e("rsvp",["rsvp/events","rsvp/promise","rsvp/node","rsvp/all","rsvp/hash","rsvp/defer","rsvp/config","rsvp/resolve","exports"],function(e,t,n,r,i,o,s,f,c){"use strict";varu=e.EventTarget;vara=t.Promise;varv=n.denodeify;varl=r.all;varp=i.hash;varh=o.defer;vard=s.config;vary=f.resolve;functiong(e,t){d[e]=t}c.Promise=a;c.EventTarget=u;c.all=l;c.hash=p;c.defer=h;c.denodeify=v;c.configure=g;c.resolve=y});window.RSVP=t("rsvp")})();
assert(error===expectedError,'rejected promise with x');
done();
});
rejector(expectedError);
});
specify("2.3.3 If both resolvePromise and rejectPromise are called, or multiple calls to the same argument are made, the first call takes precedence, and any further calls are ignored",function(done){