UNPKG

slush-gladius

Version:

Slush generator for bleeding edge weapo... ehr, applications!

11 lines (10 loc) 4.87 kB
/** * Copyright (c) 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * https://raw.github.com/facebook/regenerator/master/LICENSE file. An * additional grant of patent rights can be found in the PATENTS file in * the same directory. */ !function(a,b){function h(a,b,c,d){return new p(a,b,c||null,d||[])}function p(a,b,c,e){function n(b,e){if(h===k)throw new Error("Generator is already running");if(h===l)throw new Error("Generator has already finished");for(;;){var f=g.delegate;if(f){try{var n=f.iterator[b](e);b="next",e=d}catch(o){g.delegate=null,b="throw",e=o;continue}if(!n.done)return h=j,n;g[f.resultName]=n.value,g.next=f.nextLoc,g.delegate=null}if("next"===b){if(h===i&&"undefined"!=typeof e)throw new TypeError("attempt to send "+JSON.stringify(e)+" to newborn generator");h===j?g.sent=e:delete g.sent}else if("throw"===b){if(h===i)throw h=l,e;g.dispatchException(e)&&(b="next",e=d)}else"return"===b&&g.abrupt("return",e);h=k;try{var p=a.call(c,g);h=g.done?l:j;var n={value:p,done:g.done};if(p!==m)return n;g.delegate&&"next"===b&&(e=d)}catch(q){h=l,"next"===b?g.dispatchException(q):e=q}}}var f=b?Object.create(b.prototype):this,g=new s(e),h=i;return f.next=n.bind(f,"next"),f["throw"]=n.bind(f,"throw"),f["return"]=n.bind(f,"return"),f}function q(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2]),this.tryEntries.push(b)}function r(a,b){var c=a.completion||{};c.type=0===b?"normal":"return",delete c.arg,a.completion=c}function s(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(q,this),this.reset()}function t(b){var c=b,d=a.Symbol;if(d&&d.iterator in b)c=b[d.iterator]();else if(!isNaN(b.length)){var e=-1;c=function f(){for(;++e<b.length;)if(e in b)return f.value=b[e],f.done=!1,f;return f.done=!0,f},c.next=c}return c}var d,c=Object.prototype.hasOwnProperty;try{var e=a.Promise||(a.Promise=require("promise"))}catch(f){}if(!a.regeneratorRuntime){var g=a.regeneratorRuntime="undefined"==typeof exports?{}:exports;g.wrap=h;var i="suspendedStart",j="suspendedYield",k="executing",l="completed",m={},n=p.prototype,o=b.prototype=Object.create(Function.prototype);o.constructor=b,o.prototype=n,n.constructor=o,g.mark=function(a){return a.__proto__=o,a.prototype=Object.create(n),a},g.async=function(a,b,c){return new e(function(d,f){function k(a){try{var b=this(a),c=b.value}catch(g){return f(g)}b.done?d(c):e.resolve(c).then(i,j)}var g=h(a,b,c),i=k.bind(g.next),j=k.bind(g["throw"]);i()})},"GeneratorFunction"!==b.name&&(b.name="GeneratorFunction"),g.isGeneratorFunction=function(a){var c=a&&a.constructor;return c?b.name===c.name:!1},n["function"==typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},n.toString=function(){return"[object Generator]"},g.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function d(){for(;b.length;){var c=b.pop();if(c in a)return d.value=c,d.done=!1,d}return d.done=!0,d}},g.values=t,s.prototype={constructor:s,reset:function(){this.prev=0,this.next=0,this.sent=d,this.done=!1,this.delegate=null,this.tryEntries.forEach(r);for(var b,a=0;c.call(this,b="t"+a)||20>a;++a)this[b]=null},stop:function(){this.done=!0;var a=this.tryEntries[0],b=a.completion;if("throw"===b.type)throw b.arg;return this.rval},dispatchException:function(a){function d(c,d){return g.type="throw",g.arg=a,b.next=c,!!d}if(this.done)throw a;for(var b=this,e=this.tryEntries.length-1;e>=0;--e){var f=this.tryEntries[e],g=f.completion;if("root"===f.tryLoc)return d("end");if(f.tryLoc<=this.prev){var h=c.call(f,"catchLoc"),i=c.call(f,"finallyLoc");if(h&&i){if(this.prev<f.catchLoc)return d(f.catchLoc,!0);if(this.prev<f.finallyLoc)return d(f.finallyLoc)}else if(h){if(this.prev<f.catchLoc)return d(f.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<f.finallyLoc)return d(f.finallyLoc)}}}},_findFinallyEntry:function(a){for(var b=this.tryEntries.length-1;b>=0;--b){var d=this.tryEntries[b];if(d.tryLoc<=this.prev&&c.call(d,"finallyLoc")&&(d.finallyLoc===a||this.prev<d.finallyLoc))return d}},abrupt:function(a,b){var c=this._findFinallyEntry(),d=c?c.completion:{};return d.type=a,d.arg=b,c?this.next=c.finallyLoc:this.complete(d),m},complete:function(a){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type&&(this.rval=a.arg,this.next="end"),m},finish:function(a){var b=this._findFinallyEntry(a);return this.complete(b.completion)},"catch":function(a){for(var b=this.tryEntries.length-1;b>=0;--b){var c=this.tryEntries[b];if(c.tryLoc===a){var d=c.completion;if("throw"===d.type){var e=d.arg;r(c,b)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(a,b,c){return this.delegate={iterator:t(a),resultName:b,nextLoc:c},m}}}}.apply(this,Function("return [this, function GeneratorFunction(){}]")());