!function(name,context,definition){context[name]=definition(),"undefined"!=typeof module&&module.exports?module.exports=context[name]:"function"==typeof define&&define.amd&&define(function(){return context[name]})}("Promise","undefined"!=typeof global?global:this,function(){"use strict";var builtInProp,cycle,first,last,item,ToString=Object.prototype.toString,timer="undefined"!=typeof setImmediate?function(fn){return setImmediate(fn)}:setTimeout;try{Object.defineProperty({},"x",{}),builtInProp=function(obj,name,val,config){return Object.defineProperty(obj,name,{value:val,writable:!0,configurable:!1!==config})}}catch(err){builtInProp=function(obj,name,val){return obj[name]=val,obj}}function Item(fn,self){this.fn=fn,this.self=self,this.next=void 0}function schedule(fn,self){scheduling_queue.add(fn,self),cycle=cycle||timer(scheduling_queue.drain)}function isThenable(o){var _then,o_type=typeof o;return"function"==typeof(_then=null==o||"object"!=o_type&&"function"!=o_type?_then:o.then)&&_then}function notify(){for(var i=0;i