Created
April 30, 2021 00:42
-
-
Save gnh1201/2627d860e41f8bd2dba858536836c64e to your computer and use it in GitHub Desktop.
shimtest.js 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define module object | |
var ModuleObject = function() { | |
this.exports = {}; | |
}; | |
/* | |
(function(global) { | |
var module = new ModuleObject(); | |
})(this); | |
*/ | |
////////////////////////////////////////////////////////////////////// | |
// JSON3 | |
////////////////////////////////////////////////////////////////////// | |
(function(global) { | |
var module = new ModuleObject(); | |
/*! JSON v3.3.2 | https://bestiejs.github.io/json3 | Copyright 2012-2015, Kit Cambridge, Benjamin Tan | http://kit.mit-license.org */ | |
/* | |
JSON v3.3.2 | https://bestiejs.github.io/json3 | Copyright 2012-2015, Kit Cambridge, Benjamin Tan | http://kit.mit-license.org */ | |
(function(){function O(u,v){function B(a,d){try{a()}catch(c){d&&d()}}function q(a){if(null!=q[a])return q[a];if("bug-string-char-index"==a)var d=!1;else if("json"==a)d=q("json-stringify")&&q("date-serialization")&&q("json-parse");else if("date-serialization"==a){if(d=q("json-stringify")&&y){var c=v.stringify;B(function(){d='"-271821-04-20T00:00:00.000Z"'==c(new z(-864E13))&&'"+275760-09-13T00:00:00.000Z"'==c(new z(864E13))&&'"-000001-01-01T00:00:00.000Z"'==c(new z(-621987552E5))&&'"1969-12-31T23:59:59.999Z"'== | |
c(new z(-1))})}}else{var e;if("json-stringify"==a){c=v.stringify;var g="function"==typeof c;g&&((e=function(){return 1}).toJSON=e,B(function(){g="0"===c(0)&&"0"===c(new ca)&&'""'==c(new U)&&c(w)===x&&c(x)===x&&c()===x&&"1"===c(e)&&"[1]"==c([e])&&"[null]"==c([x])&&"null"==c(null)&&"[null,null,null]"==c([x,w,null])&&'{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'==c({a:[e,!0,!1,null,"\x00\b\n\f\r\t"]})&&"1"===c(null,e)&&"[\n 1,\n 2\n]"==c([1,2],null,1)},function(){g=!1}));d=g}if("json-parse"== | |
a){var l=v.parse,b;"function"==typeof l&&B(function(){0===l("0")&&!l(!1)&&(e=l('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'),b=5==e.a.length&&1===e.a[0])&&(B(function(){b=!l('"\t"')}),b&&B(function(){b=1!==l("01")}),b&&B(function(){b=1!==l("1.")}))},function(){b=!1});d=b}}return q[a]=!!d}u||(u=r.Object());v||(v=r.Object());var ca=u.Number||r.Number,U=u.String||r.String,I=u.Object||r.Object,z=u.Date||r.Date,da=u.SyntaxError||r.SyntaxError,ea=u.TypeError||r.TypeError,fa=u.Math||r.Math;u=u.JSON|| | |
r.JSON;"object"==typeof u&&u&&(v.stringify=u.stringify,v.parse=u.parse);I=I.prototype;var w=I.toString,J=I.hasOwnProperty,x,y=new z(-0xc782b5b800cec);B(function(){y=-109252==y.getUTCFullYear()&&0===y.getUTCMonth()&&1===y.getUTCDate()&&10==y.getUTCHours()&&37==y.getUTCMinutes()&&6==y.getUTCSeconds()&&708==y.getUTCMilliseconds()});q["bug-string-char-index"]=q["date-serialization"]=q.json=q["json-stringify"]=q["json-parse"]=null;if(!q("json")){var P=q("bug-string-char-index"),G=function(a,d){var c=0, | |
e,g;(e=function(){this.valueOf=0}).prototype.valueOf=0;var l=new e;for(g in l)J.call(l,g)&&c++;e=l=null;c?G=function(b,h){var p="[object Function]"==w.call(b),k,n;for(k in b)p&&"prototype"==k||!J.call(b,k)||(n="constructor"===k)||h(k);(n||J.call(b,k="constructor"))&&h(k)}:(l="valueOf toString toLocaleString propertyIsEnumerable isPrototypeOf hasOwnProperty constructor".split(" "),G=function(b,h){var p="[object Function]"==w.call(b),k,n=!p&&"function"!=typeof b.constructor&&H[typeof b.hasOwnProperty]&& | |
b.hasOwnProperty||J;for(k in b)p&&"prototype"==k||!n.call(b,k)||h(k);for(p=l.length;k=l[--p];)n.call(b,k)&&h(k)});return G(a,d)};if(!q("json-stringify")&&!q("date-serialization")){var ha={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},A=function(a,d){return("000000"+(d||0)).slice(-a)},L=function(a){var d,c,e,g,l,b,h,p;if(y)var k=function(m){d=m.getUTCFullYear();c=m.getUTCMonth();e=m.getUTCDate();l=m.getUTCHours();b=m.getUTCMinutes();h=m.getUTCSeconds();p=m.getUTCMilliseconds()};else{var n= | |
fa.floor,K=[0,31,59,90,120,151,181,212,243,273,304,334],D=function(m,C){return K[C]+365*(m-1970)+n((m-1969+(C=+(1<C)))/4)-n((m-1901+C)/100)+n((m-1601+C)/400)};k=function(m){e=n(m/864E5);for(d=n(e/365.2425)+1970-1;D(d+1,0)<=e;d++);for(c=n((e-D(d,0))/30.42);D(d,c+1)<=e;c++);e=1+e-D(d,c);g=(m%864E5+864E5)%864E5;l=n(g/36E5)%24;b=n(g/6E4)%60;h=n(g/1E3)%60;p=g%1E3}}L=function(m){m>-1/0&&m<1/0?(k(m),m=(0>=d||1E4<=d?(0>d?"-":"+")+A(6,0>d?-d:d):A(4,d))+"-"+A(2,c+1)+"-"+A(2,e)+"T"+A(2,l)+":"+A(2,b)+":"+A(2, | |
h)+"."+A(3,p)+"Z",d=c=e=l=b=h=p=null):m=null;return m};return L(a)};if(q("json-stringify")&&!q("date-serialization")){var ia=function(){return L(this)},ja=v.stringify;v.stringify=function(a,d,c){var e=z.prototype.toJSON;z.prototype.toJSON=ia;a=ja(a,d,c);z.prototype.toJSON=e;return a}}else{var ka=function(a){a=a.charCodeAt(0);var d=ha[a];return d?d:"\\u00"+A(2,a.toString(16))},Q=/[\x00-\x1f\x22\x5c]/g,V=function(a){Q.lastIndex=0;return'"'+(Q.test(a)?a.replace(Q,ka):a)+'"'},R=function(a,d,c,e,g,l,b){var h, | |
p;B(function(){h=d[a]});"object"==typeof h&&h&&(h.getUTCFullYear&&"[object Date]"==w.call(h)&&h.toJSON===z.prototype.toJSON?h=L(h):"function"==typeof h.toJSON&&(h=h.toJSON(a)));c&&(h=c.call(d,a,h));if(h==x)return h===x?h:"null";var k=typeof h;"object"==k&&(p=w.call(h));switch(p||k){case "boolean":case "[object Boolean]":return""+h;case "number":case "[object Number]":return h>-1/0&&h<1/0?""+h:"null";case "string":case "[object String]":return V(""+h)}if("object"==typeof h){for(k=b.length;k--;)if(b[k]=== | |
h)throw ea();b.push(h);var n=[];var K=l;l+=g;if("[object Array]"==p){var D=0;for(k=h.length;D<k;D++)p=R(D,h,c,e,g,l,b),n.push(p===x?"null":p);k=n.length?g?"[\n"+l+n.join(",\n"+l)+"\n"+K+"]":"["+n.join(",")+"]":"[]"}else G(e||h,function(m){var C=R(m,h,c,e,g,l,b);C!==x&&n.push(V(m)+":"+(g?" ":"")+C)}),k=n.length?g?"{\n"+l+n.join(",\n"+l)+"\n"+K+"}":"{"+n.join(",")+"}":"{}";b.pop();return k}};v.stringify=function(a,d,c){var e;if(H[typeof d]&&d){var g=w.call(d);if("[object Function]"==g)var l=d;else if("[object Array]"== | |
g){var b={};for(var h=0,p=d.length,k;h<p;)if(k=d[h++],g=w.call(k),"[object String]"==g||"[object Number]"==g)b[k]=1}}if(c)if(g=w.call(c),"[object Number]"==g){if(0<(c-=c%1))for(10<c&&(c=10),e="";e.length<c;)e+=" "}else"[object String]"==g&&(e=10>=c.length?c:c.slice(0,10));return R("",(k={},k[""]=a,k),l,b,e,"",[])}}}if(!q("json-parse")){var la=U.fromCharCode,ma={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},f,M,t=function(){f=M=null;throw da();},E=function(){for(var a=M,d=a.length, | |
c,e,g,l,b;f<d;)switch(b=a.charCodeAt(f),b){case 9:case 10:case 13:case 32:f++;break;case 123:case 125:case 91:case 93:case 58:case 44:return c=P?a.charAt(f):a[f],f++,c;case 34:c="@";for(f++;f<d;)if(b=a.charCodeAt(f),32>b)t();else if(92==b)switch(b=a.charCodeAt(++f),b){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:c+=ma[b];f++;break;case 117:e=++f;for(g=f+4;f<g;f++)b=a.charCodeAt(f),48<=b&&57>=b||97<=b&&102>=b||65<=b&&70>=b||t();c+=la("0x"+a.slice(e,f));break;default:t()}else{if(34== | |
b)break;b=a.charCodeAt(f);for(e=f;32<=b&&92!=b&&34!=b;)b=a.charCodeAt(++f);c+=a.slice(e,f)}if(34==a.charCodeAt(f))return f++,c;t();default:e=f;45==b&&(l=!0,b=a.charCodeAt(++f));if(48<=b&&57>=b){for(48==b&&(b=a.charCodeAt(f+1),48<=b&&57>=b)&&t();f<d&&(b=a.charCodeAt(f),48<=b&&57>=b);f++);if(46==a.charCodeAt(f)){for(g=++f;g<d&&!(b=a.charCodeAt(g),48>b||57<b);g++);g==f&&t();f=g}b=a.charCodeAt(f);if(101==b||69==b){b=a.charCodeAt(++f);43!=b&&45!=b||f++;for(g=f;g<d&&!(b=a.charCodeAt(g),48>b||57<b);g++); | |
g==f&&t();f=g}return+a.slice(e,f)}l&&t();c=a.slice(f,f+4);if("true"==c)return f+=4,!0;if("fals"==c&&101==a.charCodeAt(f+4))return f+=5,!1;if("null"==c)return f+=4,null;t()}return"$"},S=function(a){var d;"$"==a&&t();if("string"==typeof a){if("@"==(P?a.charAt(0):a[0]))return a.slice(1);if("["==a){for(d=[];;){a=E();if("]"==a)break;if(c)","==a?(a=E(),"]"==a&&t()):t();else var c=!0;","==a&&t();d.push(S(a))}return d}if("{"==a){for(d={};;){a=E();if("}"==a)break;c?","==a?(a=E(),"}"==a&&t()):t():c=!0;","!= | |
a&&"string"==typeof a&&"@"==(P?a.charAt(0):a[0])&&":"==E()||t();d[a.slice(1)]=S(E())}return d}t()}return a},X=function(a,d,c){c=W(a,d,c);c===x?delete a[d]:a[d]=c},W=function(a,d,c){var e=a[d],g;if("object"==typeof e&&e)if("[object Array]"==w.call(e))for(g=e.length;g--;)X(w,G,e,g,c);else G(e,function(l){X(e,l,c)});return c.call(a,d,e)};v.parse=function(a,d){var c;f=0;M=""+a;a=S(E());"$"!=E()&&t();f=M=null;return d&&"[object Function]"==w.call(d)?W((c={},c[""]=a,c),"",d):a}}}v.runInContext=O;return v} | |
var Y=typeof define==="function"&&define.amd,H={"function":!0,object:!0},T=H[typeof exports]&&exports&&!exports.nodeType&&exports,r=H[typeof window]&&window||this,F=T&&H[typeof module]&&module&&!module.nodeType&&"object"==typeof global&&global;!F||F.global!==F&&F.window!==F&&F.self!==F||(r=F);if(T&&!Y)O(r,T);else{var Z=r.JSON,aa=r.JSON3,ba=!1,N=O(r,r.JSON3={noConflict:function(){ba||(ba=!0,r.JSON=Z,r.JSON3=aa,Z=aa=null);return N}});r.JSON={parse:N.parse,stringify:N.stringify}}Y&&define(function(){return N})}).call(this); | |
})(this); | |
////////////////////////////////////////////////////////////////////// | |
// babel-polyfill | |
////////////////////////////////////////////////////////////////////// | |
(function(global) { | |
var module = new ModuleObject(); | |
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){ | |
_dereq_(276); | |
_dereq_(212); | |
_dereq_(214); | |
_dereq_(213); | |
_dereq_(216); | |
_dereq_(218); | |
_dereq_(223); | |
_dereq_(217); | |
_dereq_(215); | |
_dereq_(225); | |
_dereq_(224); | |
_dereq_(220); | |
_dereq_(221); | |
_dereq_(219); | |
_dereq_(211); | |
_dereq_(222); | |
_dereq_(226); | |
_dereq_(227); | |
_dereq_(178); | |
_dereq_(180); | |
_dereq_(179); | |
_dereq_(229); | |
_dereq_(228); | |
_dereq_(199); | |
_dereq_(209); | |
_dereq_(210); | |
_dereq_(200); | |
_dereq_(201); | |
_dereq_(202); | |
_dereq_(203); | |
_dereq_(204); | |
_dereq_(205); | |
_dereq_(206); | |
_dereq_(207); | |
_dereq_(208); | |
_dereq_(182); | |
_dereq_(183); | |
_dereq_(184); | |
_dereq_(185); | |
_dereq_(186); | |
_dereq_(187); | |
_dereq_(188); | |
_dereq_(189); | |
_dereq_(190); | |
_dereq_(191); | |
_dereq_(192); | |
_dereq_(193); | |
_dereq_(194); | |
_dereq_(195); | |
_dereq_(196); | |
_dereq_(197); | |
_dereq_(198); | |
_dereq_(263); | |
_dereq_(268); | |
_dereq_(275); | |
_dereq_(266); | |
_dereq_(258); | |
_dereq_(259); | |
_dereq_(264); | |
_dereq_(269); | |
_dereq_(271); | |
_dereq_(254); | |
_dereq_(255); | |
_dereq_(256); | |
_dereq_(257); | |
_dereq_(260); | |
_dereq_(261); | |
_dereq_(262); | |
_dereq_(265); | |
_dereq_(267); | |
_dereq_(270); | |
_dereq_(272); | |
_dereq_(273); | |
_dereq_(274); | |
_dereq_(173); | |
_dereq_(175); | |
_dereq_(174); | |
_dereq_(177); | |
_dereq_(176); | |
_dereq_(161); | |
_dereq_(159); | |
_dereq_(166); | |
_dereq_(163); | |
_dereq_(169); | |
_dereq_(171); | |
_dereq_(158); | |
_dereq_(165); | |
_dereq_(155); | |
_dereq_(170); | |
_dereq_(153); | |
_dereq_(168); | |
_dereq_(167); | |
_dereq_(160); | |
_dereq_(164); | |
_dereq_(152); | |
_dereq_(154); | |
_dereq_(157); | |
_dereq_(156); | |
_dereq_(172); | |
_dereq_(162); | |
_dereq_(245); | |
_dereq_(246); | |
_dereq_(252); | |
_dereq_(247); | |
_dereq_(248); | |
_dereq_(249); | |
_dereq_(250); | |
_dereq_(251); | |
_dereq_(230); | |
_dereq_(181); | |
_dereq_(253); | |
_dereq_(288); | |
_dereq_(289); | |
_dereq_(277); | |
_dereq_(278); | |
_dereq_(283); | |
_dereq_(286); | |
_dereq_(287); | |
_dereq_(281); | |
_dereq_(284); | |
_dereq_(282); | |
_dereq_(285); | |
_dereq_(279); | |
_dereq_(280); | |
_dereq_(231); | |
_dereq_(232); | |
_dereq_(233); | |
_dereq_(234); | |
_dereq_(235); | |
_dereq_(238); | |
_dereq_(236); | |
_dereq_(237); | |
_dereq_(239); | |
_dereq_(240); | |
_dereq_(241); | |
_dereq_(242); | |
_dereq_(244); | |
_dereq_(243); | |
module.exports = _dereq_(50); | |
},{"152":152,"153":153,"154":154,"155":155,"156":156,"157":157,"158":158,"159":159,"160":160,"161":161,"162":162,"163":163,"164":164,"165":165,"166":166,"167":167,"168":168,"169":169,"170":170,"171":171,"172":172,"173":173,"174":174,"175":175,"176":176,"177":177,"178":178,"179":179,"180":180,"181":181,"182":182,"183":183,"184":184,"185":185,"186":186,"187":187,"188":188,"189":189,"190":190,"191":191,"192":192,"193":193,"194":194,"195":195,"196":196,"197":197,"198":198,"199":199,"200":200,"201":201,"202":202,"203":203,"204":204,"205":205,"206":206,"207":207,"208":208,"209":209,"210":210,"211":211,"212":212,"213":213,"214":214,"215":215,"216":216,"217":217,"218":218,"219":219,"220":220,"221":221,"222":222,"223":223,"224":224,"225":225,"226":226,"227":227,"228":228,"229":229,"230":230,"231":231,"232":232,"233":233,"234":234,"235":235,"236":236,"237":237,"238":238,"239":239,"240":240,"241":241,"242":242,"243":243,"244":244,"245":245,"246":246,"247":247,"248":248,"249":249,"250":250,"251":251,"252":252,"253":253,"254":254,"255":255,"256":256,"257":257,"258":258,"259":259,"260":260,"261":261,"262":262,"263":263,"264":264,"265":265,"266":266,"267":267,"268":268,"269":269,"270":270,"271":271,"272":272,"273":273,"274":274,"275":275,"276":276,"277":277,"278":278,"279":279,"280":280,"281":281,"282":282,"283":283,"284":284,"285":285,"286":286,"287":287,"288":288,"289":289,"50":50}],2:[function(_dereq_,module,exports){ | |
_dereq_(290); | |
module.exports = _dereq_(50).Array.flatMap; | |
},{"290":290,"50":50}],3:[function(_dereq_,module,exports){ | |
_dereq_(291); | |
module.exports = _dereq_(50).Array.includes; | |
},{"291":291,"50":50}],4:[function(_dereq_,module,exports){ | |
_dereq_(292); | |
module.exports = _dereq_(50).Object.entries; | |
},{"292":292,"50":50}],5:[function(_dereq_,module,exports){ | |
_dereq_(293); | |
module.exports = _dereq_(50).Object.getOwnPropertyDescriptors; | |
},{"293":293,"50":50}],6:[function(_dereq_,module,exports){ | |
_dereq_(294); | |
module.exports = _dereq_(50).Object.values; | |
},{"294":294,"50":50}],7:[function(_dereq_,module,exports){ | |
'use strict'; | |
_dereq_(230); | |
_dereq_(295); | |
module.exports = _dereq_(50).Promise['finally']; | |
},{"230":230,"295":295,"50":50}],8:[function(_dereq_,module,exports){ | |
_dereq_(296); | |
module.exports = _dereq_(50).String.padEnd; | |
},{"296":296,"50":50}],9:[function(_dereq_,module,exports){ | |
_dereq_(297); | |
module.exports = _dereq_(50).String.padStart; | |
},{"297":297,"50":50}],10:[function(_dereq_,module,exports){ | |
_dereq_(299); | |
module.exports = _dereq_(50).String.trimRight; | |
},{"299":299,"50":50}],11:[function(_dereq_,module,exports){ | |
_dereq_(298); | |
module.exports = _dereq_(50).String.trimLeft; | |
},{"298":298,"50":50}],12:[function(_dereq_,module,exports){ | |
_dereq_(300); | |
module.exports = _dereq_(149).f('asyncIterator'); | |
},{"149":149,"300":300}],13:[function(_dereq_,module,exports){ | |
_dereq_(30); | |
module.exports = _dereq_(16).global; | |
},{"16":16,"30":30}],14:[function(_dereq_,module,exports){ | |
module.exports = function (it) { | |
if (typeof it != 'function') throw TypeError(it + ' is not a function!'); | |
return it; | |
}; | |
},{}],15:[function(_dereq_,module,exports){ | |
var isObject = _dereq_(26); | |
module.exports = function (it) { | |
if (!isObject(it)) throw TypeError(it + ' is not an object!'); | |
return it; | |
}; | |
},{"26":26}],16:[function(_dereq_,module,exports){ | |
var core = module.exports = { version: '2.6.11' }; | |
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef | |
},{}],17:[function(_dereq_,module,exports){ | |
// optional / simple context binding | |
var aFunction = _dereq_(14); | |
module.exports = function (fn, that, length) { | |
aFunction(fn); | |
if (that === undefined) return fn; | |
switch (length) { | |
case 1: return function (a) { | |
return fn.call(that, a); | |
}; | |
case 2: return function (a, b) { | |
return fn.call(that, a, b); | |
}; | |
case 3: return function (a, b, c) { | |
return fn.call(that, a, b, c); | |
}; | |
} | |
return function (/* ...args */) { | |
return fn.apply(that, arguments); | |
}; | |
}; | |
},{"14":14}],18:[function(_dereq_,module,exports){ | |
// Thank's IE8 for his funny defineProperty | |
module.exports = !_dereq_(21)(function () { | |
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; | |
}); | |
},{"21":21}],19:[function(_dereq_,module,exports){ | |
var isObject = _dereq_(26); | |
var document = _dereq_(22).document; | |
// typeof document.createElement is 'object' in old IE | |
var is = isObject(document) && isObject(document.createElement); | |
module.exports = function (it) { | |
return is ? document.createElement(it) : {}; | |
}; | |
},{"22":22,"26":26}],20:[function(_dereq_,module,exports){ | |
var global = _dereq_(22); | |
var core = _dereq_(16); | |
var ctx = _dereq_(17); | |
var hide = _dereq_(24); | |
var has = _dereq_(23); | |
var PROTOTYPE = 'prototype'; | |
var $export = function (type, name, source) { | |
var IS_FORCED = type & $export.F; | |
var IS_GLOBAL = type & $export.G; | |
var IS_STATIC = type & $export.S; | |
var IS_PROTO = type & $export.P; | |
var IS_BIND = type & $export.B; | |
var IS_WRAP = type & $export.W; | |
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); | |
var expProto = exports[PROTOTYPE]; | |
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; | |
var key, own, out; | |
if (IS_GLOBAL) source = name; | |
for (key in source) { | |
// contains in native | |
own = !IS_FORCED && target && target[key] !== undefined; | |
if (own && has(exports, key)) continue; | |
// export native or passed | |
out = own ? target[key] : source[key]; | |
// prevent global pollution for namespaces | |
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] | |
// bind timers to global for call from export context | |
: IS_BIND && own ? ctx(out, global) | |
// wrap global constructors for prevent change them in library | |
: IS_WRAP && target[key] == out ? (function (C) { | |
var F = function (a, b, c) { | |
if (this instanceof C) { | |
switch (arguments.length) { | |
case 0: return new C(); | |
case 1: return new C(a); | |
case 2: return new C(a, b); | |
} return new C(a, b, c); | |
} return C.apply(this, arguments); | |
}; | |
F[PROTOTYPE] = C[PROTOTYPE]; | |
return F; | |
// make static versions for prototype methods | |
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; | |
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME% | |
if (IS_PROTO) { | |
(exports.virtual || (exports.virtual = {}))[key] = out; | |
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% | |
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); | |
} | |
} | |
}; | |
// type bitmap | |
$export.F = 1; // forced | |
$export.G = 2; // global | |
$export.S = 4; // static | |
$export.P = 8; // proto | |
$export.B = 16; // bind | |
$export.W = 32; // wrap | |
$export.U = 64; // safe | |
$export.R = 128; // real proto method for `library` | |
module.exports = $export; | |
},{"16":16,"17":17,"22":22,"23":23,"24":24}],21:[function(_dereq_,module,exports){ | |
module.exports = function (exec) { | |
try { | |
return !!exec(); | |
} catch (e) { | |
return true; | |
} | |
}; | |
},{}],22:[function(_dereq_,module,exports){ | |
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 | |
var global = module.exports = typeof window != 'undefined' && window.Math == Math | |
? window : typeof self != 'undefined' && self.Math == Math ? self | |
// eslint-disable-next-line no-new-func | |
: Function('return this')(); | |
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef | |
},{}],23:[function(_dereq_,module,exports){ | |
var hasOwnProperty = {}.hasOwnProperty; | |
module.exports = function (it, key) { | |
return hasOwnProperty.call(it, key); | |
}; | |
},{}],24:[function(_dereq_,module,exports){ | |
var dP = _dereq_(27); | |
var createDesc = _dereq_(28); | |
module.exports = _dereq_(18) ? function (object, key, value) { | |
return dP.f(object, key, createDesc(1, value)); | |
} : function (object, key, value) { | |
object[key] = value; | |
return object; | |
}; | |
},{"18":18,"27":27,"28":28}],25:[function(_dereq_,module,exports){ | |
module.exports = !_dereq_(18) && !_dereq_(21)(function () { | |
return Object.defineProperty(_dereq_(19)('div'), 'a', { get: function () { return 7; } }).a != 7; | |
}); | |
},{"18":18,"19":19,"21":21}],26:[function(_dereq_,module,exports){ | |
module.exports = function (it) { | |
return typeof it === 'object' ? it !== null : typeof it === 'function'; | |
}; | |
},{}],27:[function(_dereq_,module,exports){ | |
var anObject = _dereq_(15); | |
var IE8_DOM_DEFINE = _dereq_(25); | |
var toPrimitive = _dereq_(29); | |
var dP = Object.defineProperty; | |
exports.f = _dereq_(18) ? Object.defineProperty : function defineProperty(O, P, Attributes) { | |
anObject(O); | |
P = toPrimitive(P, true); | |
anObject(Attributes); | |
if (IE8_DOM_DEFINE) try { | |
return dP(O, P, Attributes); | |
} catch (e) { /* empty */ } | |
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); | |
if ('value' in Attributes) O[P] = Attributes.value; | |
return O; | |
}; | |
},{"15":15,"18":18,"25":25,"29":29}],28:[function(_dereq_,module,exports){ | |
module.exports = function (bitmap, value) { | |
return { | |
enumerable: !(bitmap & 1), | |
configurable: !(bitmap & 2), | |
writable: !(bitmap & 4), | |
value: value | |
}; | |
}; | |
},{}],29:[function(_dereq_,module,exports){ | |
// 7.1.1 ToPrimitive(input [, PreferredType]) | |
var isObject = _dereq_(26); | |
// instead of the ES6 spec version, we didn't implement @@toPrimitive case | |
// and the second argument - flag - preferred type is a string | |
module.exports = function (it, S) { | |
if (!isObject(it)) return it; | |
var fn, val; | |
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; | |
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; | |
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; | |
throw TypeError("Can't convert object to primitive value"); | |
}; | |
},{"26":26}],30:[function(_dereq_,module,exports){ | |
// https://github.com/tc39/proposal-global | |
var $export = _dereq_(20); | |
$export($export.G, { global: _dereq_(22) }); | |
},{"20":20,"22":22}],31:[function(_dereq_,module,exports){ | |
arguments[4][14][0].apply(exports,arguments) | |
},{"14":14}],32:[function(_dereq_,module,exports){ | |
var cof = _dereq_(46); | |
module.exports = function (it, msg) { | |
if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); | |
return +it; | |
}; | |
},{"46":46}],33:[function(_dereq_,module,exports){ | |
// 22.1.3.31 Array.prototype[@@unscopables] | |
var UNSCOPABLES = _dereq_(150)('unscopables'); | |
var ArrayProto = Array.prototype; | |
if (ArrayProto[UNSCOPABLES] == undefined) _dereq_(70)(ArrayProto, UNSCOPABLES, {}); | |
module.exports = function (key) { | |
ArrayProto[UNSCOPABLES][key] = true; | |
}; | |
},{"150":150,"70":70}],34:[function(_dereq_,module,exports){ | |
'use strict'; | |
var at = _dereq_(127)(true); | |
// `AdvanceStringIndex` abstract operation | |
// https://tc39.github.io/ecma262/#sec-advancestringindex | |
module.exports = function (S, index, unicode) { | |
return index + (unicode ? at(S, index).length : 1); | |
}; | |
},{"127":127}],35:[function(_dereq_,module,exports){ | |
module.exports = function (it, Constructor, name, forbiddenField) { | |
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { | |
throw TypeError(name + ': incorrect invocation!'); | |
} return it; | |
}; | |
},{}],36:[function(_dereq_,module,exports){ | |
arguments[4][15][0].apply(exports,arguments) | |
},{"15":15,"79":79}],37:[function(_dereq_,module,exports){ | |
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) | |
'use strict'; | |
var toObject = _dereq_(140); | |
var toAbsoluteIndex = _dereq_(135); | |
var toLength = _dereq_(139); | |
module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { | |
var O = toObject(this); | |
var len = toLength(O.length); | |
var to = toAbsoluteIndex(target, len); | |
var from = toAbsoluteIndex(start, len); | |
var end = arguments.length > 2 ? arguments[2] : undefined; | |
var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); | |
var inc = 1; | |
if (from < to && to < from + count) { | |
inc = -1; | |
from += count - 1; | |
to += count - 1; | |
} | |
while (count-- > 0) { | |
if (from in O) O[to] = O[from]; | |
else delete O[to]; | |
to += inc; | |
from += inc; | |
} return O; | |
}; | |
},{"135":135,"139":139,"140":140}],38:[function(_dereq_,module,exports){ | |
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) | |
'use strict'; | |
var toObject = _dereq_(140); | |
var toAbsoluteIndex = _dereq_(135); | |
var toLength = _dereq_(139); | |
module.exports = function fill(value /* , start = 0, end = @length */) { | |
var O = toObject(this); | |
var length = toLength(O.length); | |
var aLen = arguments.length; | |
var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); | |
var end = aLen > 2 ? arguments[2] : undefined; | |
var endPos = end === undefined ? length : toAbsoluteIndex(end, length); | |
while (endPos > index) O[index++] = value; | |
return O; | |
}; | |
},{"135":135,"139":139,"140":140}],39:[function(_dereq_,module,exports){ | |
// false -> Array#indexOf | |
// true -> Array#includes | |
var toIObject = _dereq_(138); | |
var toLength = _dereq_(139); | |
var toAbsoluteIndex = _dereq_(135); | |
module.exports = function (IS_INCLUDES) { | |
return function ($this, el, fromIndex) { | |
var O = toIObject($this); | |
var length = toLength(O.length); | |
var index = toAbsoluteIndex(fromIndex, length); | |
var value; | |
// Array#includes uses SameValueZero equality algorithm | |
// eslint-disable-next-line no-self-compare | |
if (IS_INCLUDES && el != el) while (length > index) { | |
value = O[index++]; | |
// eslint-disable-next-line no-self-compare | |
if (value != value) return true; | |
// Array#indexOf ignores holes, Array#includes - not | |
} else for (;length > index; index++) if (IS_INCLUDES || index in O) { | |
if (O[index] === el) return IS_INCLUDES || index || 0; | |
} return !IS_INCLUDES && -1; | |
}; | |
}; | |
},{"135":135,"138":138,"139":139}],40:[function(_dereq_,module,exports){ | |
// 0 -> Array#forEach | |
// 1 -> Array#map | |
// 2 -> Array#filter | |
// 3 -> Array#some | |
// 4 -> Array#every | |
// 5 -> Array#find | |
// 6 -> Array#findIndex | |
var ctx = _dereq_(52); | |
var IObject = _dereq_(75); | |
var toObject = _dereq_(140); | |
var toLength = _dereq_(139); | |
var asc = _dereq_(43); | |
module.exports = function (TYPE, $create) { | |
var IS_MAP = TYPE == 1; | |
var IS_FILTER = TYPE == 2; | |
var IS_SOME = TYPE == 3; | |
var IS_EVERY = TYPE == 4; | |
var IS_FIND_INDEX = TYPE == 6; | |
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; | |
var create = $create || asc; | |
return function ($this, callbackfn, that) { | |
var O = toObject($this); | |
var self = IObject(O); | |
var f = ctx(callbackfn, that, 3); | |
var length = toLength(self.length); | |
var index = 0; | |
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; | |
var val, res; | |
for (;length > index; index++) if (NO_HOLES || index in self) { | |
val = self[index]; | |
res = f(val, index, O); | |
if (TYPE) { | |
if (IS_MAP) result[index] = res; // map | |
else if (res) switch (TYPE) { | |
case 3: return true; // some | |
case 5: return val; // find | |
case 6: return index; // findIndex | |
case 2: result.push(val); // filter | |
} else if (IS_EVERY) return false; // every | |
} | |
} | |
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; | |
}; | |
}; | |
},{"139":139,"140":140,"43":43,"52":52,"75":75}],41:[function(_dereq_,module,exports){ | |
var aFunction = _dereq_(31); | |
var toObject = _dereq_(140); | |
var IObject = _dereq_(75); | |
var toLength = _dereq_(139); | |
module.exports = function (that, callbackfn, aLen, memo, isRight) { | |
aFunction(callbackfn); | |
var O = toObject(that); | |
var self = IObject(O); | |
var length = toLength(O.length); | |
var index = isRight ? length - 1 : 0; | |
var i = isRight ? -1 : 1; | |
if (aLen < 2) for (;;) { | |
if (index in self) { | |
memo = self[index]; | |
index += i; | |
break; | |
} | |
index += i; | |
if (isRight ? index < 0 : length <= index) { | |
throw TypeError('Reduce of empty array with no initial value'); | |
} | |
} | |
for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { | |
memo = callbackfn(memo, self[index], index, O); | |
} | |
return memo; | |
}; | |
},{"139":139,"140":140,"31":31,"75":75}],42:[function(_dereq_,module,exports){ | |
var isObject = _dereq_(79); | |
var isArray = _dereq_(77); | |
var SPECIES = _dereq_(150)('species'); | |
module.exports = function (original) { | |
var C; | |
if (isArray(original)) { | |
C = original.constructor; | |
// cross-realm fallback | |
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; | |
if (isObject(C)) { | |
C = C[SPECIES]; | |
if (C === null) C = undefined; | |
} | |
} return C === undefined ? Array : C; | |
}; | |
},{"150":150,"77":77,"79":79}],43:[function(_dereq_,module,exports){ | |
// 9.4.2.3 ArraySpeciesCreate(originalArray, length) | |
var speciesConstructor = _dereq_(42); | |
module.exports = function (original, length) { | |
return new (speciesConstructor(original))(length); | |
}; | |
},{"42":42}],44:[function(_dereq_,module,exports){ | |
'use strict'; | |
var aFunction = _dereq_(31); | |
var isObject = _dereq_(79); | |
var invoke = _dereq_(74); | |
var arraySlice = [].slice; | |
var factories = {}; | |
var construct = function (F, len, args) { | |
if (!(len in factories)) { | |
for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; | |
// eslint-disable-next-line no-new-func | |
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); | |
} return factories[len](F, args); | |
}; | |
module.exports = Function.bind || function bind(that /* , ...args */) { | |
var fn = aFunction(this); | |
var partArgs = arraySlice.call(arguments, 1); | |
var bound = function (/* args... */) { | |
var args = partArgs.concat(arraySlice.call(arguments)); | |
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); | |
}; | |
if (isObject(fn.prototype)) bound.prototype = fn.prototype; | |
return bound; | |
}; | |
},{"31":31,"74":74,"79":79}],45:[function(_dereq_,module,exports){ | |
// getting tag from 19.1.3.6 Object.prototype.toString() | |
var cof = _dereq_(46); | |
var TAG = _dereq_(150)('toStringTag'); | |
// ES3 wrong here | |
var ARG = cof(function () { return arguments; }()) == 'Arguments'; | |
// fallback for IE11 Script Access Denied error | |
var tryGet = function (it, key) { | |
try { | |
return it[key]; | |
} catch (e) { /* empty */ } | |
}; | |
module.exports = function (it) { | |
var O, T, B; | |
return it === undefined ? 'Undefined' : it === null ? 'Null' | |
// @@toStringTag case | |
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T | |
// builtinTag case | |
: ARG ? cof(O) | |
// ES3 arguments fallback | |
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; | |
}; | |
},{"150":150,"46":46}],46:[function(_dereq_,module,exports){ | |
var toString = {}.toString; | |
module.exports = function (it) { | |
return toString.call(it).slice(8, -1); | |
}; | |
},{}],47:[function(_dereq_,module,exports){ | |
'use strict'; | |
var dP = _dereq_(97).f; | |
var create = _dereq_(96); | |
var redefineAll = _dereq_(115); | |
var ctx = _dereq_(52); | |
var anInstance = _dereq_(35); | |
var forOf = _dereq_(66); | |
var $iterDefine = _dereq_(83); | |
var step = _dereq_(85); | |
var setSpecies = _dereq_(121); | |
var DESCRIPTORS = _dereq_(56); | |
var fastKey = _dereq_(92).fastKey; | |
var validate = _dereq_(147); | |
var SIZE = DESCRIPTORS ? '_s' : 'size'; | |
var getEntry = function (that, key) { | |
// fast case | |
var index = fastKey(key); | |
var entry; | |
if (index !== 'F') return that._i[index]; | |
// frozen object case | |
for (entry = that._f; entry; entry = entry.n) { | |
if (entry.k == key) return entry; | |
} | |
}; | |
module.exports = { | |
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { | |
var C = wrapper(function (that, iterable) { | |
anInstance(that, C, NAME, '_i'); | |
that._t = NAME; // collection type | |
that._i = create(null); // index | |
that._f = undefined; // first entry | |
that._l = undefined; // last entry | |
that[SIZE] = 0; // size | |
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); | |
}); | |
redefineAll(C.prototype, { | |
// 23.1.3.1 Map.prototype.clear() | |
// 23.2.3.2 Set.prototype.clear() | |
clear: function clear() { | |
for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { | |
entry.r = true; | |
if (entry.p) entry.p = entry.p.n = undefined; | |
delete data[entry.i]; | |
} | |
that._f = that._l = undefined; | |
that[SIZE] = 0; | |
}, | |
// 23.1.3.3 Map.prototype.delete(key) | |
// 23.2.3.4 Set.prototype.delete(value) | |
'delete': function (key) { | |
var that = validate(this, NAME); | |
var entry = getEntry(that, key); | |
if (entry) { | |
var next = entry.n; | |
var prev = entry.p; | |
delete that._i[entry.i]; | |
entry.r = true; | |
if (prev) prev.n = next; | |
if (next) next.p = prev; | |
if (that._f == entry) that._f = next; | |
if (that._l == entry) that._l = prev; | |
that[SIZE]--; | |
} return !!entry; | |
}, | |
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) | |
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) | |
forEach: function forEach(callbackfn /* , that = undefined */) { | |
validate(this, NAME); | |
var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); | |
var entry; | |
while (entry = entry ? entry.n : this._f) { | |
f(entry.v, entry.k, this); | |
// revert to the last existing entry | |
while (entry && entry.r) entry = entry.p; | |
} | |
}, | |
// 23.1.3.7 Map.prototype.has(key) | |
// 23.2.3.7 Set.prototype.has(value) | |
has: function has(key) { | |
return !!getEntry(validate(this, NAME), key); | |
} | |
}); | |
if (DESCRIPTORS) dP(C.prototype, 'size', { | |
get: function () { | |
return validate(this, NAME)[SIZE]; | |
} | |
}); | |
return C; | |
}, | |
def: function (that, key, value) { | |
var entry = getEntry(that, key); | |
var prev, index; | |
// change existing entry | |
if (entry) { | |
entry.v = value; | |
// create new entry | |
} else { | |
that._l = entry = { | |
i: index = fastKey(key, true), // <- index | |
k: key, // <- key | |
v: value, // <- value | |
p: prev = that._l, // <- previous entry | |
n: undefined, // <- next entry | |
r: false // <- removed | |
}; | |
if (!that._f) that._f = entry; | |
if (prev) prev.n = entry; | |
that[SIZE]++; | |
// add to index | |
if (index !== 'F') that._i[index] = entry; | |
} return that; | |
}, | |
getEntry: getEntry, | |
setStrong: function (C, NAME, IS_MAP) { | |
// add .keys, .values, .entries, [@@iterator] | |
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 | |
$iterDefine(C, NAME, function (iterated, kind) { | |
this._t = validate(iterated, NAME); // target | |
this._k = kind; // kind | |
this._l = undefined; // previous | |
}, function () { | |
var that = this; | |
var kind = that._k; | |
var entry = that._l; | |
// revert to the last existing entry | |
while (entry && entry.r) entry = entry.p; | |
// get next entry | |
if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { | |
// or finish the iteration | |
that._t = undefined; | |
return step(1); | |
} | |
// return step by kind | |
if (kind == 'keys') return step(0, entry.k); | |
if (kind == 'values') return step(0, entry.v); | |
return step(0, [entry.k, entry.v]); | |
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true); | |
// add [@@species], 23.1.2.2, 23.2.2.2 | |
setSpecies(NAME); | |
} | |
}; | |
},{"115":115,"121":121,"147":147,"35":35,"52":52,"56":56,"66":66,"83":83,"85":85,"92":92,"96":96,"97":97}],48:[function(_dereq_,module,exports){ | |
'use strict'; | |
var redefineAll = _dereq_(115); | |
var getWeak = _dereq_(92).getWeak; | |
var anObject = _dereq_(36); | |
var isObject = _dereq_(79); | |
var anInstance = _dereq_(35); | |
var forOf = _dereq_(66); | |
var createArrayMethod = _dereq_(40); | |
var $has = _dereq_(69); | |
var validate = _dereq_(147); | |
var arrayFind = createArrayMethod(5); | |
var arrayFindIndex = createArrayMethod(6); | |
var id = 0; | |
// fallback for uncaught frozen keys | |
var uncaughtFrozenStore = function (that) { | |
return that._l || (that._l = new UncaughtFrozenStore()); | |
}; | |
var UncaughtFrozenStore = function () { | |
this.a = []; | |
}; | |
var findUncaughtFrozen = function (store, key) { | |
return arrayFind(store.a, function (it) { | |
return it[0] === key; | |
}); | |
}; | |
UncaughtFrozenStore.prototype = { | |
get: function (key) { | |
var entry = findUncaughtFrozen(this, key); | |
if (entry) return entry[1]; | |
}, | |
has: function (key) { | |
return !!findUncaughtFrozen(this, key); | |
}, | |
set: function (key, value) { | |
var entry = findUncaughtFrozen(this, key); | |
if (entry) entry[1] = value; | |
else this.a.push([key, value]); | |
}, | |
'delete': function (key) { | |
var index = arrayFindIndex(this.a, function (it) { | |
return it[0] === key; | |
}); | |
if (~index) this.a.splice(index, 1); | |
return !!~index; | |
} | |
}; | |
module.exports = { | |
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { | |
var C = wrapper(function (that, iterable) { | |
anInstance(that, C, NAME, '_i'); | |
that._t = NAME; // collection type | |
that._i = id++; // collection id | |
that._l = undefined; // leak store for uncaught frozen objects | |
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); | |
}); | |
redefineAll(C.prototype, { | |
// 23.3.3.2 WeakMap.prototype.delete(key) | |
// 23.4.3.3 WeakSet.prototype.delete(value) | |
'delete': function (key) { | |
if (!isObject(key)) return false; | |
var data = getWeak(key); | |
if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); | |
return data && $has(data, this._i) && delete data[this._i]; | |
}, | |
// 23.3.3.4 WeakMap.prototype.has(key) | |
// 23.4.3.4 WeakSet.prototype.has(value) | |
has: function has(key) { | |
if (!isObject(key)) return false; | |
var data = getWeak(key); | |
if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); | |
return data && $has(data, this._i); | |
} | |
}); | |
return C; | |
}, | |
def: function (that, key, value) { | |
var data = getWeak(anObject(key), true); | |
if (data === true) uncaughtFrozenStore(that).set(key, value); | |
else data[that._i] = value; | |
return that; | |
}, | |
ufstore: uncaughtFrozenStore | |
}; | |
},{"115":115,"147":147,"35":35,"36":36,"40":40,"66":66,"69":69,"79":79,"92":92}],49:[function(_dereq_,module,exports){ | |
'use strict'; | |
var global = _dereq_(68); | |
var $export = _dereq_(60); | |
var redefine = _dereq_(116); | |
var redefineAll = _dereq_(115); | |
var meta = _dereq_(92); | |
var forOf = _dereq_(66); | |
var anInstance = _dereq_(35); | |
var isObject = _dereq_(79); | |
var fails = _dereq_(62); | |
var $iterDetect = _dereq_(84); | |
var setToStringTag = _dereq_(122); | |
var inheritIfRequired = _dereq_(73); | |
module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { | |
var Base = global[NAME]; | |
var C = Base; | |
var ADDER = IS_MAP ? 'set' : 'add'; | |
var proto = C && C.prototype; | |
var O = {}; | |
var fixMethod = function (KEY) { | |
var fn = proto[KEY]; | |
redefine(proto, KEY, | |
KEY == 'delete' ? function (a) { | |
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); | |
} : KEY == 'has' ? function has(a) { | |
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); | |
} : KEY == 'get' ? function get(a) { | |
return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); | |
} : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } | |
: function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } | |
); | |
}; | |
if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { | |
new C().entries().next(); | |
}))) { | |
// create collection constructor | |
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); | |
redefineAll(C.prototype, methods); | |
meta.NEED = true; | |
} else { | |
var instance = new C(); | |
// early implementations not supports chaining | |
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; | |
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false | |
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); | |
// most early implementations doesn't supports iterables, most modern - not close it correctly | |
var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new | |
// for early implementations -0 and +0 not the same | |
var BUGGY_ZERO = !IS_WEAK && fails(function () { | |
// V8 ~ Chromium 42- fails only with 5+ elements | |
var $instance = new C(); | |
var index = 5; | |
while (index--) $instance[ADDER](index, index); | |
return !$instance.has(-0); | |
}); | |
if (!ACCEPT_ITERABLES) { | |
C = wrapper(function (target, iterable) { | |
anInstance(target, C, NAME); | |
var that = inheritIfRequired(new Base(), target, C); | |
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); | |
return that; | |
}); | |
C.prototype = proto; | |
proto.constructor = C; | |
} | |
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { | |
fixMethod('delete'); | |
fixMethod('has'); | |
IS_MAP && fixMethod('get'); | |
} | |
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); | |
// weak collections should not contains .clear method | |
if (IS_WEAK && proto.clear) delete proto.clear; | |
} | |
setToStringTag(C, NAME); | |
O[NAME] = C; | |
$export($export.G + $export.W + $export.F * (C != Base), O); | |
if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); | |
return C; | |
}; | |
},{"115":115,"116":116,"122":122,"35":35,"60":60,"62":62,"66":66,"68":68,"73":73,"79":79,"84":84,"92":92}],50:[function(_dereq_,module,exports){ | |
arguments[4][16][0].apply(exports,arguments) | |
},{"16":16}],51:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $defineProperty = _dereq_(97); | |
var createDesc = _dereq_(114); | |
module.exports = function (object, index, value) { | |
if (index in object) $defineProperty.f(object, index, createDesc(0, value)); | |
else object[index] = value; | |
}; | |
},{"114":114,"97":97}],52:[function(_dereq_,module,exports){ | |
arguments[4][17][0].apply(exports,arguments) | |
},{"17":17,"31":31}],53:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() | |
var fails = _dereq_(62); | |
var getTime = Date.prototype.getTime; | |
var $toISOString = Date.prototype.toISOString; | |
var lz = function (num) { | |
return num > 9 ? num : '0' + num; | |
}; | |
// PhantomJS / old WebKit has a broken implementations | |
module.exports = (fails(function () { | |
return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; | |
}) || !fails(function () { | |
$toISOString.call(new Date(NaN)); | |
})) ? function toISOString() { | |
if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); | |
var d = this; | |
var y = d.getUTCFullYear(); | |
var m = d.getUTCMilliseconds(); | |
var s = y < 0 ? '-' : y > 9999 ? '+' : ''; | |
return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + | |
'-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + | |
'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + | |
':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; | |
} : $toISOString; | |
},{"62":62}],54:[function(_dereq_,module,exports){ | |
'use strict'; | |
var anObject = _dereq_(36); | |
var toPrimitive = _dereq_(141); | |
var NUMBER = 'number'; | |
module.exports = function (hint) { | |
if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); | |
return toPrimitive(anObject(this), hint != NUMBER); | |
}; | |
},{"141":141,"36":36}],55:[function(_dereq_,module,exports){ | |
// 7.2.1 RequireObjectCoercible(argument) | |
module.exports = function (it) { | |
if (it == undefined) throw TypeError("Can't call method on " + it); | |
return it; | |
}; | |
},{}],56:[function(_dereq_,module,exports){ | |
arguments[4][18][0].apply(exports,arguments) | |
},{"18":18,"62":62}],57:[function(_dereq_,module,exports){ | |
arguments[4][19][0].apply(exports,arguments) | |
},{"19":19,"68":68,"79":79}],58:[function(_dereq_,module,exports){ | |
// IE 8- don't enum bug keys | |
module.exports = ( | |
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' | |
).split(','); | |
},{}],59:[function(_dereq_,module,exports){ | |
// all enumerable object keys, includes symbols | |
var getKeys = _dereq_(105); | |
var gOPS = _dereq_(102); | |
var pIE = _dereq_(106); | |
module.exports = function (it) { | |
var result = getKeys(it); | |
var getSymbols = gOPS.f; | |
if (getSymbols) { | |
var symbols = getSymbols(it); | |
var isEnum = pIE.f; | |
var i = 0; | |
var key; | |
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); | |
} return result; | |
}; | |
},{"102":102,"105":105,"106":106}],60:[function(_dereq_,module,exports){ | |
var global = _dereq_(68); | |
var core = _dereq_(50); | |
var hide = _dereq_(70); | |
var redefine = _dereq_(116); | |
var ctx = _dereq_(52); | |
var PROTOTYPE = 'prototype'; | |
var $export = function (type, name, source) { | |
var IS_FORCED = type & $export.F; | |
var IS_GLOBAL = type & $export.G; | |
var IS_STATIC = type & $export.S; | |
var IS_PROTO = type & $export.P; | |
var IS_BIND = type & $export.B; | |
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; | |
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); | |
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); | |
var key, own, out, exp; | |
if (IS_GLOBAL) source = name; | |
for (key in source) { | |
// contains in native | |
own = !IS_FORCED && target && target[key] !== undefined; | |
// export native or passed | |
out = (own ? target : source)[key]; | |
// bind timers to global for call from export context | |
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; | |
// extend global | |
if (target) redefine(target, key, out, type & $export.U); | |
// export | |
if (exports[key] != out) hide(exports, key, exp); | |
if (IS_PROTO && expProto[key] != out) expProto[key] = out; | |
} | |
}; | |
global.core = core; | |
// type bitmap | |
$export.F = 1; // forced | |
$export.G = 2; // global | |
$export.S = 4; // static | |
$export.P = 8; // proto | |
$export.B = 16; // bind | |
$export.W = 32; // wrap | |
$export.U = 64; // safe | |
$export.R = 128; // real proto method for `library` | |
module.exports = $export; | |
},{"116":116,"50":50,"52":52,"68":68,"70":70}],61:[function(_dereq_,module,exports){ | |
var MATCH = _dereq_(150)('match'); | |
module.exports = function (KEY) { | |
var re = /./; | |
try { | |
'/./'[KEY](re); | |
} catch (e) { | |
try { | |
re[MATCH] = false; | |
return !'/./'[KEY](re); | |
} catch (f) { /* empty */ } | |
} return true; | |
}; | |
},{"150":150}],62:[function(_dereq_,module,exports){ | |
arguments[4][21][0].apply(exports,arguments) | |
},{"21":21}],63:[function(_dereq_,module,exports){ | |
'use strict'; | |
_dereq_(246); | |
var redefine = _dereq_(116); | |
var hide = _dereq_(70); | |
var fails = _dereq_(62); | |
var defined = _dereq_(55); | |
var wks = _dereq_(150); | |
var regexpExec = _dereq_(118); | |
var SPECIES = wks('species'); | |
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { | |
// #replace needs built-in support for named groups. | |
// #match works fine because it just return the exec results, even if it has | |
// a "grops" property. | |
var re = /./; | |
re.exec = function () { | |
var result = []; | |
result.groups = { a: '7' }; | |
return result; | |
}; | |
return ''.replace(re, '$<a>') !== '7'; | |
}); | |
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { | |
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec | |
var re = /(?:)/; | |
var originalExec = re.exec; | |
re.exec = function () { return originalExec.apply(this, arguments); }; | |
var result = 'ab'.split(re); | |
return result.length === 2 && result[0] === 'a' && result[1] === 'b'; | |
})(); | |
module.exports = function (KEY, length, exec) { | |
var SYMBOL = wks(KEY); | |
var DELEGATES_TO_SYMBOL = !fails(function () { | |
// String methods call symbol-named RegEp methods | |
var O = {}; | |
O[SYMBOL] = function () { return 7; }; | |
return ''[KEY](O) != 7; | |
}); | |
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { | |
// Symbol-named RegExp methods call .exec | |
var execCalled = false; | |
var re = /a/; | |
re.exec = function () { execCalled = true; return null; }; | |
if (KEY === 'split') { | |
// RegExp[@@split] doesn't call the regex's exec method, but first creates | |
// a new one. We need to return the patched regex when creating the new one. | |
re.constructor = {}; | |
re.constructor[SPECIES] = function () { return re; }; | |
} | |
re[SYMBOL](''); | |
return !execCalled; | |
}) : undefined; | |
if ( | |
!DELEGATES_TO_SYMBOL || | |
!DELEGATES_TO_EXEC || | |
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || | |
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) | |
) { | |
var nativeRegExpMethod = /./[SYMBOL]; | |
var fns = exec( | |
defined, | |
SYMBOL, | |
''[KEY], | |
function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { | |
if (regexp.exec === regexpExec) { | |
if (DELEGATES_TO_SYMBOL && !forceStringMethod) { | |
// The native String method already delegates to @@method (this | |
// polyfilled function), leasing to infinite recursion. | |
// We avoid it by directly calling the native @@method method. | |
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; | |
} | |
return { done: true, value: nativeMethod.call(str, regexp, arg2) }; | |
} | |
return { done: false }; | |
} | |
); | |
var strfn = fns[0]; | |
var rxfn = fns[1]; | |
redefine(String.prototype, KEY, strfn); | |
hide(RegExp.prototype, SYMBOL, length == 2 | |
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) | |
// 21.2.5.11 RegExp.prototype[@@split](string, limit) | |
? function (string, arg) { return rxfn.call(string, this, arg); } | |
// 21.2.5.6 RegExp.prototype[@@match](string) | |
// 21.2.5.9 RegExp.prototype[@@search](string) | |
: function (string) { return rxfn.call(string, this); } | |
); | |
} | |
}; | |
},{"116":116,"118":118,"150":150,"246":246,"55":55,"62":62,"70":70}],64:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 21.2.5.3 get RegExp.prototype.flags | |
var anObject = _dereq_(36); | |
module.exports = function () { | |
var that = anObject(this); | |
var result = ''; | |
if (that.global) result += 'g'; | |
if (that.ignoreCase) result += 'i'; | |
if (that.multiline) result += 'm'; | |
if (that.unicode) result += 'u'; | |
if (that.sticky) result += 'y'; | |
return result; | |
}; | |
},{"36":36}],65:[function(_dereq_,module,exports){ | |
'use strict'; | |
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray | |
var isArray = _dereq_(77); | |
var isObject = _dereq_(79); | |
var toLength = _dereq_(139); | |
var ctx = _dereq_(52); | |
var IS_CONCAT_SPREADABLE = _dereq_(150)('isConcatSpreadable'); | |
function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { | |
var targetIndex = start; | |
var sourceIndex = 0; | |
var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; | |
var element, spreadable; | |
while (sourceIndex < sourceLen) { | |
if (sourceIndex in source) { | |
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; | |
spreadable = false; | |
if (isObject(element)) { | |
spreadable = element[IS_CONCAT_SPREADABLE]; | |
spreadable = spreadable !== undefined ? !!spreadable : isArray(element); | |
} | |
if (spreadable && depth > 0) { | |
targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; | |
} else { | |
if (targetIndex >= 0x1fffffffffffff) throw TypeError(); | |
target[targetIndex] = element; | |
} | |
targetIndex++; | |
} | |
sourceIndex++; | |
} | |
return targetIndex; | |
} | |
module.exports = flattenIntoArray; | |
},{"139":139,"150":150,"52":52,"77":77,"79":79}],66:[function(_dereq_,module,exports){ | |
var ctx = _dereq_(52); | |
var call = _dereq_(81); | |
var isArrayIter = _dereq_(76); | |
var anObject = _dereq_(36); | |
var toLength = _dereq_(139); | |
var getIterFn = _dereq_(151); | |
var BREAK = {}; | |
var RETURN = {}; | |
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { | |
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); | |
var f = ctx(fn, that, entries ? 2 : 1); | |
var index = 0; | |
var length, step, iterator, result; | |
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); | |
// fast case for arrays with default iterator | |
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { | |
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); | |
if (result === BREAK || result === RETURN) return result; | |
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { | |
result = call(iterator, f, step.value, entries); | |
if (result === BREAK || result === RETURN) return result; | |
} | |
}; | |
exports.BREAK = BREAK; | |
exports.RETURN = RETURN; | |
},{"139":139,"151":151,"36":36,"52":52,"76":76,"81":81}],67:[function(_dereq_,module,exports){ | |
module.exports = _dereq_(124)('native-function-to-string', Function.toString); | |
},{"124":124}],68:[function(_dereq_,module,exports){ | |
arguments[4][22][0].apply(exports,arguments) | |
},{"22":22}],69:[function(_dereq_,module,exports){ | |
arguments[4][23][0].apply(exports,arguments) | |
},{"23":23}],70:[function(_dereq_,module,exports){ | |
arguments[4][24][0].apply(exports,arguments) | |
},{"114":114,"24":24,"56":56,"97":97}],71:[function(_dereq_,module,exports){ | |
var document = _dereq_(68).document; | |
module.exports = document && document.documentElement; | |
},{"68":68}],72:[function(_dereq_,module,exports){ | |
arguments[4][25][0].apply(exports,arguments) | |
},{"25":25,"56":56,"57":57,"62":62}],73:[function(_dereq_,module,exports){ | |
var isObject = _dereq_(79); | |
var setPrototypeOf = _dereq_(120).set; | |
module.exports = function (that, target, C) { | |
var S = target.constructor; | |
var P; | |
if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { | |
setPrototypeOf(that, P); | |
} return that; | |
}; | |
},{"120":120,"79":79}],74:[function(_dereq_,module,exports){ | |
// fast apply, http://jsperf.lnkit.com/fast-apply/5 | |
module.exports = function (fn, args, that) { | |
var un = that === undefined; | |
switch (args.length) { | |
case 0: return un ? fn() | |
: fn.call(that); | |
case 1: return un ? fn(args[0]) | |
: fn.call(that, args[0]); | |
case 2: return un ? fn(args[0], args[1]) | |
: fn.call(that, args[0], args[1]); | |
case 3: return un ? fn(args[0], args[1], args[2]) | |
: fn.call(that, args[0], args[1], args[2]); | |
case 4: return un ? fn(args[0], args[1], args[2], args[3]) | |
: fn.call(that, args[0], args[1], args[2], args[3]); | |
} return fn.apply(that, args); | |
}; | |
},{}],75:[function(_dereq_,module,exports){ | |
// fallback for non-array-like ES3 and non-enumerable old V8 strings | |
var cof = _dereq_(46); | |
// eslint-disable-next-line no-prototype-builtins | |
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { | |
return cof(it) == 'String' ? it.split('') : Object(it); | |
}; | |
},{"46":46}],76:[function(_dereq_,module,exports){ | |
// check on default Array iterator | |
var Iterators = _dereq_(86); | |
var ITERATOR = _dereq_(150)('iterator'); | |
var ArrayProto = Array.prototype; | |
module.exports = function (it) { | |
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); | |
}; | |
},{"150":150,"86":86}],77:[function(_dereq_,module,exports){ | |
// 7.2.2 IsArray(argument) | |
var cof = _dereq_(46); | |
module.exports = Array.isArray || function isArray(arg) { | |
return cof(arg) == 'Array'; | |
}; | |
},{"46":46}],78:[function(_dereq_,module,exports){ | |
// 20.1.2.3 Number.isInteger(number) | |
var isObject = _dereq_(79); | |
var floor = Math.floor; | |
module.exports = function isInteger(it) { | |
return !isObject(it) && isFinite(it) && floor(it) === it; | |
}; | |
},{"79":79}],79:[function(_dereq_,module,exports){ | |
arguments[4][26][0].apply(exports,arguments) | |
},{"26":26}],80:[function(_dereq_,module,exports){ | |
// 7.2.8 IsRegExp(argument) | |
var isObject = _dereq_(79); | |
var cof = _dereq_(46); | |
var MATCH = _dereq_(150)('match'); | |
module.exports = function (it) { | |
var isRegExp; | |
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); | |
}; | |
},{"150":150,"46":46,"79":79}],81:[function(_dereq_,module,exports){ | |
// call something on iterator step with safe closing on error | |
var anObject = _dereq_(36); | |
module.exports = function (iterator, fn, value, entries) { | |
try { | |
return entries ? fn(anObject(value)[0], value[1]) : fn(value); | |
// 7.4.6 IteratorClose(iterator, completion) | |
} catch (e) { | |
var ret = iterator['return']; | |
if (ret !== undefined) anObject(ret.call(iterator)); | |
throw e; | |
} | |
}; | |
},{"36":36}],82:[function(_dereq_,module,exports){ | |
'use strict'; | |
var create = _dereq_(96); | |
var descriptor = _dereq_(114); | |
var setToStringTag = _dereq_(122); | |
var IteratorPrototype = {}; | |
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() | |
_dereq_(70)(IteratorPrototype, _dereq_(150)('iterator'), function () { return this; }); | |
module.exports = function (Constructor, NAME, next) { | |
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); | |
setToStringTag(Constructor, NAME + ' Iterator'); | |
}; | |
},{"114":114,"122":122,"150":150,"70":70,"96":96}],83:[function(_dereq_,module,exports){ | |
'use strict'; | |
var LIBRARY = _dereq_(87); | |
var $export = _dereq_(60); | |
var redefine = _dereq_(116); | |
var hide = _dereq_(70); | |
var Iterators = _dereq_(86); | |
var $iterCreate = _dereq_(82); | |
var setToStringTag = _dereq_(122); | |
var getPrototypeOf = _dereq_(103); | |
var ITERATOR = _dereq_(150)('iterator'); | |
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` | |
var FF_ITERATOR = '@@iterator'; | |
var KEYS = 'keys'; | |
var VALUES = 'values'; | |
var returnThis = function () { return this; }; | |
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { | |
$iterCreate(Constructor, NAME, next); | |
var getMethod = function (kind) { | |
if (!BUGGY && kind in proto) return proto[kind]; | |
switch (kind) { | |
case KEYS: return function keys() { return new Constructor(this, kind); }; | |
case VALUES: return function values() { return new Constructor(this, kind); }; | |
} return function entries() { return new Constructor(this, kind); }; | |
}; | |
var TAG = NAME + ' Iterator'; | |
var DEF_VALUES = DEFAULT == VALUES; | |
var VALUES_BUG = false; | |
var proto = Base.prototype; | |
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; | |
var $default = $native || getMethod(DEFAULT); | |
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; | |
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; | |
var methods, key, IteratorPrototype; | |
// Fix native | |
if ($anyNative) { | |
IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); | |
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { | |
// Set @@toStringTag to native iterators | |
setToStringTag(IteratorPrototype, TAG, true); | |
// fix for some old engines | |
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); | |
} | |
} | |
// fix Array#{values, @@iterator}.name in V8 / FF | |
if (DEF_VALUES && $native && $native.name !== VALUES) { | |
VALUES_BUG = true; | |
$default = function values() { return $native.call(this); }; | |
} | |
// Define iterator | |
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { | |
hide(proto, ITERATOR, $default); | |
} | |
// Plug for library | |
Iterators[NAME] = $default; | |
Iterators[TAG] = returnThis; | |
if (DEFAULT) { | |
methods = { | |
values: DEF_VALUES ? $default : getMethod(VALUES), | |
keys: IS_SET ? $default : getMethod(KEYS), | |
entries: $entries | |
}; | |
if (FORCED) for (key in methods) { | |
if (!(key in proto)) redefine(proto, key, methods[key]); | |
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); | |
} | |
return methods; | |
}; | |
},{"103":103,"116":116,"122":122,"150":150,"60":60,"70":70,"82":82,"86":86,"87":87}],84:[function(_dereq_,module,exports){ | |
var ITERATOR = _dereq_(150)('iterator'); | |
var SAFE_CLOSING = false; | |
try { | |
var riter = [7][ITERATOR](); | |
riter['return'] = function () { SAFE_CLOSING = true; }; | |
// eslint-disable-next-line no-throw-literal | |
Array.from(riter, function () { throw 2; }); | |
} catch (e) { /* empty */ } | |
module.exports = function (exec, skipClosing) { | |
if (!skipClosing && !SAFE_CLOSING) return false; | |
var safe = false; | |
try { | |
var arr = [7]; | |
var iter = arr[ITERATOR](); | |
iter.next = function () { return { done: safe = true }; }; | |
arr[ITERATOR] = function () { return iter; }; | |
exec(arr); | |
} catch (e) { /* empty */ } | |
return safe; | |
}; | |
},{"150":150}],85:[function(_dereq_,module,exports){ | |
module.exports = function (done, value) { | |
return { value: value, done: !!done }; | |
}; | |
},{}],86:[function(_dereq_,module,exports){ | |
module.exports = {}; | |
},{}],87:[function(_dereq_,module,exports){ | |
module.exports = false; | |
},{}],88:[function(_dereq_,module,exports){ | |
// 20.2.2.14 Math.expm1(x) | |
var $expm1 = Math.expm1; | |
module.exports = (!$expm1 | |
// Old FF bug | |
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 | |
// Tor Browser bug | |
|| $expm1(-2e-17) != -2e-17 | |
) ? function expm1(x) { | |
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; | |
} : $expm1; | |
},{}],89:[function(_dereq_,module,exports){ | |
// 20.2.2.16 Math.fround(x) | |
var sign = _dereq_(91); | |
var pow = Math.pow; | |
var EPSILON = pow(2, -52); | |
var EPSILON32 = pow(2, -23); | |
var MAX32 = pow(2, 127) * (2 - EPSILON32); | |
var MIN32 = pow(2, -126); | |
var roundTiesToEven = function (n) { | |
return n + 1 / EPSILON - 1 / EPSILON; | |
}; | |
module.exports = Math.fround || function fround(x) { | |
var $abs = Math.abs(x); | |
var $sign = sign(x); | |
var a, result; | |
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; | |
a = (1 + EPSILON32 / EPSILON) * $abs; | |
result = a - (a - $abs); | |
// eslint-disable-next-line no-self-compare | |
if (result > MAX32 || result != result) return $sign * Infinity; | |
return $sign * result; | |
}; | |
},{"91":91}],90:[function(_dereq_,module,exports){ | |
// 20.2.2.20 Math.log1p(x) | |
module.exports = Math.log1p || function log1p(x) { | |
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); | |
}; | |
},{}],91:[function(_dereq_,module,exports){ | |
// 20.2.2.28 Math.sign(x) | |
module.exports = Math.sign || function sign(x) { | |
// eslint-disable-next-line no-self-compare | |
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; | |
}; | |
},{}],92:[function(_dereq_,module,exports){ | |
var META = _dereq_(145)('meta'); | |
var isObject = _dereq_(79); | |
var has = _dereq_(69); | |
var setDesc = _dereq_(97).f; | |
var id = 0; | |
var isExtensible = Object.isExtensible || function () { | |
return true; | |
}; | |
var FREEZE = !_dereq_(62)(function () { | |
return isExtensible(Object.preventExtensions({})); | |
}); | |
var setMeta = function (it) { | |
setDesc(it, META, { value: { | |
i: 'O' + ++id, // object ID | |
w: {} // weak collections IDs | |
} }); | |
}; | |
var fastKey = function (it, create) { | |
// return primitive with prefix | |
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; | |
if (!has(it, META)) { | |
// can't set metadata to uncaught frozen object | |
if (!isExtensible(it)) return 'F'; | |
// not necessary to add metadata | |
if (!create) return 'E'; | |
// add missing metadata | |
setMeta(it); | |
// return object ID | |
} return it[META].i; | |
}; | |
var getWeak = function (it, create) { | |
if (!has(it, META)) { | |
// can't set metadata to uncaught frozen object | |
if (!isExtensible(it)) return true; | |
// not necessary to add metadata | |
if (!create) return false; | |
// add missing metadata | |
setMeta(it); | |
// return hash weak collections IDs | |
} return it[META].w; | |
}; | |
// add metadata on freeze-family methods calling | |
var onFreeze = function (it) { | |
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); | |
return it; | |
}; | |
var meta = module.exports = { | |
KEY: META, | |
NEED: false, | |
fastKey: fastKey, | |
getWeak: getWeak, | |
onFreeze: onFreeze | |
}; | |
},{"145":145,"62":62,"69":69,"79":79,"97":97}],93:[function(_dereq_,module,exports){ | |
var global = _dereq_(68); | |
var macrotask = _dereq_(134).set; | |
var Observer = global.MutationObserver || global.WebKitMutationObserver; | |
var process = global.process; | |
var Promise = global.Promise; | |
var isNode = _dereq_(46)(process) == 'process'; | |
module.exports = function () { | |
var head, last, notify; | |
var flush = function () { | |
var parent, fn; | |
if (isNode && (parent = process.domain)) parent.exit(); | |
while (head) { | |
fn = head.fn; | |
head = head.next; | |
try { | |
fn(); | |
} catch (e) { | |
if (head) notify(); | |
else last = undefined; | |
throw e; | |
} | |
} last = undefined; | |
if (parent) parent.enter(); | |
}; | |
// Node.js | |
if (isNode) { | |
notify = function () { | |
process.nextTick(flush); | |
}; | |
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 | |
} else if (Observer && !(global.navigator && global.navigator.standalone)) { | |
var toggle = true; | |
var node = document.createTextNode(''); | |
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new | |
notify = function () { | |
node.data = toggle = !toggle; | |
}; | |
// environments with maybe non-completely correct, but existent Promise | |
} else if (Promise && Promise.resolve) { | |
// Promise.resolve without an argument throws an error in LG WebOS 2 | |
var promise = Promise.resolve(undefined); | |
notify = function () { | |
promise.then(flush); | |
}; | |
// for other environments - macrotask based on: | |
// - setImmediate | |
// - MessageChannel | |
// - window.postMessag | |
// - onreadystatechange | |
// - setTimeout | |
} else { | |
notify = function () { | |
// strange IE + webpack dev server bug - use .call(global) | |
macrotask.call(global, flush); | |
}; | |
} | |
return function (fn) { | |
var task = { fn: fn, next: undefined }; | |
if (last) last.next = task; | |
if (!head) { | |
head = task; | |
notify(); | |
} last = task; | |
}; | |
}; | |
},{"134":134,"46":46,"68":68}],94:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 25.4.1.5 NewPromiseCapability(C) | |
var aFunction = _dereq_(31); | |
function PromiseCapability(C) { | |
var resolve, reject; | |
this.promise = new C(function ($$resolve, $$reject) { | |
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); | |
resolve = $$resolve; | |
reject = $$reject; | |
}); | |
this.resolve = aFunction(resolve); | |
this.reject = aFunction(reject); | |
} | |
module.exports.f = function (C) { | |
return new PromiseCapability(C); | |
}; | |
},{"31":31}],95:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 19.1.2.1 Object.assign(target, source, ...) | |
var DESCRIPTORS = _dereq_(56); | |
var getKeys = _dereq_(105); | |
var gOPS = _dereq_(102); | |
var pIE = _dereq_(106); | |
var toObject = _dereq_(140); | |
var IObject = _dereq_(75); | |
var $assign = Object.assign; | |
// should work with symbols and should have deterministic property order (V8 bug) | |
module.exports = !$assign || _dereq_(62)(function () { | |
var A = {}; | |
var B = {}; | |
// eslint-disable-next-line no-undef | |
var S = Symbol(); | |
var K = 'abcdefghijklmnopqrst'; | |
A[S] = 7; | |
K.split('').forEach(function (k) { B[k] = k; }); | |
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; | |
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars | |
var T = toObject(target); | |
var aLen = arguments.length; | |
var index = 1; | |
var getSymbols = gOPS.f; | |
var isEnum = pIE.f; | |
while (aLen > index) { | |
var S = IObject(arguments[index++]); | |
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); | |
var length = keys.length; | |
var j = 0; | |
var key; | |
while (length > j) { | |
key = keys[j++]; | |
if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key]; | |
} | |
} return T; | |
} : $assign; | |
},{"102":102,"105":105,"106":106,"140":140,"56":56,"62":62,"75":75}],96:[function(_dereq_,module,exports){ | |
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) | |
var anObject = _dereq_(36); | |
var dPs = _dereq_(98); | |
var enumBugKeys = _dereq_(58); | |
var IE_PROTO = _dereq_(123)('IE_PROTO'); | |
var Empty = function () { /* empty */ }; | |
var PROTOTYPE = 'prototype'; | |
// Create object with fake `null` prototype: use iframe Object with cleared prototype | |
var createDict = function () { | |
if (typeof(window) !== 'undefined') { | |
// Thrash, waste and sodomy: IE GC bug | |
var iframe = _dereq_(57)('iframe'); | |
var i = enumBugKeys.length; | |
var lt = '<'; | |
var gt = '>'; | |
var iframeDocument; | |
iframe.style.display = 'none'; | |
_dereq_(71).appendChild(iframe); | |
iframe.src = 'javascript:'; // eslint-disable-line no-script-url | |
// createDict = iframe.contentWindow.Object; | |
// html.removeChild(iframe); | |
iframeDocument = iframe.contentWindow.document; | |
iframeDocument.open(); | |
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); | |
iframeDocument.close(); | |
createDict = iframeDocument.F; | |
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; | |
return createDict(); | |
} | |
}; | |
module.exports = Object.create || function create(O, Properties) { | |
var result; | |
if (O !== null) { | |
Empty[PROTOTYPE] = anObject(O); | |
result = new Empty(); | |
Empty[PROTOTYPE] = null; | |
// add "__proto__" for Object.getPrototypeOf polyfill | |
result[IE_PROTO] = O; | |
} else result = createDict(); | |
return Properties === undefined ? result : dPs(result, Properties); | |
}; | |
},{"123":123,"36":36,"57":57,"58":58,"71":71,"98":98}],97:[function(_dereq_,module,exports){ | |
arguments[4][27][0].apply(exports,arguments) | |
},{"141":141,"27":27,"36":36,"56":56,"72":72}],98:[function(_dereq_,module,exports){ | |
var dP = _dereq_(97); | |
var anObject = _dereq_(36); | |
var getKeys = _dereq_(105); | |
module.exports = _dereq_(56) ? Object.defineProperties : function defineProperties(O, Properties) { | |
anObject(O); | |
var keys = getKeys(Properties); | |
var length = keys.length; | |
var i = 0; | |
var P; | |
while (length > i) dP.f(O, P = keys[i++], Properties[P]); | |
return O; | |
}; | |
},{"105":105,"36":36,"56":56,"97":97}],99:[function(_dereq_,module,exports){ | |
var pIE = _dereq_(106); | |
var createDesc = _dereq_(114); | |
var toIObject = _dereq_(138); | |
var toPrimitive = _dereq_(141); | |
var has = _dereq_(69); | |
var IE8_DOM_DEFINE = _dereq_(72); | |
var gOPD = Object.getOwnPropertyDescriptor; | |
exports.f = _dereq_(56) ? gOPD : function getOwnPropertyDescriptor(O, P) { | |
O = toIObject(O); | |
P = toPrimitive(P, true); | |
if (IE8_DOM_DEFINE) try { | |
return gOPD(O, P); | |
} catch (e) { /* empty */ } | |
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); | |
}; | |
},{"106":106,"114":114,"138":138,"141":141,"56":56,"69":69,"72":72}],100:[function(_dereq_,module,exports){ | |
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window | |
var toIObject = _dereq_(138); | |
var gOPN = _dereq_(101).f; | |
var toString = {}.toString; | |
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames | |
? Object.getOwnPropertyNames(window) : []; | |
var getWindowNames = function (it) { | |
try { | |
return gOPN(it); | |
} catch (e) { | |
return windowNames.slice(); | |
} | |
}; | |
module.exports.f = function getOwnPropertyNames(it) { | |
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); | |
}; | |
},{"101":101,"138":138}],101:[function(_dereq_,module,exports){ | |
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) | |
var $keys = _dereq_(104); | |
var hiddenKeys = _dereq_(58).concat('length', 'prototype'); | |
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { | |
return $keys(O, hiddenKeys); | |
}; | |
},{"104":104,"58":58}],102:[function(_dereq_,module,exports){ | |
exports.f = Object.getOwnPropertySymbols; | |
},{}],103:[function(_dereq_,module,exports){ | |
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) | |
var has = _dereq_(69); | |
var toObject = _dereq_(140); | |
var IE_PROTO = _dereq_(123)('IE_PROTO'); | |
var ObjectProto = Object.prototype; | |
module.exports = Object.getPrototypeOf || function (O) { | |
O = toObject(O); | |
if (has(O, IE_PROTO)) return O[IE_PROTO]; | |
if (typeof O.constructor == 'function' && O instanceof O.constructor) { | |
return O.constructor.prototype; | |
} return O instanceof Object ? ObjectProto : null; | |
}; | |
},{"123":123,"140":140,"69":69}],104:[function(_dereq_,module,exports){ | |
var has = _dereq_(69); | |
var toIObject = _dereq_(138); | |
var arrayIndexOf = _dereq_(39)(false); | |
var IE_PROTO = _dereq_(123)('IE_PROTO'); | |
module.exports = function (object, names) { | |
var O = toIObject(object); | |
var i = 0; | |
var result = []; | |
var key; | |
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); | |
// Don't enum bug & hidden keys | |
while (names.length > i) if (has(O, key = names[i++])) { | |
~arrayIndexOf(result, key) || result.push(key); | |
} | |
return result; | |
}; | |
},{"123":123,"138":138,"39":39,"69":69}],105:[function(_dereq_,module,exports){ | |
// 19.1.2.14 / 15.2.3.14 Object.keys(O) | |
var $keys = _dereq_(104); | |
var enumBugKeys = _dereq_(58); | |
module.exports = Object.keys || function keys(O) { | |
return $keys(O, enumBugKeys); | |
}; | |
},{"104":104,"58":58}],106:[function(_dereq_,module,exports){ | |
exports.f = {}.propertyIsEnumerable; | |
},{}],107:[function(_dereq_,module,exports){ | |
// most Object methods by ES6 should accept primitives | |
var $export = _dereq_(60); | |
var core = _dereq_(50); | |
var fails = _dereq_(62); | |
module.exports = function (KEY, exec) { | |
var fn = (core.Object || {})[KEY] || Object[KEY]; | |
var exp = {}; | |
exp[KEY] = exec(fn); | |
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); | |
}; | |
},{"50":50,"60":60,"62":62}],108:[function(_dereq_,module,exports){ | |
var DESCRIPTORS = _dereq_(56); | |
var getKeys = _dereq_(105); | |
var toIObject = _dereq_(138); | |
var isEnum = _dereq_(106).f; | |
module.exports = function (isEntries) { | |
return function (it) { | |
var O = toIObject(it); | |
var keys = getKeys(O); | |
var length = keys.length; | |
var i = 0; | |
var result = []; | |
var key; | |
while (length > i) { | |
key = keys[i++]; | |
if (!DESCRIPTORS || isEnum.call(O, key)) { | |
result.push(isEntries ? [key, O[key]] : O[key]); | |
} | |
} | |
return result; | |
}; | |
}; | |
},{"105":105,"106":106,"138":138,"56":56}],109:[function(_dereq_,module,exports){ | |
// all object keys, includes non-enumerable and symbols | |
var gOPN = _dereq_(101); | |
var gOPS = _dereq_(102); | |
var anObject = _dereq_(36); | |
var Reflect = _dereq_(68).Reflect; | |
module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { | |
var keys = gOPN.f(anObject(it)); | |
var getSymbols = gOPS.f; | |
return getSymbols ? keys.concat(getSymbols(it)) : keys; | |
}; | |
},{"101":101,"102":102,"36":36,"68":68}],110:[function(_dereq_,module,exports){ | |
var $parseFloat = _dereq_(68).parseFloat; | |
var $trim = _dereq_(132).trim; | |
module.exports = 1 / $parseFloat(_dereq_(133) + '-0') !== -Infinity ? function parseFloat(str) { | |
var string = $trim(String(str), 3); | |
var result = $parseFloat(string); | |
return result === 0 && string.charAt(0) == '-' ? -0 : result; | |
} : $parseFloat; | |
},{"132":132,"133":133,"68":68}],111:[function(_dereq_,module,exports){ | |
var $parseInt = _dereq_(68).parseInt; | |
var $trim = _dereq_(132).trim; | |
var ws = _dereq_(133); | |
var hex = /^[-+]?0[xX]/; | |
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { | |
var string = $trim(String(str), 3); | |
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); | |
} : $parseInt; | |
},{"132":132,"133":133,"68":68}],112:[function(_dereq_,module,exports){ | |
module.exports = function (exec) { | |
try { | |
return { e: false, v: exec() }; | |
} catch (e) { | |
return { e: true, v: e }; | |
} | |
}; | |
},{}],113:[function(_dereq_,module,exports){ | |
var anObject = _dereq_(36); | |
var isObject = _dereq_(79); | |
var newPromiseCapability = _dereq_(94); | |
module.exports = function (C, x) { | |
anObject(C); | |
if (isObject(x) && x.constructor === C) return x; | |
var promiseCapability = newPromiseCapability.f(C); | |
var resolve = promiseCapability.resolve; | |
resolve(x); | |
return promiseCapability.promise; | |
}; | |
},{"36":36,"79":79,"94":94}],114:[function(_dereq_,module,exports){ | |
arguments[4][28][0].apply(exports,arguments) | |
},{"28":28}],115:[function(_dereq_,module,exports){ | |
var redefine = _dereq_(116); | |
module.exports = function (target, src, safe) { | |
for (var key in src) redefine(target, key, src[key], safe); | |
return target; | |
}; | |
},{"116":116}],116:[function(_dereq_,module,exports){ | |
var global = _dereq_(68); | |
var hide = _dereq_(70); | |
var has = _dereq_(69); | |
var SRC = _dereq_(145)('src'); | |
var $toString = _dereq_(67); | |
var TO_STRING = 'toString'; | |
var TPL = ('' + $toString).split(TO_STRING); | |
_dereq_(50).inspectSource = function (it) { | |
return $toString.call(it); | |
}; | |
(module.exports = function (O, key, val, safe) { | |
var isFunction = typeof val == 'function'; | |
if (isFunction) has(val, 'name') || hide(val, 'name', key); | |
if (O[key] === val) return; | |
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); | |
if (O === global) { | |
O[key] = val; | |
} else if (!safe) { | |
delete O[key]; | |
hide(O, key, val); | |
} else if (O[key]) { | |
O[key] = val; | |
} else { | |
hide(O, key, val); | |
} | |
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative | |
})(Function.prototype, TO_STRING, function toString() { | |
return typeof this == 'function' && this[SRC] || $toString.call(this); | |
}); | |
},{"145":145,"50":50,"67":67,"68":68,"69":69,"70":70}],117:[function(_dereq_,module,exports){ | |
'use strict'; | |
var classof = _dereq_(45); | |
var builtinExec = RegExp.prototype.exec; | |
// `RegExpExec` abstract operation | |
// https://tc39.github.io/ecma262/#sec-regexpexec | |
module.exports = function (R, S) { | |
var exec = R.exec; | |
if (typeof exec === 'function') { | |
var result = exec.call(R, S); | |
if (typeof result !== 'object') { | |
throw new TypeError('RegExp exec method returned something other than an Object or null'); | |
} | |
return result; | |
} | |
if (classof(R) !== 'RegExp') { | |
throw new TypeError('RegExp#exec called on incompatible receiver'); | |
} | |
return builtinExec.call(R, S); | |
}; | |
},{"45":45}],118:[function(_dereq_,module,exports){ | |
'use strict'; | |
var regexpFlags = _dereq_(64); | |
var nativeExec = RegExp.prototype.exec; | |
// This always refers to the native implementation, because the | |
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, | |
// which loads this file before patching the method. | |
var nativeReplace = String.prototype.replace; | |
var patchedExec = nativeExec; | |
var LAST_INDEX = 'lastIndex'; | |
var UPDATES_LAST_INDEX_WRONG = (function () { | |
var re1 = /a/, | |
re2 = /b*/g; | |
nativeExec.call(re1, 'a'); | |
nativeExec.call(re2, 'a'); | |
return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; | |
})(); | |
// nonparticipating capturing group, copied from es5-shim's String#split patch. | |
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; | |
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; | |
if (PATCH) { | |
patchedExec = function exec(str) { | |
var re = this; | |
var lastIndex, reCopy, match, i; | |
if (NPCG_INCLUDED) { | |
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); | |
} | |
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; | |
match = nativeExec.call(re, str); | |
if (UPDATES_LAST_INDEX_WRONG && match) { | |
re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; | |
} | |
if (NPCG_INCLUDED && match && match.length > 1) { | |
// Fix browsers whose `exec` methods don't consistently return `undefined` | |
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ | |
// eslint-disable-next-line no-loop-func | |
nativeReplace.call(match[0], reCopy, function () { | |
for (i = 1; i < arguments.length - 2; i++) { | |
if (arguments[i] === undefined) match[i] = undefined; | |
} | |
}); | |
} | |
return match; | |
}; | |
} | |
module.exports = patchedExec; | |
},{"64":64}],119:[function(_dereq_,module,exports){ | |
// 7.2.9 SameValue(x, y) | |
module.exports = Object.is || function is(x, y) { | |
// eslint-disable-next-line no-self-compare | |
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; | |
}; | |
},{}],120:[function(_dereq_,module,exports){ | |
// Works with __proto__ only. Old v8 can't work with null proto objects. | |
/* eslint-disable no-proto */ | |
var isObject = _dereq_(79); | |
var anObject = _dereq_(36); | |
var check = function (O, proto) { | |
anObject(O); | |
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); | |
}; | |
module.exports = { | |
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line | |
function (test, buggy, set) { | |
try { | |
set = _dereq_(52)(Function.call, _dereq_(99).f(Object.prototype, '__proto__').set, 2); | |
set(test, []); | |
buggy = !(test instanceof Array); | |
} catch (e) { buggy = true; } | |
return function setPrototypeOf(O, proto) { | |
check(O, proto); | |
if (buggy) O.__proto__ = proto; | |
else set(O, proto); | |
return O; | |
}; | |
}({}, false) : undefined), | |
check: check | |
}; | |
},{"36":36,"52":52,"79":79,"99":99}],121:[function(_dereq_,module,exports){ | |
'use strict'; | |
var global = _dereq_(68); | |
var dP = _dereq_(97); | |
var DESCRIPTORS = _dereq_(56); | |
var SPECIES = _dereq_(150)('species'); | |
module.exports = function (KEY) { | |
var C = global[KEY]; | |
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { | |
configurable: true, | |
get: function () { return this; } | |
}); | |
}; | |
},{"150":150,"56":56,"68":68,"97":97}],122:[function(_dereq_,module,exports){ | |
var def = _dereq_(97).f; | |
var has = _dereq_(69); | |
var TAG = _dereq_(150)('toStringTag'); | |
module.exports = function (it, tag, stat) { | |
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); | |
}; | |
},{"150":150,"69":69,"97":97}],123:[function(_dereq_,module,exports){ | |
var shared = _dereq_(124)('keys'); | |
var uid = _dereq_(145); | |
module.exports = function (key) { | |
return shared[key] || (shared[key] = uid(key)); | |
}; | |
},{"124":124,"145":145}],124:[function(_dereq_,module,exports){ | |
var core = _dereq_(50); | |
var global = _dereq_(68); | |
var SHARED = '__core-js_shared__'; | |
var store = global[SHARED] || (global[SHARED] = {}); | |
(module.exports = function (key, value) { | |
return store[key] || (store[key] = value !== undefined ? value : {}); | |
})('versions', []).push({ | |
version: core.version, | |
mode: _dereq_(87) ? 'pure' : 'global', | |
copyright: '© 2019 Denis Pushkarev (zloirock.ru)' | |
}); | |
},{"50":50,"68":68,"87":87}],125:[function(_dereq_,module,exports){ | |
// 7.3.20 SpeciesConstructor(O, defaultConstructor) | |
var anObject = _dereq_(36); | |
var aFunction = _dereq_(31); | |
var SPECIES = _dereq_(150)('species'); | |
module.exports = function (O, D) { | |
var C = anObject(O).constructor; | |
var S; | |
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); | |
}; | |
},{"150":150,"31":31,"36":36}],126:[function(_dereq_,module,exports){ | |
'use strict'; | |
var fails = _dereq_(62); | |
module.exports = function (method, arg) { | |
return !!method && fails(function () { | |
// eslint-disable-next-line no-useless-call | |
arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); | |
}); | |
}; | |
},{"62":62}],127:[function(_dereq_,module,exports){ | |
var toInteger = _dereq_(137); | |
var defined = _dereq_(55); | |
// true -> String#at | |
// false -> String#codePointAt | |
module.exports = function (TO_STRING) { | |
return function (that, pos) { | |
var s = String(defined(that)); | |
var i = toInteger(pos); | |
var l = s.length; | |
var a, b; | |
if (i < 0 || i >= l) return TO_STRING ? '' : undefined; | |
a = s.charCodeAt(i); | |
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff | |
? TO_STRING ? s.charAt(i) : a | |
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; | |
}; | |
}; | |
},{"137":137,"55":55}],128:[function(_dereq_,module,exports){ | |
// helper for String#{startsWith, endsWith, includes} | |
var isRegExp = _dereq_(80); | |
var defined = _dereq_(55); | |
module.exports = function (that, searchString, NAME) { | |
if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); | |
return String(defined(that)); | |
}; | |
},{"55":55,"80":80}],129:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var fails = _dereq_(62); | |
var defined = _dereq_(55); | |
var quot = /"/g; | |
// B.2.3.2.1 CreateHTML(string, tag, attribute, value) | |
var createHTML = function (string, tag, attribute, value) { | |
var S = String(defined(string)); | |
var p1 = '<' + tag; | |
if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; | |
return p1 + '>' + S + '</' + tag + '>'; | |
}; | |
module.exports = function (NAME, exec) { | |
var O = {}; | |
O[NAME] = exec(createHTML); | |
$export($export.P + $export.F * fails(function () { | |
var test = ''[NAME]('"'); | |
return test !== test.toLowerCase() || test.split('"').length > 3; | |
}), 'String', O); | |
}; | |
},{"55":55,"60":60,"62":62}],130:[function(_dereq_,module,exports){ | |
// https://github.com/tc39/proposal-string-pad-start-end | |
var toLength = _dereq_(139); | |
var repeat = _dereq_(131); | |
var defined = _dereq_(55); | |
module.exports = function (that, maxLength, fillString, left) { | |
var S = String(defined(that)); | |
var stringLength = S.length; | |
var fillStr = fillString === undefined ? ' ' : String(fillString); | |
var intMaxLength = toLength(maxLength); | |
if (intMaxLength <= stringLength || fillStr == '') return S; | |
var fillLen = intMaxLength - stringLength; | |
var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); | |
if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); | |
return left ? stringFiller + S : S + stringFiller; | |
}; | |
},{"131":131,"139":139,"55":55}],131:[function(_dereq_,module,exports){ | |
'use strict'; | |
var toInteger = _dereq_(137); | |
var defined = _dereq_(55); | |
module.exports = function repeat(count) { | |
var str = String(defined(this)); | |
var res = ''; | |
var n = toInteger(count); | |
if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); | |
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; | |
return res; | |
}; | |
},{"137":137,"55":55}],132:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var defined = _dereq_(55); | |
var fails = _dereq_(62); | |
var spaces = _dereq_(133); | |
var space = '[' + spaces + ']'; | |
var non = '\u200b\u0085'; | |
var ltrim = RegExp('^' + space + space + '*'); | |
var rtrim = RegExp(space + space + '*$'); | |
var exporter = function (KEY, exec, ALIAS) { | |
var exp = {}; | |
var FORCE = fails(function () { | |
return !!spaces[KEY]() || non[KEY]() != non; | |
}); | |
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; | |
if (ALIAS) exp[ALIAS] = fn; | |
$export($export.P + $export.F * FORCE, 'String', exp); | |
}; | |
// 1 -> String#trimLeft | |
// 2 -> String#trimRight | |
// 3 -> String#trim | |
var trim = exporter.trim = function (string, TYPE) { | |
string = String(defined(string)); | |
if (TYPE & 1) string = string.replace(ltrim, ''); | |
if (TYPE & 2) string = string.replace(rtrim, ''); | |
return string; | |
}; | |
module.exports = exporter; | |
},{"133":133,"55":55,"60":60,"62":62}],133:[function(_dereq_,module,exports){ | |
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + | |
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; | |
},{}],134:[function(_dereq_,module,exports){ | |
var ctx = _dereq_(52); | |
var invoke = _dereq_(74); | |
var html = _dereq_(71); | |
var cel = _dereq_(57); | |
var global = _dereq_(68); | |
var process = global.process; | |
var setTask = global.setImmediate; | |
var clearTask = global.clearImmediate; | |
var MessageChannel = global.MessageChannel; | |
var Dispatch = global.Dispatch; | |
var counter = 0; | |
var queue = {}; | |
var ONREADYSTATECHANGE = 'onreadystatechange'; | |
var defer, channel, port; | |
var run = function () { | |
var id = +this; | |
// eslint-disable-next-line no-prototype-builtins | |
if (queue.hasOwnProperty(id)) { | |
var fn = queue[id]; | |
delete queue[id]; | |
fn(); | |
} | |
}; | |
var listener = function (event) { | |
run.call(event.data); | |
}; | |
// Node.js 0.9+ & IE10+ has setImmediate, otherwise: | |
if (!setTask || !clearTask) { | |
setTask = function setImmediate(fn) { | |
var args = []; | |
var i = 1; | |
while (arguments.length > i) args.push(arguments[i++]); | |
queue[++counter] = function () { | |
// eslint-disable-next-line no-new-func | |
invoke(typeof fn == 'function' ? fn : Function(fn), args); | |
}; | |
defer(counter); | |
return counter; | |
}; | |
clearTask = function clearImmediate(id) { | |
delete queue[id]; | |
}; | |
// Node.js 0.8- | |
if (_dereq_(46)(process) == 'process') { | |
defer = function (id) { | |
process.nextTick(ctx(run, id, 1)); | |
}; | |
// Sphere (JS game engine) Dispatch API | |
} else if (Dispatch && Dispatch.now) { | |
defer = function (id) { | |
Dispatch.now(ctx(run, id, 1)); | |
}; | |
// Browsers with MessageChannel, includes WebWorkers | |
} else if (MessageChannel) { | |
channel = new MessageChannel(); | |
port = channel.port2; | |
channel.port1.onmessage = listener; | |
defer = ctx(port.postMessage, port, 1); | |
// Browsers with postMessage, skip WebWorkers | |
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object' | |
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { | |
defer = function (id) { | |
global.postMessage(id + '', '*'); | |
}; | |
global.addEventListener('message', listener, false); | |
// IE8- | |
} else if (ONREADYSTATECHANGE in cel('script')) { | |
defer = function (id) { | |
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { | |
html.removeChild(this); | |
run.call(id); | |
}; | |
}; | |
// Rest old browsers | |
} else { | |
defer = function (id) { | |
setTimeout(ctx(run, id, 1), 0); | |
}; | |
} | |
} | |
module.exports = { | |
set: setTask, | |
clear: clearTask | |
}; | |
},{"46":46,"52":52,"57":57,"68":68,"71":71,"74":74}],135:[function(_dereq_,module,exports){ | |
var toInteger = _dereq_(137); | |
var max = Math.max; | |
var min = Math.min; | |
module.exports = function (index, length) { | |
index = toInteger(index); | |
return index < 0 ? max(index + length, 0) : min(index, length); | |
}; | |
},{"137":137}],136:[function(_dereq_,module,exports){ | |
// https://tc39.github.io/ecma262/#sec-toindex | |
var toInteger = _dereq_(137); | |
var toLength = _dereq_(139); | |
module.exports = function (it) { | |
if (it === undefined) return 0; | |
var number = toInteger(it); | |
var length = toLength(number); | |
if (number !== length) throw RangeError('Wrong length!'); | |
return length; | |
}; | |
},{"137":137,"139":139}],137:[function(_dereq_,module,exports){ | |
// 7.1.4 ToInteger | |
var ceil = Math.ceil; | |
var floor = Math.floor; | |
module.exports = function (it) { | |
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); | |
}; | |
},{}],138:[function(_dereq_,module,exports){ | |
// to indexed object, toObject with fallback for non-array-like ES3 strings | |
var IObject = _dereq_(75); | |
var defined = _dereq_(55); | |
module.exports = function (it) { | |
return IObject(defined(it)); | |
}; | |
},{"55":55,"75":75}],139:[function(_dereq_,module,exports){ | |
// 7.1.15 ToLength | |
var toInteger = _dereq_(137); | |
var min = Math.min; | |
module.exports = function (it) { | |
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 | |
}; | |
},{"137":137}],140:[function(_dereq_,module,exports){ | |
// 7.1.13 ToObject(argument) | |
var defined = _dereq_(55); | |
module.exports = function (it) { | |
return Object(defined(it)); | |
}; | |
},{"55":55}],141:[function(_dereq_,module,exports){ | |
arguments[4][29][0].apply(exports,arguments) | |
},{"29":29,"79":79}],142:[function(_dereq_,module,exports){ | |
'use strict'; | |
if (_dereq_(56)) { | |
var LIBRARY = _dereq_(87); | |
var global = _dereq_(68); | |
var fails = _dereq_(62); | |
var $export = _dereq_(60); | |
var $typed = _dereq_(144); | |
var $buffer = _dereq_(143); | |
var ctx = _dereq_(52); | |
var anInstance = _dereq_(35); | |
var propertyDesc = _dereq_(114); | |
var hide = _dereq_(70); | |
var redefineAll = _dereq_(115); | |
var toInteger = _dereq_(137); | |
var toLength = _dereq_(139); | |
var toIndex = _dereq_(136); | |
var toAbsoluteIndex = _dereq_(135); | |
var toPrimitive = _dereq_(141); | |
var has = _dereq_(69); | |
var classof = _dereq_(45); | |
var isObject = _dereq_(79); | |
var toObject = _dereq_(140); | |
var isArrayIter = _dereq_(76); | |
var create = _dereq_(96); | |
var getPrototypeOf = _dereq_(103); | |
var gOPN = _dereq_(101).f; | |
var getIterFn = _dereq_(151); | |
var uid = _dereq_(145); | |
var wks = _dereq_(150); | |
var createArrayMethod = _dereq_(40); | |
var createArrayIncludes = _dereq_(39); | |
var speciesConstructor = _dereq_(125); | |
var ArrayIterators = _dereq_(162); | |
var Iterators = _dereq_(86); | |
var $iterDetect = _dereq_(84); | |
var setSpecies = _dereq_(121); | |
var arrayFill = _dereq_(38); | |
var arrayCopyWithin = _dereq_(37); | |
var $DP = _dereq_(97); | |
var $GOPD = _dereq_(99); | |
var dP = $DP.f; | |
var gOPD = $GOPD.f; | |
var RangeError = global.RangeError; | |
var TypeError = global.TypeError; | |
var Uint8Array = global.Uint8Array; | |
var ARRAY_BUFFER = 'ArrayBuffer'; | |
var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; | |
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; | |
var PROTOTYPE = 'prototype'; | |
var ArrayProto = Array[PROTOTYPE]; | |
var $ArrayBuffer = $buffer.ArrayBuffer; | |
var $DataView = $buffer.DataView; | |
var arrayForEach = createArrayMethod(0); | |
var arrayFilter = createArrayMethod(2); | |
var arraySome = createArrayMethod(3); | |
var arrayEvery = createArrayMethod(4); | |
var arrayFind = createArrayMethod(5); | |
var arrayFindIndex = createArrayMethod(6); | |
var arrayIncludes = createArrayIncludes(true); | |
var arrayIndexOf = createArrayIncludes(false); | |
var arrayValues = ArrayIterators.values; | |
var arrayKeys = ArrayIterators.keys; | |
var arrayEntries = ArrayIterators.entries; | |
var arrayLastIndexOf = ArrayProto.lastIndexOf; | |
var arrayReduce = ArrayProto.reduce; | |
var arrayReduceRight = ArrayProto.reduceRight; | |
var arrayJoin = ArrayProto.join; | |
var arraySort = ArrayProto.sort; | |
var arraySlice = ArrayProto.slice; | |
var arrayToString = ArrayProto.toString; | |
var arrayToLocaleString = ArrayProto.toLocaleString; | |
var ITERATOR = wks('iterator'); | |
var TAG = wks('toStringTag'); | |
var TYPED_CONSTRUCTOR = uid('typed_constructor'); | |
var DEF_CONSTRUCTOR = uid('def_constructor'); | |
var ALL_CONSTRUCTORS = $typed.CONSTR; | |
var TYPED_ARRAY = $typed.TYPED; | |
var VIEW = $typed.VIEW; | |
var WRONG_LENGTH = 'Wrong length!'; | |
var $map = createArrayMethod(1, function (O, length) { | |
return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); | |
}); | |
var LITTLE_ENDIAN = fails(function () { | |
// eslint-disable-next-line no-undef | |
return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; | |
}); | |
var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { | |
new Uint8Array(1).set({}); | |
}); | |
var toOffset = function (it, BYTES) { | |
var offset = toInteger(it); | |
if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); | |
return offset; | |
}; | |
var validate = function (it) { | |
if (isObject(it) && TYPED_ARRAY in it) return it; | |
throw TypeError(it + ' is not a typed array!'); | |
}; | |
var allocate = function (C, length) { | |
if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { | |
throw TypeError('It is not a typed array constructor!'); | |
} return new C(length); | |
}; | |
var speciesFromList = function (O, list) { | |
return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); | |
}; | |
var fromList = function (C, list) { | |
var index = 0; | |
var length = list.length; | |
var result = allocate(C, length); | |
while (length > index) result[index] = list[index++]; | |
return result; | |
}; | |
var addGetter = function (it, key, internal) { | |
dP(it, key, { get: function () { return this._d[internal]; } }); | |
}; | |
var $from = function from(source /* , mapfn, thisArg */) { | |
var O = toObject(source); | |
var aLen = arguments.length; | |
var mapfn = aLen > 1 ? arguments[1] : undefined; | |
var mapping = mapfn !== undefined; | |
var iterFn = getIterFn(O); | |
var i, length, values, result, step, iterator; | |
if (iterFn != undefined && !isArrayIter(iterFn)) { | |
for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { | |
values.push(step.value); | |
} O = values; | |
} | |
if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); | |
for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { | |
result[i] = mapping ? mapfn(O[i], i) : O[i]; | |
} | |
return result; | |
}; | |
var $of = function of(/* ...items */) { | |
var index = 0; | |
var length = arguments.length; | |
var result = allocate(this, length); | |
while (length > index) result[index] = arguments[index++]; | |
return result; | |
}; | |
// iOS Safari 6.x fails here | |
var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); | |
var $toLocaleString = function toLocaleString() { | |
return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); | |
}; | |
var proto = { | |
copyWithin: function copyWithin(target, start /* , end */) { | |
return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); | |
}, | |
every: function every(callbackfn /* , thisArg */) { | |
return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars | |
return arrayFill.apply(validate(this), arguments); | |
}, | |
filter: function filter(callbackfn /* , thisArg */) { | |
return speciesFromList(this, arrayFilter(validate(this), callbackfn, | |
arguments.length > 1 ? arguments[1] : undefined)); | |
}, | |
find: function find(predicate /* , thisArg */) { | |
return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
findIndex: function findIndex(predicate /* , thisArg */) { | |
return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
forEach: function forEach(callbackfn /* , thisArg */) { | |
arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
indexOf: function indexOf(searchElement /* , fromIndex */) { | |
return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
includes: function includes(searchElement /* , fromIndex */) { | |
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
join: function join(separator) { // eslint-disable-line no-unused-vars | |
return arrayJoin.apply(validate(this), arguments); | |
}, | |
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars | |
return arrayLastIndexOf.apply(validate(this), arguments); | |
}, | |
map: function map(mapfn /* , thisArg */) { | |
return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars | |
return arrayReduce.apply(validate(this), arguments); | |
}, | |
reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars | |
return arrayReduceRight.apply(validate(this), arguments); | |
}, | |
reverse: function reverse() { | |
var that = this; | |
var length = validate(that).length; | |
var middle = Math.floor(length / 2); | |
var index = 0; | |
var value; | |
while (index < middle) { | |
value = that[index]; | |
that[index++] = that[--length]; | |
that[length] = value; | |
} return that; | |
}, | |
some: function some(callbackfn /* , thisArg */) { | |
return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); | |
}, | |
sort: function sort(comparefn) { | |
return arraySort.call(validate(this), comparefn); | |
}, | |
subarray: function subarray(begin, end) { | |
var O = validate(this); | |
var length = O.length; | |
var $begin = toAbsoluteIndex(begin, length); | |
return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( | |
O.buffer, | |
O.byteOffset + $begin * O.BYTES_PER_ELEMENT, | |
toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) | |
); | |
} | |
}; | |
var $slice = function slice(start, end) { | |
return speciesFromList(this, arraySlice.call(validate(this), start, end)); | |
}; | |
var $set = function set(arrayLike /* , offset */) { | |
validate(this); | |
var offset = toOffset(arguments[1], 1); | |
var length = this.length; | |
var src = toObject(arrayLike); | |
var len = toLength(src.length); | |
var index = 0; | |
if (len + offset > length) throw RangeError(WRONG_LENGTH); | |
while (index < len) this[offset + index] = src[index++]; | |
}; | |
var $iterators = { | |
entries: function entries() { | |
return arrayEntries.call(validate(this)); | |
}, | |
keys: function keys() { | |
return arrayKeys.call(validate(this)); | |
}, | |
values: function values() { | |
return arrayValues.call(validate(this)); | |
} | |
}; | |
var isTAIndex = function (target, key) { | |
return isObject(target) | |
&& target[TYPED_ARRAY] | |
&& typeof key != 'symbol' | |
&& key in target | |
&& String(+key) == String(key); | |
}; | |
var $getDesc = function getOwnPropertyDescriptor(target, key) { | |
return isTAIndex(target, key = toPrimitive(key, true)) | |
? propertyDesc(2, target[key]) | |
: gOPD(target, key); | |
}; | |
var $setDesc = function defineProperty(target, key, desc) { | |
if (isTAIndex(target, key = toPrimitive(key, true)) | |
&& isObject(desc) | |
&& has(desc, 'value') | |
&& !has(desc, 'get') | |
&& !has(desc, 'set') | |
// TODO: add validation descriptor w/o calling accessors | |
&& !desc.configurable | |
&& (!has(desc, 'writable') || desc.writable) | |
&& (!has(desc, 'enumerable') || desc.enumerable) | |
) { | |
target[key] = desc.value; | |
return target; | |
} return dP(target, key, desc); | |
}; | |
if (!ALL_CONSTRUCTORS) { | |
$GOPD.f = $getDesc; | |
$DP.f = $setDesc; | |
} | |
$export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { | |
getOwnPropertyDescriptor: $getDesc, | |
defineProperty: $setDesc | |
}); | |
if (fails(function () { arrayToString.call({}); })) { | |
arrayToString = arrayToLocaleString = function toString() { | |
return arrayJoin.call(this); | |
}; | |
} | |
var $TypedArrayPrototype$ = redefineAll({}, proto); | |
redefineAll($TypedArrayPrototype$, $iterators); | |
hide($TypedArrayPrototype$, ITERATOR, $iterators.values); | |
redefineAll($TypedArrayPrototype$, { | |
slice: $slice, | |
set: $set, | |
constructor: function () { /* noop */ }, | |
toString: arrayToString, | |
toLocaleString: $toLocaleString | |
}); | |
addGetter($TypedArrayPrototype$, 'buffer', 'b'); | |
addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); | |
addGetter($TypedArrayPrototype$, 'byteLength', 'l'); | |
addGetter($TypedArrayPrototype$, 'length', 'e'); | |
dP($TypedArrayPrototype$, TAG, { | |
get: function () { return this[TYPED_ARRAY]; } | |
}); | |
// eslint-disable-next-line max-statements | |
module.exports = function (KEY, BYTES, wrapper, CLAMPED) { | |
CLAMPED = !!CLAMPED; | |
var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; | |
var GETTER = 'get' + KEY; | |
var SETTER = 'set' + KEY; | |
var TypedArray = global[NAME]; | |
var Base = TypedArray || {}; | |
var TAC = TypedArray && getPrototypeOf(TypedArray); | |
var FORCED = !TypedArray || !$typed.ABV; | |
var O = {}; | |
var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; | |
var getter = function (that, index) { | |
var data = that._d; | |
return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); | |
}; | |
var setter = function (that, index, value) { | |
var data = that._d; | |
if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; | |
data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); | |
}; | |
var addElement = function (that, index) { | |
dP(that, index, { | |
get: function () { | |
return getter(this, index); | |
}, | |
set: function (value) { | |
return setter(this, index, value); | |
}, | |
enumerable: true | |
}); | |
}; | |
if (FORCED) { | |
TypedArray = wrapper(function (that, data, $offset, $length) { | |
anInstance(that, TypedArray, NAME, '_d'); | |
var index = 0; | |
var offset = 0; | |
var buffer, byteLength, length, klass; | |
if (!isObject(data)) { | |
length = toIndex(data); | |
byteLength = length * BYTES; | |
buffer = new $ArrayBuffer(byteLength); | |
} else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { | |
buffer = data; | |
offset = toOffset($offset, BYTES); | |
var $len = data.byteLength; | |
if ($length === undefined) { | |
if ($len % BYTES) throw RangeError(WRONG_LENGTH); | |
byteLength = $len - offset; | |
if (byteLength < 0) throw RangeError(WRONG_LENGTH); | |
} else { | |
byteLength = toLength($length) * BYTES; | |
if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); | |
} | |
length = byteLength / BYTES; | |
} else if (TYPED_ARRAY in data) { | |
return fromList(TypedArray, data); | |
} else { | |
return $from.call(TypedArray, data); | |
} | |
hide(that, '_d', { | |
b: buffer, | |
o: offset, | |
l: byteLength, | |
e: length, | |
v: new $DataView(buffer) | |
}); | |
while (index < length) addElement(that, index++); | |
}); | |
TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); | |
hide(TypedArrayPrototype, 'constructor', TypedArray); | |
} else if (!fails(function () { | |
TypedArray(1); | |
}) || !fails(function () { | |
new TypedArray(-1); // eslint-disable-line no-new | |
}) || !$iterDetect(function (iter) { | |
new TypedArray(); // eslint-disable-line no-new | |
new TypedArray(null); // eslint-disable-line no-new | |
new TypedArray(1.5); // eslint-disable-line no-new | |
new TypedArray(iter); // eslint-disable-line no-new | |
}, true)) { | |
TypedArray = wrapper(function (that, data, $offset, $length) { | |
anInstance(that, TypedArray, NAME); | |
var klass; | |
// `ws` module bug, temporarily remove validation length for Uint8Array | |
// https://github.com/websockets/ws/pull/645 | |
if (!isObject(data)) return new Base(toIndex(data)); | |
if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { | |
return $length !== undefined | |
? new Base(data, toOffset($offset, BYTES), $length) | |
: $offset !== undefined | |
? new Base(data, toOffset($offset, BYTES)) | |
: new Base(data); | |
} | |
if (TYPED_ARRAY in data) return fromList(TypedArray, data); | |
return $from.call(TypedArray, data); | |
}); | |
arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { | |
if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); | |
}); | |
TypedArray[PROTOTYPE] = TypedArrayPrototype; | |
if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; | |
} | |
var $nativeIterator = TypedArrayPrototype[ITERATOR]; | |
var CORRECT_ITER_NAME = !!$nativeIterator | |
&& ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); | |
var $iterator = $iterators.values; | |
hide(TypedArray, TYPED_CONSTRUCTOR, true); | |
hide(TypedArrayPrototype, TYPED_ARRAY, NAME); | |
hide(TypedArrayPrototype, VIEW, true); | |
hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); | |
if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { | |
dP(TypedArrayPrototype, TAG, { | |
get: function () { return NAME; } | |
}); | |
} | |
O[NAME] = TypedArray; | |
$export($export.G + $export.W + $export.F * (TypedArray != Base), O); | |
$export($export.S, NAME, { | |
BYTES_PER_ELEMENT: BYTES | |
}); | |
$export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { | |
from: $from, | |
of: $of | |
}); | |
if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); | |
$export($export.P, NAME, proto); | |
setSpecies(NAME); | |
$export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); | |
$export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); | |
if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; | |
$export($export.P + $export.F * fails(function () { | |
new TypedArray(1).slice(); | |
}), NAME, { slice: $slice }); | |
$export($export.P + $export.F * (fails(function () { | |
return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); | |
}) || !fails(function () { | |
TypedArrayPrototype.toLocaleString.call([1, 2]); | |
})), NAME, { toLocaleString: $toLocaleString }); | |
Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; | |
if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); | |
}; | |
} else module.exports = function () { /* empty */ }; | |
},{"101":101,"103":103,"114":114,"115":115,"121":121,"125":125,"135":135,"136":136,"137":137,"139":139,"140":140,"141":141,"143":143,"144":144,"145":145,"150":150,"151":151,"162":162,"35":35,"37":37,"38":38,"39":39,"40":40,"45":45,"52":52,"56":56,"60":60,"62":62,"68":68,"69":69,"70":70,"76":76,"79":79,"84":84,"86":86,"87":87,"96":96,"97":97,"99":99}],143:[function(_dereq_,module,exports){ | |
'use strict'; | |
var global = _dereq_(68); | |
var DESCRIPTORS = _dereq_(56); | |
var LIBRARY = _dereq_(87); | |
var $typed = _dereq_(144); | |
var hide = _dereq_(70); | |
var redefineAll = _dereq_(115); | |
var fails = _dereq_(62); | |
var anInstance = _dereq_(35); | |
var toInteger = _dereq_(137); | |
var toLength = _dereq_(139); | |
var toIndex = _dereq_(136); | |
var gOPN = _dereq_(101).f; | |
var dP = _dereq_(97).f; | |
var arrayFill = _dereq_(38); | |
var setToStringTag = _dereq_(122); | |
var ARRAY_BUFFER = 'ArrayBuffer'; | |
var DATA_VIEW = 'DataView'; | |
var PROTOTYPE = 'prototype'; | |
var WRONG_LENGTH = 'Wrong length!'; | |
var WRONG_INDEX = 'Wrong index!'; | |
var $ArrayBuffer = global[ARRAY_BUFFER]; | |
var $DataView = global[DATA_VIEW]; | |
var Math = global.Math; | |
var RangeError = global.RangeError; | |
// eslint-disable-next-line no-shadow-restricted-names | |
var Infinity = global.Infinity; | |
var BaseBuffer = $ArrayBuffer; | |
var abs = Math.abs; | |
var pow = Math.pow; | |
var floor = Math.floor; | |
var log = Math.log; | |
var LN2 = Math.LN2; | |
var BUFFER = 'buffer'; | |
var BYTE_LENGTH = 'byteLength'; | |
var BYTE_OFFSET = 'byteOffset'; | |
var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; | |
var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; | |
var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; | |
// IEEE754 conversions based on https://github.com/feross/ieee754 | |
function packIEEE754(value, mLen, nBytes) { | |
var buffer = new Array(nBytes); | |
var eLen = nBytes * 8 - mLen - 1; | |
var eMax = (1 << eLen) - 1; | |
var eBias = eMax >> 1; | |
var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; | |
var i = 0; | |
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; | |
var e, m, c; | |
value = abs(value); | |
// eslint-disable-next-line no-self-compare | |
if (value != value || value === Infinity) { | |
// eslint-disable-next-line no-self-compare | |
m = value != value ? 1 : 0; | |
e = eMax; | |
} else { | |
e = floor(log(value) / LN2); | |
if (value * (c = pow(2, -e)) < 1) { | |
e--; | |
c *= 2; | |
} | |
if (e + eBias >= 1) { | |
value += rt / c; | |
} else { | |
value += rt * pow(2, 1 - eBias); | |
} | |
if (value * c >= 2) { | |
e++; | |
c /= 2; | |
} | |
if (e + eBias >= eMax) { | |
m = 0; | |
e = eMax; | |
} else if (e + eBias >= 1) { | |
m = (value * c - 1) * pow(2, mLen); | |
e = e + eBias; | |
} else { | |
m = value * pow(2, eBias - 1) * pow(2, mLen); | |
e = 0; | |
} | |
} | |
for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); | |
e = e << mLen | m; | |
eLen += mLen; | |
for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); | |
buffer[--i] |= s * 128; | |
return buffer; | |
} | |
function unpackIEEE754(buffer, mLen, nBytes) { | |
var eLen = nBytes * 8 - mLen - 1; | |
var eMax = (1 << eLen) - 1; | |
var eBias = eMax >> 1; | |
var nBits = eLen - 7; | |
var i = nBytes - 1; | |
var s = buffer[i--]; | |
var e = s & 127; | |
var m; | |
s >>= 7; | |
for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); | |
m = e & (1 << -nBits) - 1; | |
e >>= -nBits; | |
nBits += mLen; | |
for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); | |
if (e === 0) { | |
e = 1 - eBias; | |
} else if (e === eMax) { | |
return m ? NaN : s ? -Infinity : Infinity; | |
} else { | |
m = m + pow(2, mLen); | |
e = e - eBias; | |
} return (s ? -1 : 1) * m * pow(2, e - mLen); | |
} | |
function unpackI32(bytes) { | |
return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; | |
} | |
function packI8(it) { | |
return [it & 0xff]; | |
} | |
function packI16(it) { | |
return [it & 0xff, it >> 8 & 0xff]; | |
} | |
function packI32(it) { | |
return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; | |
} | |
function packF64(it) { | |
return packIEEE754(it, 52, 8); | |
} | |
function packF32(it) { | |
return packIEEE754(it, 23, 4); | |
} | |
function addGetter(C, key, internal) { | |
dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); | |
} | |
function get(view, bytes, index, isLittleEndian) { | |
var numIndex = +index; | |
var intIndex = toIndex(numIndex); | |
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); | |
var store = view[$BUFFER]._b; | |
var start = intIndex + view[$OFFSET]; | |
var pack = store.slice(start, start + bytes); | |
return isLittleEndian ? pack : pack.reverse(); | |
} | |
function set(view, bytes, index, conversion, value, isLittleEndian) { | |
var numIndex = +index; | |
var intIndex = toIndex(numIndex); | |
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); | |
var store = view[$BUFFER]._b; | |
var start = intIndex + view[$OFFSET]; | |
var pack = conversion(+value); | |
for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; | |
} | |
if (!$typed.ABV) { | |
$ArrayBuffer = function ArrayBuffer(length) { | |
anInstance(this, $ArrayBuffer, ARRAY_BUFFER); | |
var byteLength = toIndex(length); | |
this._b = arrayFill.call(new Array(byteLength), 0); | |
this[$LENGTH] = byteLength; | |
}; | |
$DataView = function DataView(buffer, byteOffset, byteLength) { | |
anInstance(this, $DataView, DATA_VIEW); | |
anInstance(buffer, $ArrayBuffer, DATA_VIEW); | |
var bufferLength = buffer[$LENGTH]; | |
var offset = toInteger(byteOffset); | |
if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); | |
byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); | |
if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); | |
this[$BUFFER] = buffer; | |
this[$OFFSET] = offset; | |
this[$LENGTH] = byteLength; | |
}; | |
if (DESCRIPTORS) { | |
addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); | |
addGetter($DataView, BUFFER, '_b'); | |
addGetter($DataView, BYTE_LENGTH, '_l'); | |
addGetter($DataView, BYTE_OFFSET, '_o'); | |
} | |
redefineAll($DataView[PROTOTYPE], { | |
getInt8: function getInt8(byteOffset) { | |
return get(this, 1, byteOffset)[0] << 24 >> 24; | |
}, | |
getUint8: function getUint8(byteOffset) { | |
return get(this, 1, byteOffset)[0]; | |
}, | |
getInt16: function getInt16(byteOffset /* , littleEndian */) { | |
var bytes = get(this, 2, byteOffset, arguments[1]); | |
return (bytes[1] << 8 | bytes[0]) << 16 >> 16; | |
}, | |
getUint16: function getUint16(byteOffset /* , littleEndian */) { | |
var bytes = get(this, 2, byteOffset, arguments[1]); | |
return bytes[1] << 8 | bytes[0]; | |
}, | |
getInt32: function getInt32(byteOffset /* , littleEndian */) { | |
return unpackI32(get(this, 4, byteOffset, arguments[1])); | |
}, | |
getUint32: function getUint32(byteOffset /* , littleEndian */) { | |
return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; | |
}, | |
getFloat32: function getFloat32(byteOffset /* , littleEndian */) { | |
return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); | |
}, | |
getFloat64: function getFloat64(byteOffset /* , littleEndian */) { | |
return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); | |
}, | |
setInt8: function setInt8(byteOffset, value) { | |
set(this, 1, byteOffset, packI8, value); | |
}, | |
setUint8: function setUint8(byteOffset, value) { | |
set(this, 1, byteOffset, packI8, value); | |
}, | |
setInt16: function setInt16(byteOffset, value /* , littleEndian */) { | |
set(this, 2, byteOffset, packI16, value, arguments[2]); | |
}, | |
setUint16: function setUint16(byteOffset, value /* , littleEndian */) { | |
set(this, 2, byteOffset, packI16, value, arguments[2]); | |
}, | |
setInt32: function setInt32(byteOffset, value /* , littleEndian */) { | |
set(this, 4, byteOffset, packI32, value, arguments[2]); | |
}, | |
setUint32: function setUint32(byteOffset, value /* , littleEndian */) { | |
set(this, 4, byteOffset, packI32, value, arguments[2]); | |
}, | |
setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { | |
set(this, 4, byteOffset, packF32, value, arguments[2]); | |
}, | |
setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { | |
set(this, 8, byteOffset, packF64, value, arguments[2]); | |
} | |
}); | |
} else { | |
if (!fails(function () { | |
$ArrayBuffer(1); | |
}) || !fails(function () { | |
new $ArrayBuffer(-1); // eslint-disable-line no-new | |
}) || fails(function () { | |
new $ArrayBuffer(); // eslint-disable-line no-new | |
new $ArrayBuffer(1.5); // eslint-disable-line no-new | |
new $ArrayBuffer(NaN); // eslint-disable-line no-new | |
return $ArrayBuffer.name != ARRAY_BUFFER; | |
})) { | |
$ArrayBuffer = function ArrayBuffer(length) { | |
anInstance(this, $ArrayBuffer); | |
return new BaseBuffer(toIndex(length)); | |
}; | |
var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; | |
for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { | |
if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); | |
} | |
if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; | |
} | |
// iOS Safari 7.x bug | |
var view = new $DataView(new $ArrayBuffer(2)); | |
var $setInt8 = $DataView[PROTOTYPE].setInt8; | |
view.setInt8(0, 2147483648); | |
view.setInt8(1, 2147483649); | |
if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { | |
setInt8: function setInt8(byteOffset, value) { | |
$setInt8.call(this, byteOffset, value << 24 >> 24); | |
}, | |
setUint8: function setUint8(byteOffset, value) { | |
$setInt8.call(this, byteOffset, value << 24 >> 24); | |
} | |
}, true); | |
} | |
setToStringTag($ArrayBuffer, ARRAY_BUFFER); | |
setToStringTag($DataView, DATA_VIEW); | |
hide($DataView[PROTOTYPE], $typed.VIEW, true); | |
exports[ARRAY_BUFFER] = $ArrayBuffer; | |
exports[DATA_VIEW] = $DataView; | |
},{"101":101,"115":115,"122":122,"136":136,"137":137,"139":139,"144":144,"35":35,"38":38,"56":56,"62":62,"68":68,"70":70,"87":87,"97":97}],144:[function(_dereq_,module,exports){ | |
var global = _dereq_(68); | |
var hide = _dereq_(70); | |
var uid = _dereq_(145); | |
var TYPED = uid('typed_array'); | |
var VIEW = uid('view'); | |
var ABV = !!(global.ArrayBuffer && global.DataView); | |
var CONSTR = ABV; | |
var i = 0; | |
var l = 9; | |
var Typed; | |
var TypedArrayConstructors = ( | |
'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' | |
).split(','); | |
while (i < l) { | |
if (Typed = global[TypedArrayConstructors[i++]]) { | |
hide(Typed.prototype, TYPED, true); | |
hide(Typed.prototype, VIEW, true); | |
} else CONSTR = false; | |
} | |
module.exports = { | |
ABV: ABV, | |
CONSTR: CONSTR, | |
TYPED: TYPED, | |
VIEW: VIEW | |
}; | |
},{"145":145,"68":68,"70":70}],145:[function(_dereq_,module,exports){ | |
var id = 0; | |
var px = Math.random(); | |
module.exports = function (key) { | |
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); | |
}; | |
},{}],146:[function(_dereq_,module,exports){ | |
var global = _dereq_(68); | |
var navigator = global.navigator; | |
module.exports = navigator && navigator.userAgent || ''; | |
},{"68":68}],147:[function(_dereq_,module,exports){ | |
var isObject = _dereq_(79); | |
module.exports = function (it, TYPE) { | |
if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); | |
return it; | |
}; | |
},{"79":79}],148:[function(_dereq_,module,exports){ | |
var global = _dereq_(68); | |
var core = _dereq_(50); | |
var LIBRARY = _dereq_(87); | |
var wksExt = _dereq_(149); | |
var defineProperty = _dereq_(97).f; | |
module.exports = function (name) { | |
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); | |
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); | |
}; | |
},{"149":149,"50":50,"68":68,"87":87,"97":97}],149:[function(_dereq_,module,exports){ | |
exports.f = _dereq_(150); | |
},{"150":150}],150:[function(_dereq_,module,exports){ | |
var store = _dereq_(124)('wks'); | |
var uid = _dereq_(145); | |
var Symbol = _dereq_(68).Symbol; | |
var USE_SYMBOL = typeof Symbol == 'function'; | |
var $exports = module.exports = function (name) { | |
return store[name] || (store[name] = | |
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); | |
}; | |
$exports.store = store; | |
},{"124":124,"145":145,"68":68}],151:[function(_dereq_,module,exports){ | |
var classof = _dereq_(45); | |
var ITERATOR = _dereq_(150)('iterator'); | |
var Iterators = _dereq_(86); | |
module.exports = _dereq_(50).getIteratorMethod = function (it) { | |
if (it != undefined) return it[ITERATOR] | |
|| it['@@iterator'] | |
|| Iterators[classof(it)]; | |
}; | |
},{"150":150,"45":45,"50":50,"86":86}],152:[function(_dereq_,module,exports){ | |
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) | |
var $export = _dereq_(60); | |
$export($export.P, 'Array', { copyWithin: _dereq_(37) }); | |
_dereq_(33)('copyWithin'); | |
},{"33":33,"37":37,"60":60}],153:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $every = _dereq_(40)(4); | |
$export($export.P + $export.F * !_dereq_(126)([].every, true), 'Array', { | |
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) | |
every: function every(callbackfn /* , thisArg */) { | |
return $every(this, callbackfn, arguments[1]); | |
} | |
}); | |
},{"126":126,"40":40,"60":60}],154:[function(_dereq_,module,exports){ | |
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) | |
var $export = _dereq_(60); | |
$export($export.P, 'Array', { fill: _dereq_(38) }); | |
_dereq_(33)('fill'); | |
},{"33":33,"38":38,"60":60}],155:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $filter = _dereq_(40)(2); | |
$export($export.P + $export.F * !_dereq_(126)([].filter, true), 'Array', { | |
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) | |
filter: function filter(callbackfn /* , thisArg */) { | |
return $filter(this, callbackfn, arguments[1]); | |
} | |
}); | |
},{"126":126,"40":40,"60":60}],156:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) | |
var $export = _dereq_(60); | |
var $find = _dereq_(40)(6); | |
var KEY = 'findIndex'; | |
var forced = true; | |
// Shouldn't skip holes | |
if (KEY in []) Array(1)[KEY](function () { forced = false; }); | |
$export($export.P + $export.F * forced, 'Array', { | |
findIndex: function findIndex(callbackfn /* , that = undefined */) { | |
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | |
} | |
}); | |
_dereq_(33)(KEY); | |
},{"33":33,"40":40,"60":60}],157:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) | |
var $export = _dereq_(60); | |
var $find = _dereq_(40)(5); | |
var KEY = 'find'; | |
var forced = true; | |
// Shouldn't skip holes | |
if (KEY in []) Array(1)[KEY](function () { forced = false; }); | |
$export($export.P + $export.F * forced, 'Array', { | |
find: function find(callbackfn /* , that = undefined */) { | |
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | |
} | |
}); | |
_dereq_(33)(KEY); | |
},{"33":33,"40":40,"60":60}],158:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $forEach = _dereq_(40)(0); | |
var STRICT = _dereq_(126)([].forEach, true); | |
$export($export.P + $export.F * !STRICT, 'Array', { | |
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) | |
forEach: function forEach(callbackfn /* , thisArg */) { | |
return $forEach(this, callbackfn, arguments[1]); | |
} | |
}); | |
},{"126":126,"40":40,"60":60}],159:[function(_dereq_,module,exports){ | |
'use strict'; | |
var ctx = _dereq_(52); | |
var $export = _dereq_(60); | |
var toObject = _dereq_(140); | |
var call = _dereq_(81); | |
var isArrayIter = _dereq_(76); | |
var toLength = _dereq_(139); | |
var createProperty = _dereq_(51); | |
var getIterFn = _dereq_(151); | |
$export($export.S + $export.F * !_dereq_(84)(function (iter) { Array.from(iter); }), 'Array', { | |
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) | |
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { | |
var O = toObject(arrayLike); | |
var C = typeof this == 'function' ? this : Array; | |
var aLen = arguments.length; | |
var mapfn = aLen > 1 ? arguments[1] : undefined; | |
var mapping = mapfn !== undefined; | |
var index = 0; | |
var iterFn = getIterFn(O); | |
var length, result, step, iterator; | |
if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); | |
// if object isn't iterable or it's array with default iterator - use simple case | |
if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { | |
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { | |
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); | |
} | |
} else { | |
length = toLength(O.length); | |
for (result = new C(length); length > index; index++) { | |
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); | |
} | |
} | |
result.length = index; | |
return result; | |
} | |
}); | |
},{"139":139,"140":140,"151":151,"51":51,"52":52,"60":60,"76":76,"81":81,"84":84}],160:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $indexOf = _dereq_(39)(false); | |
var $native = [].indexOf; | |
var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; | |
$export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(126)($native)), 'Array', { | |
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) | |
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { | |
return NEGATIVE_ZERO | |
// convert -0 to +0 | |
? $native.apply(this, arguments) || 0 | |
: $indexOf(this, searchElement, arguments[1]); | |
} | |
}); | |
},{"126":126,"39":39,"60":60}],161:[function(_dereq_,module,exports){ | |
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) | |
var $export = _dereq_(60); | |
$export($export.S, 'Array', { isArray: _dereq_(77) }); | |
},{"60":60,"77":77}],162:[function(_dereq_,module,exports){ | |
'use strict'; | |
var addToUnscopables = _dereq_(33); | |
var step = _dereq_(85); | |
var Iterators = _dereq_(86); | |
var toIObject = _dereq_(138); | |
// 22.1.3.4 Array.prototype.entries() | |
// 22.1.3.13 Array.prototype.keys() | |
// 22.1.3.29 Array.prototype.values() | |
// 22.1.3.30 Array.prototype[@@iterator]() | |
module.exports = _dereq_(83)(Array, 'Array', function (iterated, kind) { | |
this._t = toIObject(iterated); // target | |
this._i = 0; // next index | |
this._k = kind; // kind | |
// 22.1.5.2.1 %ArrayIteratorPrototype%.next() | |
}, function () { | |
var O = this._t; | |
var kind = this._k; | |
var index = this._i++; | |
if (!O || index >= O.length) { | |
this._t = undefined; | |
return step(1); | |
} | |
if (kind == 'keys') return step(0, index); | |
if (kind == 'values') return step(0, O[index]); | |
return step(0, [index, O[index]]); | |
}, 'values'); | |
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) | |
Iterators.Arguments = Iterators.Array; | |
addToUnscopables('keys'); | |
addToUnscopables('values'); | |
addToUnscopables('entries'); | |
},{"138":138,"33":33,"83":83,"85":85,"86":86}],163:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 22.1.3.13 Array.prototype.join(separator) | |
var $export = _dereq_(60); | |
var toIObject = _dereq_(138); | |
var arrayJoin = [].join; | |
// fallback for not array-like strings | |
$export($export.P + $export.F * (_dereq_(75) != Object || !_dereq_(126)(arrayJoin)), 'Array', { | |
join: function join(separator) { | |
return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); | |
} | |
}); | |
},{"126":126,"138":138,"60":60,"75":75}],164:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var toIObject = _dereq_(138); | |
var toInteger = _dereq_(137); | |
var toLength = _dereq_(139); | |
var $native = [].lastIndexOf; | |
var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; | |
$export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(126)($native)), 'Array', { | |
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) | |
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { | |
// convert -0 to +0 | |
if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; | |
var O = toIObject(this); | |
var length = toLength(O.length); | |
var index = length - 1; | |
if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); | |
if (index < 0) index = length + index; | |
for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; | |
return -1; | |
} | |
}); | |
},{"126":126,"137":137,"138":138,"139":139,"60":60}],165:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $map = _dereq_(40)(1); | |
$export($export.P + $export.F * !_dereq_(126)([].map, true), 'Array', { | |
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) | |
map: function map(callbackfn /* , thisArg */) { | |
return $map(this, callbackfn, arguments[1]); | |
} | |
}); | |
},{"126":126,"40":40,"60":60}],166:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var createProperty = _dereq_(51); | |
// WebKit Array.of isn't generic | |
$export($export.S + $export.F * _dereq_(62)(function () { | |
function F() { /* empty */ } | |
return !(Array.of.call(F) instanceof F); | |
}), 'Array', { | |
// 22.1.2.3 Array.of( ...items) | |
of: function of(/* ...args */) { | |
var index = 0; | |
var aLen = arguments.length; | |
var result = new (typeof this == 'function' ? this : Array)(aLen); | |
while (aLen > index) createProperty(result, index, arguments[index++]); | |
result.length = aLen; | |
return result; | |
} | |
}); | |
},{"51":51,"60":60,"62":62}],167:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $reduce = _dereq_(41); | |
$export($export.P + $export.F * !_dereq_(126)([].reduceRight, true), 'Array', { | |
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) | |
reduceRight: function reduceRight(callbackfn /* , initialValue */) { | |
return $reduce(this, callbackfn, arguments.length, arguments[1], true); | |
} | |
}); | |
},{"126":126,"41":41,"60":60}],168:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $reduce = _dereq_(41); | |
$export($export.P + $export.F * !_dereq_(126)([].reduce, true), 'Array', { | |
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) | |
reduce: function reduce(callbackfn /* , initialValue */) { | |
return $reduce(this, callbackfn, arguments.length, arguments[1], false); | |
} | |
}); | |
},{"126":126,"41":41,"60":60}],169:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var html = _dereq_(71); | |
var cof = _dereq_(46); | |
var toAbsoluteIndex = _dereq_(135); | |
var toLength = _dereq_(139); | |
var arraySlice = [].slice; | |
// fallback for not array-like ES3 strings and DOM objects | |
$export($export.P + $export.F * _dereq_(62)(function () { | |
if (html) arraySlice.call(html); | |
}), 'Array', { | |
slice: function slice(begin, end) { | |
var len = toLength(this.length); | |
var klass = cof(this); | |
end = end === undefined ? len : end; | |
if (klass == 'Array') return arraySlice.call(this, begin, end); | |
var start = toAbsoluteIndex(begin, len); | |
var upTo = toAbsoluteIndex(end, len); | |
var size = toLength(upTo - start); | |
var cloned = new Array(size); | |
var i = 0; | |
for (; i < size; i++) cloned[i] = klass == 'String' | |
? this.charAt(start + i) | |
: this[start + i]; | |
return cloned; | |
} | |
}); | |
},{"135":135,"139":139,"46":46,"60":60,"62":62,"71":71}],170:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $some = _dereq_(40)(3); | |
$export($export.P + $export.F * !_dereq_(126)([].some, true), 'Array', { | |
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) | |
some: function some(callbackfn /* , thisArg */) { | |
return $some(this, callbackfn, arguments[1]); | |
} | |
}); | |
},{"126":126,"40":40,"60":60}],171:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var aFunction = _dereq_(31); | |
var toObject = _dereq_(140); | |
var fails = _dereq_(62); | |
var $sort = [].sort; | |
var test = [1, 2, 3]; | |
$export($export.P + $export.F * (fails(function () { | |
// IE8- | |
test.sort(undefined); | |
}) || !fails(function () { | |
// V8 bug | |
test.sort(null); | |
// Old WebKit | |
}) || !_dereq_(126)($sort)), 'Array', { | |
// 22.1.3.25 Array.prototype.sort(comparefn) | |
sort: function sort(comparefn) { | |
return comparefn === undefined | |
? $sort.call(toObject(this)) | |
: $sort.call(toObject(this), aFunction(comparefn)); | |
} | |
}); | |
},{"126":126,"140":140,"31":31,"60":60,"62":62}],172:[function(_dereq_,module,exports){ | |
_dereq_(121)('Array'); | |
},{"121":121}],173:[function(_dereq_,module,exports){ | |
// 20.3.3.1 / 15.9.4.4 Date.now() | |
var $export = _dereq_(60); | |
$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); | |
},{"60":60}],174:[function(_dereq_,module,exports){ | |
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() | |
var $export = _dereq_(60); | |
var toISOString = _dereq_(53); | |
// PhantomJS / old WebKit has a broken implementations | |
$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { | |
toISOString: toISOString | |
}); | |
},{"53":53,"60":60}],175:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var toObject = _dereq_(140); | |
var toPrimitive = _dereq_(141); | |
$export($export.P + $export.F * _dereq_(62)(function () { | |
return new Date(NaN).toJSON() !== null | |
|| Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; | |
}), 'Date', { | |
// eslint-disable-next-line no-unused-vars | |
toJSON: function toJSON(key) { | |
var O = toObject(this); | |
var pv = toPrimitive(O); | |
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); | |
} | |
}); | |
},{"140":140,"141":141,"60":60,"62":62}],176:[function(_dereq_,module,exports){ | |
var TO_PRIMITIVE = _dereq_(150)('toPrimitive'); | |
var proto = Date.prototype; | |
if (!(TO_PRIMITIVE in proto)) _dereq_(70)(proto, TO_PRIMITIVE, _dereq_(54)); | |
},{"150":150,"54":54,"70":70}],177:[function(_dereq_,module,exports){ | |
var DateProto = Date.prototype; | |
var INVALID_DATE = 'Invalid Date'; | |
var TO_STRING = 'toString'; | |
var $toString = DateProto[TO_STRING]; | |
var getTime = DateProto.getTime; | |
if (new Date(NaN) + '' != INVALID_DATE) { | |
_dereq_(116)(DateProto, TO_STRING, function toString() { | |
var value = getTime.call(this); | |
// eslint-disable-next-line no-self-compare | |
return value === value ? $toString.call(this) : INVALID_DATE; | |
}); | |
} | |
},{"116":116}],178:[function(_dereq_,module,exports){ | |
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) | |
var $export = _dereq_(60); | |
$export($export.P, 'Function', { bind: _dereq_(44) }); | |
},{"44":44,"60":60}],179:[function(_dereq_,module,exports){ | |
'use strict'; | |
var isObject = _dereq_(79); | |
var getPrototypeOf = _dereq_(103); | |
var HAS_INSTANCE = _dereq_(150)('hasInstance'); | |
var FunctionProto = Function.prototype; | |
// 19.2.3.6 Function.prototype[@@hasInstance](V) | |
if (!(HAS_INSTANCE in FunctionProto)) _dereq_(97).f(FunctionProto, HAS_INSTANCE, { value: function (O) { | |
if (typeof this != 'function' || !isObject(O)) return false; | |
if (!isObject(this.prototype)) return O instanceof this; | |
// for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: | |
while (O = getPrototypeOf(O)) if (this.prototype === O) return true; | |
return false; | |
} }); | |
},{"103":103,"150":150,"79":79,"97":97}],180:[function(_dereq_,module,exports){ | |
var dP = _dereq_(97).f; | |
var FProto = Function.prototype; | |
var nameRE = /^\s*function ([^ (]*)/; | |
var NAME = 'name'; | |
// 19.2.4.2 name | |
NAME in FProto || _dereq_(56) && dP(FProto, NAME, { | |
configurable: true, | |
get: function () { | |
try { | |
return ('' + this).match(nameRE)[1]; | |
} catch (e) { | |
return ''; | |
} | |
} | |
}); | |
},{"56":56,"97":97}],181:[function(_dereq_,module,exports){ | |
'use strict'; | |
var strong = _dereq_(47); | |
var validate = _dereq_(147); | |
var MAP = 'Map'; | |
// 23.1 Map Objects | |
module.exports = _dereq_(49)(MAP, function (get) { | |
return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; | |
}, { | |
// 23.1.3.6 Map.prototype.get(key) | |
get: function get(key) { | |
var entry = strong.getEntry(validate(this, MAP), key); | |
return entry && entry.v; | |
}, | |
// 23.1.3.9 Map.prototype.set(key, value) | |
set: function set(key, value) { | |
return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); | |
} | |
}, strong, true); | |
},{"147":147,"47":47,"49":49}],182:[function(_dereq_,module,exports){ | |
// 20.2.2.3 Math.acosh(x) | |
var $export = _dereq_(60); | |
var log1p = _dereq_(90); | |
var sqrt = Math.sqrt; | |
var $acosh = Math.acosh; | |
$export($export.S + $export.F * !($acosh | |
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 | |
&& Math.floor($acosh(Number.MAX_VALUE)) == 710 | |
// Tor Browser bug: Math.acosh(Infinity) -> NaN | |
&& $acosh(Infinity) == Infinity | |
), 'Math', { | |
acosh: function acosh(x) { | |
return (x = +x) < 1 ? NaN : x > 94906265.62425156 | |
? Math.log(x) + Math.LN2 | |
: log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); | |
} | |
}); | |
},{"60":60,"90":90}],183:[function(_dereq_,module,exports){ | |
// 20.2.2.5 Math.asinh(x) | |
var $export = _dereq_(60); | |
var $asinh = Math.asinh; | |
function asinh(x) { | |
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); | |
} | |
// Tor Browser bug: Math.asinh(0) -> -0 | |
$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); | |
},{"60":60}],184:[function(_dereq_,module,exports){ | |
// 20.2.2.7 Math.atanh(x) | |
var $export = _dereq_(60); | |
var $atanh = Math.atanh; | |
// Tor Browser bug: Math.atanh(-0) -> 0 | |
$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { | |
atanh: function atanh(x) { | |
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; | |
} | |
}); | |
},{"60":60}],185:[function(_dereq_,module,exports){ | |
// 20.2.2.9 Math.cbrt(x) | |
var $export = _dereq_(60); | |
var sign = _dereq_(91); | |
$export($export.S, 'Math', { | |
cbrt: function cbrt(x) { | |
return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); | |
} | |
}); | |
},{"60":60,"91":91}],186:[function(_dereq_,module,exports){ | |
// 20.2.2.11 Math.clz32(x) | |
var $export = _dereq_(60); | |
$export($export.S, 'Math', { | |
clz32: function clz32(x) { | |
return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; | |
} | |
}); | |
},{"60":60}],187:[function(_dereq_,module,exports){ | |
// 20.2.2.12 Math.cosh(x) | |
var $export = _dereq_(60); | |
var exp = Math.exp; | |
$export($export.S, 'Math', { | |
cosh: function cosh(x) { | |
return (exp(x = +x) + exp(-x)) / 2; | |
} | |
}); | |
},{"60":60}],188:[function(_dereq_,module,exports){ | |
// 20.2.2.14 Math.expm1(x) | |
var $export = _dereq_(60); | |
var $expm1 = _dereq_(88); | |
$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); | |
},{"60":60,"88":88}],189:[function(_dereq_,module,exports){ | |
// 20.2.2.16 Math.fround(x) | |
var $export = _dereq_(60); | |
$export($export.S, 'Math', { fround: _dereq_(89) }); | |
},{"60":60,"89":89}],190:[function(_dereq_,module,exports){ | |
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) | |
var $export = _dereq_(60); | |
var abs = Math.abs; | |
$export($export.S, 'Math', { | |
hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars | |
var sum = 0; | |
var i = 0; | |
var aLen = arguments.length; | |
var larg = 0; | |
var arg, div; | |
while (i < aLen) { | |
arg = abs(arguments[i++]); | |
if (larg < arg) { | |
div = larg / arg; | |
sum = sum * div * div + 1; | |
larg = arg; | |
} else if (arg > 0) { | |
div = arg / larg; | |
sum += div * div; | |
} else sum += arg; | |
} | |
return larg === Infinity ? Infinity : larg * Math.sqrt(sum); | |
} | |
}); | |
},{"60":60}],191:[function(_dereq_,module,exports){ | |
// 20.2.2.18 Math.imul(x, y) | |
var $export = _dereq_(60); | |
var $imul = Math.imul; | |
// some WebKit versions fails with big numbers, some has wrong arity | |
$export($export.S + $export.F * _dereq_(62)(function () { | |
return $imul(0xffffffff, 5) != -5 || $imul.length != 2; | |
}), 'Math', { | |
imul: function imul(x, y) { | |
var UINT16 = 0xffff; | |
var xn = +x; | |
var yn = +y; | |
var xl = UINT16 & xn; | |
var yl = UINT16 & yn; | |
return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); | |
} | |
}); | |
},{"60":60,"62":62}],192:[function(_dereq_,module,exports){ | |
// 20.2.2.21 Math.log10(x) | |
var $export = _dereq_(60); | |
$export($export.S, 'Math', { | |
log10: function log10(x) { | |
return Math.log(x) * Math.LOG10E; | |
} | |
}); | |
},{"60":60}],193:[function(_dereq_,module,exports){ | |
// 20.2.2.20 Math.log1p(x) | |
var $export = _dereq_(60); | |
$export($export.S, 'Math', { log1p: _dereq_(90) }); | |
},{"60":60,"90":90}],194:[function(_dereq_,module,exports){ | |
// 20.2.2.22 Math.log2(x) | |
var $export = _dereq_(60); | |
$export($export.S, 'Math', { | |
log2: function log2(x) { | |
return Math.log(x) / Math.LN2; | |
} | |
}); | |
},{"60":60}],195:[function(_dereq_,module,exports){ | |
// 20.2.2.28 Math.sign(x) | |
var $export = _dereq_(60); | |
$export($export.S, 'Math', { sign: _dereq_(91) }); | |
},{"60":60,"91":91}],196:[function(_dereq_,module,exports){ | |
// 20.2.2.30 Math.sinh(x) | |
var $export = _dereq_(60); | |
var expm1 = _dereq_(88); | |
var exp = Math.exp; | |
// V8 near Chromium 38 has a problem with very small numbers | |
$export($export.S + $export.F * _dereq_(62)(function () { | |
return !Math.sinh(-2e-17) != -2e-17; | |
}), 'Math', { | |
sinh: function sinh(x) { | |
return Math.abs(x = +x) < 1 | |
? (expm1(x) - expm1(-x)) / 2 | |
: (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); | |
} | |
}); | |
},{"60":60,"62":62,"88":88}],197:[function(_dereq_,module,exports){ | |
// 20.2.2.33 Math.tanh(x) | |
var $export = _dereq_(60); | |
var expm1 = _dereq_(88); | |
var exp = Math.exp; | |
$export($export.S, 'Math', { | |
tanh: function tanh(x) { | |
var a = expm1(x = +x); | |
var b = expm1(-x); | |
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); | |
} | |
}); | |
},{"60":60,"88":88}],198:[function(_dereq_,module,exports){ | |
// 20.2.2.34 Math.trunc(x) | |
var $export = _dereq_(60); | |
$export($export.S, 'Math', { | |
trunc: function trunc(it) { | |
return (it > 0 ? Math.floor : Math.ceil)(it); | |
} | |
}); | |
},{"60":60}],199:[function(_dereq_,module,exports){ | |
'use strict'; | |
var global = _dereq_(68); | |
var has = _dereq_(69); | |
var cof = _dereq_(46); | |
var inheritIfRequired = _dereq_(73); | |
var toPrimitive = _dereq_(141); | |
var fails = _dereq_(62); | |
var gOPN = _dereq_(101).f; | |
var gOPD = _dereq_(99).f; | |
var dP = _dereq_(97).f; | |
var $trim = _dereq_(132).trim; | |
var NUMBER = 'Number'; | |
var $Number = global[NUMBER]; | |
var Base = $Number; | |
var proto = $Number.prototype; | |
// Opera ~12 has broken Object#toString | |
var BROKEN_COF = cof(_dereq_(96)(proto)) == NUMBER; | |
var TRIM = 'trim' in String.prototype; | |
// 7.1.3 ToNumber(argument) | |
var toNumber = function (argument) { | |
var it = toPrimitive(argument, false); | |
if (typeof it == 'string' && it.length > 2) { | |
it = TRIM ? it.trim() : $trim(it, 3); | |
var first = it.charCodeAt(0); | |
var third, radix, maxCode; | |
if (first === 43 || first === 45) { | |
third = it.charCodeAt(2); | |
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix | |
} else if (first === 48) { | |
switch (it.charCodeAt(1)) { | |
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i | |
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i | |
default: return +it; | |
} | |
for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { | |
code = digits.charCodeAt(i); | |
// parseInt parses a string to a first unavailable symbol | |
// but ToNumber should return NaN if a string contains unavailable symbols | |
if (code < 48 || code > maxCode) return NaN; | |
} return parseInt(digits, radix); | |
} | |
} return +it; | |
}; | |
if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { | |
$Number = function Number(value) { | |
var it = arguments.length < 1 ? 0 : value; | |
var that = this; | |
return that instanceof $Number | |
// check on 1..constructor(foo) case | |
&& (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) | |
? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); | |
}; | |
for (var keys = _dereq_(56) ? gOPN(Base) : ( | |
// ES3: | |
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + | |
// ES6 (in case, if modules with ES6 Number statics required before): | |
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + | |
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' | |
).split(','), j = 0, key; keys.length > j; j++) { | |
if (has(Base, key = keys[j]) && !has($Number, key)) { | |
dP($Number, key, gOPD(Base, key)); | |
} | |
} | |
$Number.prototype = proto; | |
proto.constructor = $Number; | |
_dereq_(116)(global, NUMBER, $Number); | |
} | |
},{"101":101,"116":116,"132":132,"141":141,"46":46,"56":56,"62":62,"68":68,"69":69,"73":73,"96":96,"97":97,"99":99}],200:[function(_dereq_,module,exports){ | |
// 20.1.2.1 Number.EPSILON | |
var $export = _dereq_(60); | |
$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); | |
},{"60":60}],201:[function(_dereq_,module,exports){ | |
// 20.1.2.2 Number.isFinite(number) | |
var $export = _dereq_(60); | |
var _isFinite = _dereq_(68).isFinite; | |
$export($export.S, 'Number', { | |
isFinite: function isFinite(it) { | |
return typeof it == 'number' && _isFinite(it); | |
} | |
}); | |
},{"60":60,"68":68}],202:[function(_dereq_,module,exports){ | |
// 20.1.2.3 Number.isInteger(number) | |
var $export = _dereq_(60); | |
$export($export.S, 'Number', { isInteger: _dereq_(78) }); | |
},{"60":60,"78":78}],203:[function(_dereq_,module,exports){ | |
// 20.1.2.4 Number.isNaN(number) | |
var $export = _dereq_(60); | |
$export($export.S, 'Number', { | |
isNaN: function isNaN(number) { | |
// eslint-disable-next-line no-self-compare | |
return number != number; | |
} | |
}); | |
},{"60":60}],204:[function(_dereq_,module,exports){ | |
// 20.1.2.5 Number.isSafeInteger(number) | |
var $export = _dereq_(60); | |
var isInteger = _dereq_(78); | |
var abs = Math.abs; | |
$export($export.S, 'Number', { | |
isSafeInteger: function isSafeInteger(number) { | |
return isInteger(number) && abs(number) <= 0x1fffffffffffff; | |
} | |
}); | |
},{"60":60,"78":78}],205:[function(_dereq_,module,exports){ | |
// 20.1.2.6 Number.MAX_SAFE_INTEGER | |
var $export = _dereq_(60); | |
$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); | |
},{"60":60}],206:[function(_dereq_,module,exports){ | |
// 20.1.2.10 Number.MIN_SAFE_INTEGER | |
var $export = _dereq_(60); | |
$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); | |
},{"60":60}],207:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var $parseFloat = _dereq_(110); | |
// 20.1.2.12 Number.parseFloat(string) | |
$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); | |
},{"110":110,"60":60}],208:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var $parseInt = _dereq_(111); | |
// 20.1.2.13 Number.parseInt(string, radix) | |
$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); | |
},{"111":111,"60":60}],209:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var toInteger = _dereq_(137); | |
var aNumberValue = _dereq_(32); | |
var repeat = _dereq_(131); | |
var $toFixed = 1.0.toFixed; | |
var floor = Math.floor; | |
var data = [0, 0, 0, 0, 0, 0]; | |
var ERROR = 'Number.toFixed: incorrect invocation!'; | |
var ZERO = '0'; | |
var multiply = function (n, c) { | |
var i = -1; | |
var c2 = c; | |
while (++i < 6) { | |
c2 += n * data[i]; | |
data[i] = c2 % 1e7; | |
c2 = floor(c2 / 1e7); | |
} | |
}; | |
var divide = function (n) { | |
var i = 6; | |
var c = 0; | |
while (--i >= 0) { | |
c += data[i]; | |
data[i] = floor(c / n); | |
c = (c % n) * 1e7; | |
} | |
}; | |
var numToString = function () { | |
var i = 6; | |
var s = ''; | |
while (--i >= 0) { | |
if (s !== '' || i === 0 || data[i] !== 0) { | |
var t = String(data[i]); | |
s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; | |
} | |
} return s; | |
}; | |
var pow = function (x, n, acc) { | |
return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); | |
}; | |
var log = function (x) { | |
var n = 0; | |
var x2 = x; | |
while (x2 >= 4096) { | |
n += 12; | |
x2 /= 4096; | |
} | |
while (x2 >= 2) { | |
n += 1; | |
x2 /= 2; | |
} return n; | |
}; | |
$export($export.P + $export.F * (!!$toFixed && ( | |
0.00008.toFixed(3) !== '0.000' || | |
0.9.toFixed(0) !== '1' || | |
1.255.toFixed(2) !== '1.25' || | |
1000000000000000128.0.toFixed(0) !== '1000000000000000128' | |
) || !_dereq_(62)(function () { | |
// V8 ~ Android 4.3- | |
$toFixed.call({}); | |
})), 'Number', { | |
toFixed: function toFixed(fractionDigits) { | |
var x = aNumberValue(this, ERROR); | |
var f = toInteger(fractionDigits); | |
var s = ''; | |
var m = ZERO; | |
var e, z, j, k; | |
if (f < 0 || f > 20) throw RangeError(ERROR); | |
// eslint-disable-next-line no-self-compare | |
if (x != x) return 'NaN'; | |
if (x <= -1e21 || x >= 1e21) return String(x); | |
if (x < 0) { | |
s = '-'; | |
x = -x; | |
} | |
if (x > 1e-21) { | |
e = log(x * pow(2, 69, 1)) - 69; | |
z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); | |
z *= 0x10000000000000; | |
e = 52 - e; | |
if (e > 0) { | |
multiply(0, z); | |
j = f; | |
while (j >= 7) { | |
multiply(1e7, 0); | |
j -= 7; | |
} | |
multiply(pow(10, j, 1), 0); | |
j = e - 1; | |
while (j >= 23) { | |
divide(1 << 23); | |
j -= 23; | |
} | |
divide(1 << j); | |
multiply(1, 1); | |
divide(2); | |
m = numToString(); | |
} else { | |
multiply(0, z); | |
multiply(1 << -e, 0); | |
m = numToString() + repeat.call(ZERO, f); | |
} | |
} | |
if (f > 0) { | |
k = m.length; | |
m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); | |
} else { | |
m = s + m; | |
} return m; | |
} | |
}); | |
},{"131":131,"137":137,"32":32,"60":60,"62":62}],210:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $fails = _dereq_(62); | |
var aNumberValue = _dereq_(32); | |
var $toPrecision = 1.0.toPrecision; | |
$export($export.P + $export.F * ($fails(function () { | |
// IE7- | |
return $toPrecision.call(1, undefined) !== '1'; | |
}) || !$fails(function () { | |
// V8 ~ Android 4.3- | |
$toPrecision.call({}); | |
})), 'Number', { | |
toPrecision: function toPrecision(precision) { | |
var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); | |
return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); | |
} | |
}); | |
},{"32":32,"60":60,"62":62}],211:[function(_dereq_,module,exports){ | |
// 19.1.3.1 Object.assign(target, source) | |
var $export = _dereq_(60); | |
$export($export.S + $export.F, 'Object', { assign: _dereq_(95) }); | |
},{"60":60,"95":95}],212:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) | |
$export($export.S, 'Object', { create: _dereq_(96) }); | |
},{"60":60,"96":96}],213:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) | |
$export($export.S + $export.F * !_dereq_(56), 'Object', { defineProperties: _dereq_(98) }); | |
},{"56":56,"60":60,"98":98}],214:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) | |
$export($export.S + $export.F * !_dereq_(56), 'Object', { defineProperty: _dereq_(97).f }); | |
},{"56":56,"60":60,"97":97}],215:[function(_dereq_,module,exports){ | |
// 19.1.2.5 Object.freeze(O) | |
var isObject = _dereq_(79); | |
var meta = _dereq_(92).onFreeze; | |
_dereq_(107)('freeze', function ($freeze) { | |
return function freeze(it) { | |
return $freeze && isObject(it) ? $freeze(meta(it)) : it; | |
}; | |
}); | |
},{"107":107,"79":79,"92":92}],216:[function(_dereq_,module,exports){ | |
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) | |
var toIObject = _dereq_(138); | |
var $getOwnPropertyDescriptor = _dereq_(99).f; | |
_dereq_(107)('getOwnPropertyDescriptor', function () { | |
return function getOwnPropertyDescriptor(it, key) { | |
return $getOwnPropertyDescriptor(toIObject(it), key); | |
}; | |
}); | |
},{"107":107,"138":138,"99":99}],217:[function(_dereq_,module,exports){ | |
// 19.1.2.7 Object.getOwnPropertyNames(O) | |
_dereq_(107)('getOwnPropertyNames', function () { | |
return _dereq_(100).f; | |
}); | |
},{"100":100,"107":107}],218:[function(_dereq_,module,exports){ | |
// 19.1.2.9 Object.getPrototypeOf(O) | |
var toObject = _dereq_(140); | |
var $getPrototypeOf = _dereq_(103); | |
_dereq_(107)('getPrototypeOf', function () { | |
return function getPrototypeOf(it) { | |
return $getPrototypeOf(toObject(it)); | |
}; | |
}); | |
},{"103":103,"107":107,"140":140}],219:[function(_dereq_,module,exports){ | |
// 19.1.2.11 Object.isExtensible(O) | |
var isObject = _dereq_(79); | |
_dereq_(107)('isExtensible', function ($isExtensible) { | |
return function isExtensible(it) { | |
return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; | |
}; | |
}); | |
},{"107":107,"79":79}],220:[function(_dereq_,module,exports){ | |
// 19.1.2.12 Object.isFrozen(O) | |
var isObject = _dereq_(79); | |
_dereq_(107)('isFrozen', function ($isFrozen) { | |
return function isFrozen(it) { | |
return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; | |
}; | |
}); | |
},{"107":107,"79":79}],221:[function(_dereq_,module,exports){ | |
// 19.1.2.13 Object.isSealed(O) | |
var isObject = _dereq_(79); | |
_dereq_(107)('isSealed', function ($isSealed) { | |
return function isSealed(it) { | |
return isObject(it) ? $isSealed ? $isSealed(it) : false : true; | |
}; | |
}); | |
},{"107":107,"79":79}],222:[function(_dereq_,module,exports){ | |
// 19.1.3.10 Object.is(value1, value2) | |
var $export = _dereq_(60); | |
$export($export.S, 'Object', { is: _dereq_(119) }); | |
},{"119":119,"60":60}],223:[function(_dereq_,module,exports){ | |
// 19.1.2.14 Object.keys(O) | |
var toObject = _dereq_(140); | |
var $keys = _dereq_(105); | |
_dereq_(107)('keys', function () { | |
return function keys(it) { | |
return $keys(toObject(it)); | |
}; | |
}); | |
},{"105":105,"107":107,"140":140}],224:[function(_dereq_,module,exports){ | |
// 19.1.2.15 Object.preventExtensions(O) | |
var isObject = _dereq_(79); | |
var meta = _dereq_(92).onFreeze; | |
_dereq_(107)('preventExtensions', function ($preventExtensions) { | |
return function preventExtensions(it) { | |
return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; | |
}; | |
}); | |
},{"107":107,"79":79,"92":92}],225:[function(_dereq_,module,exports){ | |
// 19.1.2.17 Object.seal(O) | |
var isObject = _dereq_(79); | |
var meta = _dereq_(92).onFreeze; | |
_dereq_(107)('seal', function ($seal) { | |
return function seal(it) { | |
return $seal && isObject(it) ? $seal(meta(it)) : it; | |
}; | |
}); | |
},{"107":107,"79":79,"92":92}],226:[function(_dereq_,module,exports){ | |
// 19.1.3.19 Object.setPrototypeOf(O, proto) | |
var $export = _dereq_(60); | |
$export($export.S, 'Object', { setPrototypeOf: _dereq_(120).set }); | |
},{"120":120,"60":60}],227:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 19.1.3.6 Object.prototype.toString() | |
var classof = _dereq_(45); | |
var test = {}; | |
test[_dereq_(150)('toStringTag')] = 'z'; | |
if (test + '' != '[object z]') { | |
_dereq_(116)(Object.prototype, 'toString', function toString() { | |
return '[object ' + classof(this) + ']'; | |
}, true); | |
} | |
},{"116":116,"150":150,"45":45}],228:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var $parseFloat = _dereq_(110); | |
// 18.2.4 parseFloat(string) | |
$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); | |
},{"110":110,"60":60}],229:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var $parseInt = _dereq_(111); | |
// 18.2.5 parseInt(string, radix) | |
$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); | |
},{"111":111,"60":60}],230:[function(_dereq_,module,exports){ | |
'use strict'; | |
var LIBRARY = _dereq_(87); | |
var global = _dereq_(68); | |
var ctx = _dereq_(52); | |
var classof = _dereq_(45); | |
var $export = _dereq_(60); | |
var isObject = _dereq_(79); | |
var aFunction = _dereq_(31); | |
var anInstance = _dereq_(35); | |
var forOf = _dereq_(66); | |
var speciesConstructor = _dereq_(125); | |
var task = _dereq_(134).set; | |
var microtask = _dereq_(93)(); | |
var newPromiseCapabilityModule = _dereq_(94); | |
var perform = _dereq_(112); | |
var userAgent = _dereq_(146); | |
var promiseResolve = _dereq_(113); | |
var PROMISE = 'Promise'; | |
var TypeError = global.TypeError; | |
var process = global.process; | |
var versions = process && process.versions; | |
var v8 = versions && versions.v8 || ''; | |
var $Promise = global[PROMISE]; | |
var isNode = classof(process) == 'process'; | |
var empty = function () { /* empty */ }; | |
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; | |
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; | |
var USE_NATIVE = !!function () { | |
try { | |
// correct subclassing with @@species support | |
var promise = $Promise.resolve(1); | |
var FakePromise = (promise.constructor = {})[_dereq_(150)('species')] = function (exec) { | |
exec(empty, empty); | |
}; | |
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test | |
return (isNode || typeof PromiseRejectionEvent == 'function') | |
&& promise.then(empty) instanceof FakePromise | |
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables | |
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565 | |
// we can't detect it synchronously, so just check versions | |
&& v8.indexOf('6.6') !== 0 | |
&& userAgent.indexOf('Chrome/66') === -1; | |
} catch (e) { /* empty */ } | |
}(); | |
// helpers | |
var isThenable = function (it) { | |
var then; | |
return isObject(it) && typeof (then = it.then) == 'function' ? then : false; | |
}; | |
var notify = function (promise, isReject) { | |
if (promise._n) return; | |
promise._n = true; | |
var chain = promise._c; | |
microtask(function () { | |
var value = promise._v; | |
var ok = promise._s == 1; | |
var i = 0; | |
var run = function (reaction) { | |
var handler = ok ? reaction.ok : reaction.fail; | |
var resolve = reaction.resolve; | |
var reject = reaction.reject; | |
var domain = reaction.domain; | |
var result, then, exited; | |
try { | |
if (handler) { | |
if (!ok) { | |
if (promise._h == 2) onHandleUnhandled(promise); | |
promise._h = 1; | |
} | |
if (handler === true) result = value; | |
else { | |
if (domain) domain.enter(); | |
result = handler(value); // may throw | |
if (domain) { | |
domain.exit(); | |
exited = true; | |
} | |
} | |
if (result === reaction.promise) { | |
reject(TypeError('Promise-chain cycle')); | |
} else if (then = isThenable(result)) { | |
then.call(result, resolve, reject); | |
} else resolve(result); | |
} else reject(value); | |
} catch (e) { | |
if (domain && !exited) domain.exit(); | |
reject(e); | |
} | |
}; | |
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach | |
promise._c = []; | |
promise._n = false; | |
if (isReject && !promise._h) onUnhandled(promise); | |
}); | |
}; | |
var onUnhandled = function (promise) { | |
task.call(global, function () { | |
var value = promise._v; | |
var unhandled = isUnhandled(promise); | |
var result, handler, console; | |
if (unhandled) { | |
result = perform(function () { | |
if (isNode) { | |
process.emit('unhandledRejection', value, promise); | |
} else if (handler = global.onunhandledrejection) { | |
handler({ promise: promise, reason: value }); | |
} else if ((console = global.console) && console.error) { | |
console.error('Unhandled promise rejection', value); | |
} | |
}); | |
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should | |
promise._h = isNode || isUnhandled(promise) ? 2 : 1; | |
} promise._a = undefined; | |
if (unhandled && result.e) throw result.v; | |
}); | |
}; | |
var isUnhandled = function (promise) { | |
return promise._h !== 1 && (promise._a || promise._c).length === 0; | |
}; | |
var onHandleUnhandled = function (promise) { | |
task.call(global, function () { | |
var handler; | |
if (isNode) { | |
process.emit('rejectionHandled', promise); | |
} else if (handler = global.onrejectionhandled) { | |
handler({ promise: promise, reason: promise._v }); | |
} | |
}); | |
}; | |
var $reject = function (value) { | |
var promise = this; | |
if (promise._d) return; | |
promise._d = true; | |
promise = promise._w || promise; // unwrap | |
promise._v = value; | |
promise._s = 2; | |
if (!promise._a) promise._a = promise._c.slice(); | |
notify(promise, true); | |
}; | |
var $resolve = function (value) { | |
var promise = this; | |
var then; | |
if (promise._d) return; | |
promise._d = true; | |
promise = promise._w || promise; // unwrap | |
try { | |
if (promise === value) throw TypeError("Promise can't be resolved itself"); | |
if (then = isThenable(value)) { | |
microtask(function () { | |
var wrapper = { _w: promise, _d: false }; // wrap | |
try { | |
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); | |
} catch (e) { | |
$reject.call(wrapper, e); | |
} | |
}); | |
} else { | |
promise._v = value; | |
promise._s = 1; | |
notify(promise, false); | |
} | |
} catch (e) { | |
$reject.call({ _w: promise, _d: false }, e); // wrap | |
} | |
}; | |
// constructor polyfill | |
if (!USE_NATIVE) { | |
// 25.4.3.1 Promise(executor) | |
$Promise = function Promise(executor) { | |
anInstance(this, $Promise, PROMISE, '_h'); | |
aFunction(executor); | |
Internal.call(this); | |
try { | |
executor(ctx($resolve, this, 1), ctx($reject, this, 1)); | |
} catch (err) { | |
$reject.call(this, err); | |
} | |
}; | |
// eslint-disable-next-line no-unused-vars | |
Internal = function Promise(executor) { | |
this._c = []; // <- awaiting reactions | |
this._a = undefined; // <- checked in isUnhandled reactions | |
this._s = 0; // <- state | |
this._d = false; // <- done | |
this._v = undefined; // <- value | |
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled | |
this._n = false; // <- notify | |
}; | |
Internal.prototype = _dereq_(115)($Promise.prototype, { | |
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) | |
then: function then(onFulfilled, onRejected) { | |
var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); | |
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; | |
reaction.fail = typeof onRejected == 'function' && onRejected; | |
reaction.domain = isNode ? process.domain : undefined; | |
this._c.push(reaction); | |
if (this._a) this._a.push(reaction); | |
if (this._s) notify(this, false); | |
return reaction.promise; | |
}, | |
// 25.4.5.1 Promise.prototype.catch(onRejected) | |
'catch': function (onRejected) { | |
return this.then(undefined, onRejected); | |
} | |
}); | |
OwnPromiseCapability = function () { | |
var promise = new Internal(); | |
this.promise = promise; | |
this.resolve = ctx($resolve, promise, 1); | |
this.reject = ctx($reject, promise, 1); | |
}; | |
newPromiseCapabilityModule.f = newPromiseCapability = function (C) { | |
return C === $Promise || C === Wrapper | |
? new OwnPromiseCapability(C) | |
: newGenericPromiseCapability(C); | |
}; | |
} | |
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); | |
_dereq_(122)($Promise, PROMISE); | |
_dereq_(121)(PROMISE); | |
Wrapper = _dereq_(50)[PROMISE]; | |
// statics | |
$export($export.S + $export.F * !USE_NATIVE, PROMISE, { | |
// 25.4.4.5 Promise.reject(r) | |
reject: function reject(r) { | |
var capability = newPromiseCapability(this); | |
var $$reject = capability.reject; | |
$$reject(r); | |
return capability.promise; | |
} | |
}); | |
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { | |
// 25.4.4.6 Promise.resolve(x) | |
resolve: function resolve(x) { | |
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); | |
} | |
}); | |
$export($export.S + $export.F * !(USE_NATIVE && _dereq_(84)(function (iter) { | |
$Promise.all(iter)['catch'](empty); | |
})), PROMISE, { | |
// 25.4.4.1 Promise.all(iterable) | |
all: function all(iterable) { | |
var C = this; | |
var capability = newPromiseCapability(C); | |
var resolve = capability.resolve; | |
var reject = capability.reject; | |
var result = perform(function () { | |
var values = []; | |
var index = 0; | |
var remaining = 1; | |
forOf(iterable, false, function (promise) { | |
var $index = index++; | |
var alreadyCalled = false; | |
values.push(undefined); | |
remaining++; | |
C.resolve(promise).then(function (value) { | |
if (alreadyCalled) return; | |
alreadyCalled = true; | |
values[$index] = value; | |
--remaining || resolve(values); | |
}, reject); | |
}); | |
--remaining || resolve(values); | |
}); | |
if (result.e) reject(result.v); | |
return capability.promise; | |
}, | |
// 25.4.4.4 Promise.race(iterable) | |
race: function race(iterable) { | |
var C = this; | |
var capability = newPromiseCapability(C); | |
var reject = capability.reject; | |
var result = perform(function () { | |
forOf(iterable, false, function (promise) { | |
C.resolve(promise).then(capability.resolve, reject); | |
}); | |
}); | |
if (result.e) reject(result.v); | |
return capability.promise; | |
} | |
}); | |
},{"112":112,"113":113,"115":115,"121":121,"122":122,"125":125,"134":134,"146":146,"150":150,"31":31,"35":35,"45":45,"50":50,"52":52,"60":60,"66":66,"68":68,"79":79,"84":84,"87":87,"93":93,"94":94}],231:[function(_dereq_,module,exports){ | |
// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) | |
var $export = _dereq_(60); | |
var aFunction = _dereq_(31); | |
var anObject = _dereq_(36); | |
var rApply = (_dereq_(68).Reflect || {}).apply; | |
var fApply = Function.apply; | |
// MS Edge argumentsList argument is optional | |
$export($export.S + $export.F * !_dereq_(62)(function () { | |
rApply(function () { /* empty */ }); | |
}), 'Reflect', { | |
apply: function apply(target, thisArgument, argumentsList) { | |
var T = aFunction(target); | |
var L = anObject(argumentsList); | |
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); | |
} | |
}); | |
},{"31":31,"36":36,"60":60,"62":62,"68":68}],232:[function(_dereq_,module,exports){ | |
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) | |
var $export = _dereq_(60); | |
var create = _dereq_(96); | |
var aFunction = _dereq_(31); | |
var anObject = _dereq_(36); | |
var isObject = _dereq_(79); | |
var fails = _dereq_(62); | |
var bind = _dereq_(44); | |
var rConstruct = (_dereq_(68).Reflect || {}).construct; | |
// MS Edge supports only 2 arguments and argumentsList argument is optional | |
// FF Nightly sets third argument as `new.target`, but does not create `this` from it | |
var NEW_TARGET_BUG = fails(function () { | |
function F() { /* empty */ } | |
return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); | |
}); | |
var ARGS_BUG = !fails(function () { | |
rConstruct(function () { /* empty */ }); | |
}); | |
$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { | |
construct: function construct(Target, args /* , newTarget */) { | |
aFunction(Target); | |
anObject(args); | |
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); | |
if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); | |
if (Target == newTarget) { | |
// w/o altered newTarget, optimization for 0-4 arguments | |
switch (args.length) { | |
case 0: return new Target(); | |
case 1: return new Target(args[0]); | |
case 2: return new Target(args[0], args[1]); | |
case 3: return new Target(args[0], args[1], args[2]); | |
case 4: return new Target(args[0], args[1], args[2], args[3]); | |
} | |
// w/o altered newTarget, lot of arguments case | |
var $args = [null]; | |
$args.push.apply($args, args); | |
return new (bind.apply(Target, $args))(); | |
} | |
// with altered newTarget, not support built-in constructors | |
var proto = newTarget.prototype; | |
var instance = create(isObject(proto) ? proto : Object.prototype); | |
var result = Function.apply.call(Target, instance, args); | |
return isObject(result) ? result : instance; | |
} | |
}); | |
},{"31":31,"36":36,"44":44,"60":60,"62":62,"68":68,"79":79,"96":96}],233:[function(_dereq_,module,exports){ | |
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) | |
var dP = _dereq_(97); | |
var $export = _dereq_(60); | |
var anObject = _dereq_(36); | |
var toPrimitive = _dereq_(141); | |
// MS Edge has broken Reflect.defineProperty - throwing instead of returning false | |
$export($export.S + $export.F * _dereq_(62)(function () { | |
// eslint-disable-next-line no-undef | |
Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); | |
}), 'Reflect', { | |
defineProperty: function defineProperty(target, propertyKey, attributes) { | |
anObject(target); | |
propertyKey = toPrimitive(propertyKey, true); | |
anObject(attributes); | |
try { | |
dP.f(target, propertyKey, attributes); | |
return true; | |
} catch (e) { | |
return false; | |
} | |
} | |
}); | |
},{"141":141,"36":36,"60":60,"62":62,"97":97}],234:[function(_dereq_,module,exports){ | |
// 26.1.4 Reflect.deleteProperty(target, propertyKey) | |
var $export = _dereq_(60); | |
var gOPD = _dereq_(99).f; | |
var anObject = _dereq_(36); | |
$export($export.S, 'Reflect', { | |
deleteProperty: function deleteProperty(target, propertyKey) { | |
var desc = gOPD(anObject(target), propertyKey); | |
return desc && !desc.configurable ? false : delete target[propertyKey]; | |
} | |
}); | |
},{"36":36,"60":60,"99":99}],235:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 26.1.5 Reflect.enumerate(target) | |
var $export = _dereq_(60); | |
var anObject = _dereq_(36); | |
var Enumerate = function (iterated) { | |
this._t = anObject(iterated); // target | |
this._i = 0; // next index | |
var keys = this._k = []; // keys | |
var key; | |
for (key in iterated) keys.push(key); | |
}; | |
_dereq_(82)(Enumerate, 'Object', function () { | |
var that = this; | |
var keys = that._k; | |
var key; | |
do { | |
if (that._i >= keys.length) return { value: undefined, done: true }; | |
} while (!((key = keys[that._i++]) in that._t)); | |
return { value: key, done: false }; | |
}); | |
$export($export.S, 'Reflect', { | |
enumerate: function enumerate(target) { | |
return new Enumerate(target); | |
} | |
}); | |
},{"36":36,"60":60,"82":82}],236:[function(_dereq_,module,exports){ | |
// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) | |
var gOPD = _dereq_(99); | |
var $export = _dereq_(60); | |
var anObject = _dereq_(36); | |
$export($export.S, 'Reflect', { | |
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { | |
return gOPD.f(anObject(target), propertyKey); | |
} | |
}); | |
},{"36":36,"60":60,"99":99}],237:[function(_dereq_,module,exports){ | |
// 26.1.8 Reflect.getPrototypeOf(target) | |
var $export = _dereq_(60); | |
var getProto = _dereq_(103); | |
var anObject = _dereq_(36); | |
$export($export.S, 'Reflect', { | |
getPrototypeOf: function getPrototypeOf(target) { | |
return getProto(anObject(target)); | |
} | |
}); | |
},{"103":103,"36":36,"60":60}],238:[function(_dereq_,module,exports){ | |
// 26.1.6 Reflect.get(target, propertyKey [, receiver]) | |
var gOPD = _dereq_(99); | |
var getPrototypeOf = _dereq_(103); | |
var has = _dereq_(69); | |
var $export = _dereq_(60); | |
var isObject = _dereq_(79); | |
var anObject = _dereq_(36); | |
function get(target, propertyKey /* , receiver */) { | |
var receiver = arguments.length < 3 ? target : arguments[2]; | |
var desc, proto; | |
if (anObject(target) === receiver) return target[propertyKey]; | |
if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') | |
? desc.value | |
: desc.get !== undefined | |
? desc.get.call(receiver) | |
: undefined; | |
if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); | |
} | |
$export($export.S, 'Reflect', { get: get }); | |
},{"103":103,"36":36,"60":60,"69":69,"79":79,"99":99}],239:[function(_dereq_,module,exports){ | |
// 26.1.9 Reflect.has(target, propertyKey) | |
var $export = _dereq_(60); | |
$export($export.S, 'Reflect', { | |
has: function has(target, propertyKey) { | |
return propertyKey in target; | |
} | |
}); | |
},{"60":60}],240:[function(_dereq_,module,exports){ | |
// 26.1.10 Reflect.isExtensible(target) | |
var $export = _dereq_(60); | |
var anObject = _dereq_(36); | |
var $isExtensible = Object.isExtensible; | |
$export($export.S, 'Reflect', { | |
isExtensible: function isExtensible(target) { | |
anObject(target); | |
return $isExtensible ? $isExtensible(target) : true; | |
} | |
}); | |
},{"36":36,"60":60}],241:[function(_dereq_,module,exports){ | |
// 26.1.11 Reflect.ownKeys(target) | |
var $export = _dereq_(60); | |
$export($export.S, 'Reflect', { ownKeys: _dereq_(109) }); | |
},{"109":109,"60":60}],242:[function(_dereq_,module,exports){ | |
// 26.1.12 Reflect.preventExtensions(target) | |
var $export = _dereq_(60); | |
var anObject = _dereq_(36); | |
var $preventExtensions = Object.preventExtensions; | |
$export($export.S, 'Reflect', { | |
preventExtensions: function preventExtensions(target) { | |
anObject(target); | |
try { | |
if ($preventExtensions) $preventExtensions(target); | |
return true; | |
} catch (e) { | |
return false; | |
} | |
} | |
}); | |
},{"36":36,"60":60}],243:[function(_dereq_,module,exports){ | |
// 26.1.14 Reflect.setPrototypeOf(target, proto) | |
var $export = _dereq_(60); | |
var setProto = _dereq_(120); | |
if (setProto) $export($export.S, 'Reflect', { | |
setPrototypeOf: function setPrototypeOf(target, proto) { | |
setProto.check(target, proto); | |
try { | |
setProto.set(target, proto); | |
return true; | |
} catch (e) { | |
return false; | |
} | |
} | |
}); | |
},{"120":120,"60":60}],244:[function(_dereq_,module,exports){ | |
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) | |
var dP = _dereq_(97); | |
var gOPD = _dereq_(99); | |
var getPrototypeOf = _dereq_(103); | |
var has = _dereq_(69); | |
var $export = _dereq_(60); | |
var createDesc = _dereq_(114); | |
var anObject = _dereq_(36); | |
var isObject = _dereq_(79); | |
function set(target, propertyKey, V /* , receiver */) { | |
var receiver = arguments.length < 4 ? target : arguments[3]; | |
var ownDesc = gOPD.f(anObject(target), propertyKey); | |
var existingDescriptor, proto; | |
if (!ownDesc) { | |
if (isObject(proto = getPrototypeOf(target))) { | |
return set(proto, propertyKey, V, receiver); | |
} | |
ownDesc = createDesc(0); | |
} | |
if (has(ownDesc, 'value')) { | |
if (ownDesc.writable === false || !isObject(receiver)) return false; | |
if (existingDescriptor = gOPD.f(receiver, propertyKey)) { | |
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; | |
existingDescriptor.value = V; | |
dP.f(receiver, propertyKey, existingDescriptor); | |
} else dP.f(receiver, propertyKey, createDesc(0, V)); | |
return true; | |
} | |
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); | |
} | |
$export($export.S, 'Reflect', { set: set }); | |
},{"103":103,"114":114,"36":36,"60":60,"69":69,"79":79,"97":97,"99":99}],245:[function(_dereq_,module,exports){ | |
var global = _dereq_(68); | |
var inheritIfRequired = _dereq_(73); | |
var dP = _dereq_(97).f; | |
var gOPN = _dereq_(101).f; | |
var isRegExp = _dereq_(80); | |
var $flags = _dereq_(64); | |
var $RegExp = global.RegExp; | |
var Base = $RegExp; | |
var proto = $RegExp.prototype; | |
var re1 = /a/g; | |
var re2 = /a/g; | |
// "new" creates a new object, old webkit buggy here | |
var CORRECT_NEW = new $RegExp(re1) !== re1; | |
if (_dereq_(56) && (!CORRECT_NEW || _dereq_(62)(function () { | |
re2[_dereq_(150)('match')] = false; | |
// RegExp constructor can alter flags and IsRegExp works correct with @@match | |
return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; | |
}))) { | |
$RegExp = function RegExp(p, f) { | |
var tiRE = this instanceof $RegExp; | |
var piRE = isRegExp(p); | |
var fiU = f === undefined; | |
return !tiRE && piRE && p.constructor === $RegExp && fiU ? p | |
: inheritIfRequired(CORRECT_NEW | |
? new Base(piRE && !fiU ? p.source : p, f) | |
: Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) | |
, tiRE ? this : proto, $RegExp); | |
}; | |
var proxy = function (key) { | |
key in $RegExp || dP($RegExp, key, { | |
configurable: true, | |
get: function () { return Base[key]; }, | |
set: function (it) { Base[key] = it; } | |
}); | |
}; | |
for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); | |
proto.constructor = $RegExp; | |
$RegExp.prototype = proto; | |
_dereq_(116)(global, 'RegExp', $RegExp); | |
} | |
_dereq_(121)('RegExp'); | |
},{"101":101,"116":116,"121":121,"150":150,"56":56,"62":62,"64":64,"68":68,"73":73,"80":80,"97":97}],246:[function(_dereq_,module,exports){ | |
'use strict'; | |
var regexpExec = _dereq_(118); | |
_dereq_(60)({ | |
target: 'RegExp', | |
proto: true, | |
forced: regexpExec !== /./.exec | |
}, { | |
exec: regexpExec | |
}); | |
},{"118":118,"60":60}],247:[function(_dereq_,module,exports){ | |
// 21.2.5.3 get RegExp.prototype.flags() | |
if (_dereq_(56) && /./g.flags != 'g') _dereq_(97).f(RegExp.prototype, 'flags', { | |
configurable: true, | |
get: _dereq_(64) | |
}); | |
},{"56":56,"64":64,"97":97}],248:[function(_dereq_,module,exports){ | |
'use strict'; | |
var anObject = _dereq_(36); | |
var toLength = _dereq_(139); | |
var advanceStringIndex = _dereq_(34); | |
var regExpExec = _dereq_(117); | |
// @@match logic | |
_dereq_(63)('match', 1, function (defined, MATCH, $match, maybeCallNative) { | |
return [ | |
// `String.prototype.match` method | |
// https://tc39.github.io/ecma262/#sec-string.prototype.match | |
function match(regexp) { | |
var O = defined(this); | |
var fn = regexp == undefined ? undefined : regexp[MATCH]; | |
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); | |
}, | |
// `RegExp.prototype[@@match]` method | |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match | |
function (regexp) { | |
var res = maybeCallNative($match, regexp, this); | |
if (res.done) return res.value; | |
var rx = anObject(regexp); | |
var S = String(this); | |
if (!rx.global) return regExpExec(rx, S); | |
var fullUnicode = rx.unicode; | |
rx.lastIndex = 0; | |
var A = []; | |
var n = 0; | |
var result; | |
while ((result = regExpExec(rx, S)) !== null) { | |
var matchStr = String(result[0]); | |
A[n] = matchStr; | |
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); | |
n++; | |
} | |
return n === 0 ? null : A; | |
} | |
]; | |
}); | |
},{"117":117,"139":139,"34":34,"36":36,"63":63}],249:[function(_dereq_,module,exports){ | |
'use strict'; | |
var anObject = _dereq_(36); | |
var toObject = _dereq_(140); | |
var toLength = _dereq_(139); | |
var toInteger = _dereq_(137); | |
var advanceStringIndex = _dereq_(34); | |
var regExpExec = _dereq_(117); | |
var max = Math.max; | |
var min = Math.min; | |
var floor = Math.floor; | |
var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; | |
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; | |
var maybeToString = function (it) { | |
return it === undefined ? it : String(it); | |
}; | |
// @@replace logic | |
_dereq_(63)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { | |
return [ | |
// `String.prototype.replace` method | |
// https://tc39.github.io/ecma262/#sec-string.prototype.replace | |
function replace(searchValue, replaceValue) { | |
var O = defined(this); | |
var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; | |
return fn !== undefined | |
? fn.call(searchValue, O, replaceValue) | |
: $replace.call(String(O), searchValue, replaceValue); | |
}, | |
// `RegExp.prototype[@@replace]` method | |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace | |
function (regexp, replaceValue) { | |
var res = maybeCallNative($replace, regexp, this, replaceValue); | |
if (res.done) return res.value; | |
var rx = anObject(regexp); | |
var S = String(this); | |
var functionalReplace = typeof replaceValue === 'function'; | |
if (!functionalReplace) replaceValue = String(replaceValue); | |
var global = rx.global; | |
if (global) { | |
var fullUnicode = rx.unicode; | |
rx.lastIndex = 0; | |
} | |
var results = []; | |
while (true) { | |
var result = regExpExec(rx, S); | |
if (result === null) break; | |
results.push(result); | |
if (!global) break; | |
var matchStr = String(result[0]); | |
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); | |
} | |
var accumulatedResult = ''; | |
var nextSourcePosition = 0; | |
for (var i = 0; i < results.length; i++) { | |
result = results[i]; | |
var matched = String(result[0]); | |
var position = max(min(toInteger(result.index), S.length), 0); | |
var captures = []; | |
// NOTE: This is equivalent to | |
// captures = result.slice(1).map(maybeToString) | |
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in | |
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and | |
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. | |
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); | |
var namedCaptures = result.groups; | |
if (functionalReplace) { | |
var replacerArgs = [matched].concat(captures, position, S); | |
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); | |
var replacement = String(replaceValue.apply(undefined, replacerArgs)); | |
} else { | |
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); | |
} | |
if (position >= nextSourcePosition) { | |
accumulatedResult += S.slice(nextSourcePosition, position) + replacement; | |
nextSourcePosition = position + matched.length; | |
} | |
} | |
return accumulatedResult + S.slice(nextSourcePosition); | |
} | |
]; | |
// https://tc39.github.io/ecma262/#sec-getsubstitution | |
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { | |
var tailPos = position + matched.length; | |
var m = captures.length; | |
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; | |
if (namedCaptures !== undefined) { | |
namedCaptures = toObject(namedCaptures); | |
symbols = SUBSTITUTION_SYMBOLS; | |
} | |
return $replace.call(replacement, symbols, function (match, ch) { | |
var capture; | |
switch (ch.charAt(0)) { | |
case '$': return '$'; | |
case '&': return matched; | |
case '`': return str.slice(0, position); | |
case "'": return str.slice(tailPos); | |
case '<': | |
capture = namedCaptures[ch.slice(1, -1)]; | |
break; | |
default: // \d\d? | |
var n = +ch; | |
if (n === 0) return match; | |
if (n > m) { | |
var f = floor(n / 10); | |
if (f === 0) return match; | |
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); | |
return match; | |
} | |
capture = captures[n - 1]; | |
} | |
return capture === undefined ? '' : capture; | |
}); | |
} | |
}); | |
},{"117":117,"137":137,"139":139,"140":140,"34":34,"36":36,"63":63}],250:[function(_dereq_,module,exports){ | |
'use strict'; | |
var anObject = _dereq_(36); | |
var sameValue = _dereq_(119); | |
var regExpExec = _dereq_(117); | |
// @@search logic | |
_dereq_(63)('search', 1, function (defined, SEARCH, $search, maybeCallNative) { | |
return [ | |
// `String.prototype.search` method | |
// https://tc39.github.io/ecma262/#sec-string.prototype.search | |
function search(regexp) { | |
var O = defined(this); | |
var fn = regexp == undefined ? undefined : regexp[SEARCH]; | |
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); | |
}, | |
// `RegExp.prototype[@@search]` method | |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search | |
function (regexp) { | |
var res = maybeCallNative($search, regexp, this); | |
if (res.done) return res.value; | |
var rx = anObject(regexp); | |
var S = String(this); | |
var previousLastIndex = rx.lastIndex; | |
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; | |
var result = regExpExec(rx, S); | |
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; | |
return result === null ? -1 : result.index; | |
} | |
]; | |
}); | |
},{"117":117,"119":119,"36":36,"63":63}],251:[function(_dereq_,module,exports){ | |
'use strict'; | |
var isRegExp = _dereq_(80); | |
var anObject = _dereq_(36); | |
var speciesConstructor = _dereq_(125); | |
var advanceStringIndex = _dereq_(34); | |
var toLength = _dereq_(139); | |
var callRegExpExec = _dereq_(117); | |
var regexpExec = _dereq_(118); | |
var fails = _dereq_(62); | |
var $min = Math.min; | |
var $push = [].push; | |
var $SPLIT = 'split'; | |
var LENGTH = 'length'; | |
var LAST_INDEX = 'lastIndex'; | |
var MAX_UINT32 = 0xffffffff; | |
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError | |
var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); }); | |
// @@split logic | |
_dereq_(63)('split', 2, function (defined, SPLIT, $split, maybeCallNative) { | |
var internalSplit; | |
if ( | |
'abbc'[$SPLIT](/(b)*/)[1] == 'c' || | |
'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || | |
'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || | |
'.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || | |
'.'[$SPLIT](/()()/)[LENGTH] > 1 || | |
''[$SPLIT](/.?/)[LENGTH] | |
) { | |
// based on es5-shim implementation, need to rework it | |
internalSplit = function (separator, limit) { | |
var string = String(this); | |
if (separator === undefined && limit === 0) return []; | |
// If `separator` is not a regex, use native split | |
if (!isRegExp(separator)) return $split.call(string, separator, limit); | |
var output = []; | |
var flags = (separator.ignoreCase ? 'i' : '') + | |
(separator.multiline ? 'm' : '') + | |
(separator.unicode ? 'u' : '') + | |
(separator.sticky ? 'y' : ''); | |
var lastLastIndex = 0; | |
var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; | |
// Make `global` and avoid `lastIndex` issues by working with a copy | |
var separatorCopy = new RegExp(separator.source, flags + 'g'); | |
var match, lastIndex, lastLength; | |
while (match = regexpExec.call(separatorCopy, string)) { | |
lastIndex = separatorCopy[LAST_INDEX]; | |
if (lastIndex > lastLastIndex) { | |
output.push(string.slice(lastLastIndex, match.index)); | |
if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); | |
lastLength = match[0][LENGTH]; | |
lastLastIndex = lastIndex; | |
if (output[LENGTH] >= splitLimit) break; | |
} | |
if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop | |
} | |
if (lastLastIndex === string[LENGTH]) { | |
if (lastLength || !separatorCopy.test('')) output.push(''); | |
} else output.push(string.slice(lastLastIndex)); | |
return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; | |
}; | |
// Chakra, V8 | |
} else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { | |
internalSplit = function (separator, limit) { | |
return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); | |
}; | |
} else { | |
internalSplit = $split; | |
} | |
return [ | |
// `String.prototype.split` method | |
// https://tc39.github.io/ecma262/#sec-string.prototype.split | |
function split(separator, limit) { | |
var O = defined(this); | |
var splitter = separator == undefined ? undefined : separator[SPLIT]; | |
return splitter !== undefined | |
? splitter.call(separator, O, limit) | |
: internalSplit.call(String(O), separator, limit); | |
}, | |
// `RegExp.prototype[@@split]` method | |
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split | |
// | |
// NOTE: This cannot be properly polyfilled in engines that don't support | |
// the 'y' flag. | |
function (regexp, limit) { | |
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); | |
if (res.done) return res.value; | |
var rx = anObject(regexp); | |
var S = String(this); | |
var C = speciesConstructor(rx, RegExp); | |
var unicodeMatching = rx.unicode; | |
var flags = (rx.ignoreCase ? 'i' : '') + | |
(rx.multiline ? 'm' : '') + | |
(rx.unicode ? 'u' : '') + | |
(SUPPORTS_Y ? 'y' : 'g'); | |
// ^(? + rx + ) is needed, in combination with some S slicing, to | |
// simulate the 'y' flag. | |
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); | |
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; | |
if (lim === 0) return []; | |
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; | |
var p = 0; | |
var q = 0; | |
var A = []; | |
while (q < S.length) { | |
splitter.lastIndex = SUPPORTS_Y ? q : 0; | |
var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); | |
var e; | |
if ( | |
z === null || | |
(e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p | |
) { | |
q = advanceStringIndex(S, q, unicodeMatching); | |
} else { | |
A.push(S.slice(p, q)); | |
if (A.length === lim) return A; | |
for (var i = 1; i <= z.length - 1; i++) { | |
A.push(z[i]); | |
if (A.length === lim) return A; | |
} | |
q = p = e; | |
} | |
} | |
A.push(S.slice(p)); | |
return A; | |
} | |
]; | |
}); | |
},{"117":117,"118":118,"125":125,"139":139,"34":34,"36":36,"62":62,"63":63,"80":80}],252:[function(_dereq_,module,exports){ | |
'use strict'; | |
_dereq_(247); | |
var anObject = _dereq_(36); | |
var $flags = _dereq_(64); | |
var DESCRIPTORS = _dereq_(56); | |
var TO_STRING = 'toString'; | |
var $toString = /./[TO_STRING]; | |
var define = function (fn) { | |
_dereq_(116)(RegExp.prototype, TO_STRING, fn, true); | |
}; | |
// 21.2.5.14 RegExp.prototype.toString() | |
if (_dereq_(62)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { | |
define(function toString() { | |
var R = anObject(this); | |
return '/'.concat(R.source, '/', | |
'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); | |
}); | |
// FF44- RegExp#toString has a wrong name | |
} else if ($toString.name != TO_STRING) { | |
define(function toString() { | |
return $toString.call(this); | |
}); | |
} | |
},{"116":116,"247":247,"36":36,"56":56,"62":62,"64":64}],253:[function(_dereq_,module,exports){ | |
'use strict'; | |
var strong = _dereq_(47); | |
var validate = _dereq_(147); | |
var SET = 'Set'; | |
// 23.2 Set Objects | |
module.exports = _dereq_(49)(SET, function (get) { | |
return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; | |
}, { | |
// 23.2.3.1 Set.prototype.add(value) | |
add: function add(value) { | |
return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); | |
} | |
}, strong); | |
},{"147":147,"47":47,"49":49}],254:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.2 String.prototype.anchor(name) | |
_dereq_(129)('anchor', function (createHTML) { | |
return function anchor(name) { | |
return createHTML(this, 'a', 'name', name); | |
}; | |
}); | |
},{"129":129}],255:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.3 String.prototype.big() | |
_dereq_(129)('big', function (createHTML) { | |
return function big() { | |
return createHTML(this, 'big', '', ''); | |
}; | |
}); | |
},{"129":129}],256:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.4 String.prototype.blink() | |
_dereq_(129)('blink', function (createHTML) { | |
return function blink() { | |
return createHTML(this, 'blink', '', ''); | |
}; | |
}); | |
},{"129":129}],257:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.5 String.prototype.bold() | |
_dereq_(129)('bold', function (createHTML) { | |
return function bold() { | |
return createHTML(this, 'b', '', ''); | |
}; | |
}); | |
},{"129":129}],258:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $at = _dereq_(127)(false); | |
$export($export.P, 'String', { | |
// 21.1.3.3 String.prototype.codePointAt(pos) | |
codePointAt: function codePointAt(pos) { | |
return $at(this, pos); | |
} | |
}); | |
},{"127":127,"60":60}],259:[function(_dereq_,module,exports){ | |
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) | |
'use strict'; | |
var $export = _dereq_(60); | |
var toLength = _dereq_(139); | |
var context = _dereq_(128); | |
var ENDS_WITH = 'endsWith'; | |
var $endsWith = ''[ENDS_WITH]; | |
$export($export.P + $export.F * _dereq_(61)(ENDS_WITH), 'String', { | |
endsWith: function endsWith(searchString /* , endPosition = @length */) { | |
var that = context(this, searchString, ENDS_WITH); | |
var endPosition = arguments.length > 1 ? arguments[1] : undefined; | |
var len = toLength(that.length); | |
var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); | |
var search = String(searchString); | |
return $endsWith | |
? $endsWith.call(that, search, end) | |
: that.slice(end - search.length, end) === search; | |
} | |
}); | |
},{"128":128,"139":139,"60":60,"61":61}],260:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.6 String.prototype.fixed() | |
_dereq_(129)('fixed', function (createHTML) { | |
return function fixed() { | |
return createHTML(this, 'tt', '', ''); | |
}; | |
}); | |
},{"129":129}],261:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.7 String.prototype.fontcolor(color) | |
_dereq_(129)('fontcolor', function (createHTML) { | |
return function fontcolor(color) { | |
return createHTML(this, 'font', 'color', color); | |
}; | |
}); | |
},{"129":129}],262:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.8 String.prototype.fontsize(size) | |
_dereq_(129)('fontsize', function (createHTML) { | |
return function fontsize(size) { | |
return createHTML(this, 'font', 'size', size); | |
}; | |
}); | |
},{"129":129}],263:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var toAbsoluteIndex = _dereq_(135); | |
var fromCharCode = String.fromCharCode; | |
var $fromCodePoint = String.fromCodePoint; | |
// length should be 1, old FF problem | |
$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { | |
// 21.1.2.2 String.fromCodePoint(...codePoints) | |
fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars | |
var res = []; | |
var aLen = arguments.length; | |
var i = 0; | |
var code; | |
while (aLen > i) { | |
code = +arguments[i++]; | |
if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); | |
res.push(code < 0x10000 | |
? fromCharCode(code) | |
: fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) | |
); | |
} return res.join(''); | |
} | |
}); | |
},{"135":135,"60":60}],264:[function(_dereq_,module,exports){ | |
// 21.1.3.7 String.prototype.includes(searchString, position = 0) | |
'use strict'; | |
var $export = _dereq_(60); | |
var context = _dereq_(128); | |
var INCLUDES = 'includes'; | |
$export($export.P + $export.F * _dereq_(61)(INCLUDES), 'String', { | |
includes: function includes(searchString /* , position = 0 */) { | |
return !!~context(this, searchString, INCLUDES) | |
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); | |
} | |
}); | |
},{"128":128,"60":60,"61":61}],265:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.9 String.prototype.italics() | |
_dereq_(129)('italics', function (createHTML) { | |
return function italics() { | |
return createHTML(this, 'i', '', ''); | |
}; | |
}); | |
},{"129":129}],266:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $at = _dereq_(127)(true); | |
// 21.1.3.27 String.prototype[@@iterator]() | |
_dereq_(83)(String, 'String', function (iterated) { | |
this._t = String(iterated); // target | |
this._i = 0; // next index | |
// 21.1.5.2.1 %StringIteratorPrototype%.next() | |
}, function () { | |
var O = this._t; | |
var index = this._i; | |
var point; | |
if (index >= O.length) return { value: undefined, done: true }; | |
point = $at(O, index); | |
this._i += point.length; | |
return { value: point, done: false }; | |
}); | |
},{"127":127,"83":83}],267:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.10 String.prototype.link(url) | |
_dereq_(129)('link', function (createHTML) { | |
return function link(url) { | |
return createHTML(this, 'a', 'href', url); | |
}; | |
}); | |
},{"129":129}],268:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var toIObject = _dereq_(138); | |
var toLength = _dereq_(139); | |
$export($export.S, 'String', { | |
// 21.1.2.4 String.raw(callSite, ...substitutions) | |
raw: function raw(callSite) { | |
var tpl = toIObject(callSite.raw); | |
var len = toLength(tpl.length); | |
var aLen = arguments.length; | |
var res = []; | |
var i = 0; | |
while (len > i) { | |
res.push(String(tpl[i++])); | |
if (i < aLen) res.push(String(arguments[i])); | |
} return res.join(''); | |
} | |
}); | |
},{"138":138,"139":139,"60":60}],269:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
$export($export.P, 'String', { | |
// 21.1.3.13 String.prototype.repeat(count) | |
repeat: _dereq_(131) | |
}); | |
},{"131":131,"60":60}],270:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.11 String.prototype.small() | |
_dereq_(129)('small', function (createHTML) { | |
return function small() { | |
return createHTML(this, 'small', '', ''); | |
}; | |
}); | |
},{"129":129}],271:[function(_dereq_,module,exports){ | |
// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) | |
'use strict'; | |
var $export = _dereq_(60); | |
var toLength = _dereq_(139); | |
var context = _dereq_(128); | |
var STARTS_WITH = 'startsWith'; | |
var $startsWith = ''[STARTS_WITH]; | |
$export($export.P + $export.F * _dereq_(61)(STARTS_WITH), 'String', { | |
startsWith: function startsWith(searchString /* , position = 0 */) { | |
var that = context(this, searchString, STARTS_WITH); | |
var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); | |
var search = String(searchString); | |
return $startsWith | |
? $startsWith.call(that, search, index) | |
: that.slice(index, index + search.length) === search; | |
} | |
}); | |
},{"128":128,"139":139,"60":60,"61":61}],272:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.12 String.prototype.strike() | |
_dereq_(129)('strike', function (createHTML) { | |
return function strike() { | |
return createHTML(this, 'strike', '', ''); | |
}; | |
}); | |
},{"129":129}],273:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.13 String.prototype.sub() | |
_dereq_(129)('sub', function (createHTML) { | |
return function sub() { | |
return createHTML(this, 'sub', '', ''); | |
}; | |
}); | |
},{"129":129}],274:[function(_dereq_,module,exports){ | |
'use strict'; | |
// B.2.3.14 String.prototype.sup() | |
_dereq_(129)('sup', function (createHTML) { | |
return function sup() { | |
return createHTML(this, 'sup', '', ''); | |
}; | |
}); | |
},{"129":129}],275:[function(_dereq_,module,exports){ | |
'use strict'; | |
// 21.1.3.25 String.prototype.trim() | |
_dereq_(132)('trim', function ($trim) { | |
return function trim() { | |
return $trim(this, 3); | |
}; | |
}); | |
},{"132":132}],276:[function(_dereq_,module,exports){ | |
'use strict'; | |
// ECMAScript 6 symbols shim | |
var global = _dereq_(68); | |
var has = _dereq_(69); | |
var DESCRIPTORS = _dereq_(56); | |
var $export = _dereq_(60); | |
var redefine = _dereq_(116); | |
var META = _dereq_(92).KEY; | |
var $fails = _dereq_(62); | |
var shared = _dereq_(124); | |
var setToStringTag = _dereq_(122); | |
var uid = _dereq_(145); | |
var wks = _dereq_(150); | |
var wksExt = _dereq_(149); | |
var wksDefine = _dereq_(148); | |
var enumKeys = _dereq_(59); | |
var isArray = _dereq_(77); | |
var anObject = _dereq_(36); | |
var isObject = _dereq_(79); | |
var toObject = _dereq_(140); | |
var toIObject = _dereq_(138); | |
var toPrimitive = _dereq_(141); | |
var createDesc = _dereq_(114); | |
var _create = _dereq_(96); | |
var gOPNExt = _dereq_(100); | |
var $GOPD = _dereq_(99); | |
var $GOPS = _dereq_(102); | |
var $DP = _dereq_(97); | |
var $keys = _dereq_(105); | |
var gOPD = $GOPD.f; | |
var dP = $DP.f; | |
var gOPN = gOPNExt.f; | |
var $Symbol = global.Symbol; | |
var $JSON = global.JSON; | |
var _stringify = $JSON && $JSON.stringify; | |
var PROTOTYPE = 'prototype'; | |
var HIDDEN = wks('_hidden'); | |
var TO_PRIMITIVE = wks('toPrimitive'); | |
var isEnum = {}.propertyIsEnumerable; | |
var SymbolRegistry = shared('symbol-registry'); | |
var AllSymbols = shared('symbols'); | |
var OPSymbols = shared('op-symbols'); | |
var ObjectProto = Object[PROTOTYPE]; | |
var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f; | |
var QObject = global.QObject; | |
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 | |
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; | |
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 | |
var setSymbolDesc = DESCRIPTORS && $fails(function () { | |
return _create(dP({}, 'a', { | |
get: function () { return dP(this, 'a', { value: 7 }).a; } | |
})).a != 7; | |
}) ? function (it, key, D) { | |
var protoDesc = gOPD(ObjectProto, key); | |
if (protoDesc) delete ObjectProto[key]; | |
dP(it, key, D); | |
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); | |
} : dP; | |
var wrap = function (tag) { | |
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); | |
sym._k = tag; | |
return sym; | |
}; | |
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { | |
return typeof it == 'symbol'; | |
} : function (it) { | |
return it instanceof $Symbol; | |
}; | |
var $defineProperty = function defineProperty(it, key, D) { | |
if (it === ObjectProto) $defineProperty(OPSymbols, key, D); | |
anObject(it); | |
key = toPrimitive(key, true); | |
anObject(D); | |
if (has(AllSymbols, key)) { | |
if (!D.enumerable) { | |
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); | |
it[HIDDEN][key] = true; | |
} else { | |
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; | |
D = _create(D, { enumerable: createDesc(0, false) }); | |
} return setSymbolDesc(it, key, D); | |
} return dP(it, key, D); | |
}; | |
var $defineProperties = function defineProperties(it, P) { | |
anObject(it); | |
var keys = enumKeys(P = toIObject(P)); | |
var i = 0; | |
var l = keys.length; | |
var key; | |
while (l > i) $defineProperty(it, key = keys[i++], P[key]); | |
return it; | |
}; | |
var $create = function create(it, P) { | |
return P === undefined ? _create(it) : $defineProperties(_create(it), P); | |
}; | |
var $propertyIsEnumerable = function propertyIsEnumerable(key) { | |
var E = isEnum.call(this, key = toPrimitive(key, true)); | |
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; | |
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; | |
}; | |
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { | |
it = toIObject(it); | |
key = toPrimitive(key, true); | |
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; | |
var D = gOPD(it, key); | |
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; | |
return D; | |
}; | |
var $getOwnPropertyNames = function getOwnPropertyNames(it) { | |
var names = gOPN(toIObject(it)); | |
var result = []; | |
var i = 0; | |
var key; | |
while (names.length > i) { | |
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); | |
} return result; | |
}; | |
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { | |
var IS_OP = it === ObjectProto; | |
var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); | |
var result = []; | |
var i = 0; | |
var key; | |
while (names.length > i) { | |
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); | |
} return result; | |
}; | |
// 19.4.1.1 Symbol([description]) | |
if (!USE_NATIVE) { | |
$Symbol = function Symbol() { | |
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); | |
var tag = uid(arguments.length > 0 ? arguments[0] : undefined); | |
var $set = function (value) { | |
if (this === ObjectProto) $set.call(OPSymbols, value); | |
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; | |
setSymbolDesc(this, tag, createDesc(1, value)); | |
}; | |
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); | |
return wrap(tag); | |
}; | |
redefine($Symbol[PROTOTYPE], 'toString', function toString() { | |
return this._k; | |
}); | |
$GOPD.f = $getOwnPropertyDescriptor; | |
$DP.f = $defineProperty; | |
_dereq_(101).f = gOPNExt.f = $getOwnPropertyNames; | |
_dereq_(106).f = $propertyIsEnumerable; | |
$GOPS.f = $getOwnPropertySymbols; | |
if (DESCRIPTORS && !_dereq_(87)) { | |
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); | |
} | |
wksExt.f = function (name) { | |
return wrap(wks(name)); | |
}; | |
} | |
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); | |
for (var es6Symbols = ( | |
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 | |
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' | |
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); | |
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); | |
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { | |
// 19.4.2.1 Symbol.for(key) | |
'for': function (key) { | |
return has(SymbolRegistry, key += '') | |
? SymbolRegistry[key] | |
: SymbolRegistry[key] = $Symbol(key); | |
}, | |
// 19.4.2.5 Symbol.keyFor(sym) | |
keyFor: function keyFor(sym) { | |
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); | |
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; | |
}, | |
useSetter: function () { setter = true; }, | |
useSimple: function () { setter = false; } | |
}); | |
$export($export.S + $export.F * !USE_NATIVE, 'Object', { | |
// 19.1.2.2 Object.create(O [, Properties]) | |
create: $create, | |
// 19.1.2.4 Object.defineProperty(O, P, Attributes) | |
defineProperty: $defineProperty, | |
// 19.1.2.3 Object.defineProperties(O, Properties) | |
defineProperties: $defineProperties, | |
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) | |
getOwnPropertyDescriptor: $getOwnPropertyDescriptor, | |
// 19.1.2.7 Object.getOwnPropertyNames(O) | |
getOwnPropertyNames: $getOwnPropertyNames, | |
// 19.1.2.8 Object.getOwnPropertySymbols(O) | |
getOwnPropertySymbols: $getOwnPropertySymbols | |
}); | |
// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives | |
// https://bugs.chromium.org/p/v8/issues/detail?id=3443 | |
var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); }); | |
$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', { | |
getOwnPropertySymbols: function getOwnPropertySymbols(it) { | |
return $GOPS.f(toObject(it)); | |
} | |
}); | |
// 24.3.2 JSON.stringify(value [, replacer [, space]]) | |
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { | |
var S = $Symbol(); | |
// MS Edge converts symbol values to JSON as {} | |
// WebKit converts symbol values to JSON as null | |
// V8 throws on boxed symbols | |
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; | |
})), 'JSON', { | |
stringify: function stringify(it) { | |
var args = [it]; | |
var i = 1; | |
var replacer, $replacer; | |
while (arguments.length > i) args.push(arguments[i++]); | |
$replacer = replacer = args[1]; | |
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined | |
if (!isArray(replacer)) replacer = function (key, value) { | |
if (typeof $replacer == 'function') value = $replacer.call(this, key, value); | |
if (!isSymbol(value)) return value; | |
}; | |
args[1] = replacer; | |
return _stringify.apply($JSON, args); | |
} | |
}); | |
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) | |
$Symbol[PROTOTYPE][TO_PRIMITIVE] || _dereq_(70)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); | |
// 19.4.3.5 Symbol.prototype[@@toStringTag] | |
setToStringTag($Symbol, 'Symbol'); | |
// 20.2.1.9 Math[@@toStringTag] | |
setToStringTag(Math, 'Math', true); | |
// 24.3.3 JSON[@@toStringTag] | |
setToStringTag(global.JSON, 'JSON', true); | |
},{"100":100,"101":101,"102":102,"105":105,"106":106,"114":114,"116":116,"122":122,"124":124,"138":138,"140":140,"141":141,"145":145,"148":148,"149":149,"150":150,"36":36,"56":56,"59":59,"60":60,"62":62,"68":68,"69":69,"70":70,"77":77,"79":79,"87":87,"92":92,"96":96,"97":97,"99":99}],277:[function(_dereq_,module,exports){ | |
'use strict'; | |
var $export = _dereq_(60); | |
var $typed = _dereq_(144); | |
var buffer = _dereq_(143); | |
var anObject = _dereq_(36); | |
var toAbsoluteIndex = _dereq_(135); | |
var toLength = _dereq_(139); | |
var isObject = _dereq_(79); | |
var ArrayBuffer = _dereq_(68).ArrayBuffer; | |
var speciesConstructor = _dereq_(125); | |
var $ArrayBuffer = buffer.ArrayBuffer; | |
var $DataView = buffer.DataView; | |
var $isView = $typed.ABV && ArrayBuffer.isView; | |
var $slice = $ArrayBuffer.prototype.slice; | |
var VIEW = $typed.VIEW; | |
var ARRAY_BUFFER = 'ArrayBuffer'; | |
$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); | |
$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { | |
// 24.1.3.1 ArrayBuffer.isView(arg) | |
isView: function isView(it) { | |
return $isView && $isView(it) || isObject(it) && VIEW in it; | |
} | |
}); | |
$export($export.P + $export.U + $export.F * _dereq_(62)(function () { | |
return !new $ArrayBuffer(2).slice(1, undefined).byteLength; | |
}), ARRAY_BUFFER, { | |
// 24.1.4.3 ArrayBuffer.prototype.slice(start, end) | |
slice: function slice(start, end) { | |
if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix | |
var len = anObject(this).byteLength; | |
var first = toAbsoluteIndex(start, len); | |
var fin = toAbsoluteIndex(end === undefined ? len : end, len); | |
var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); | |
var viewS = new $DataView(this); | |
var viewT = new $DataView(result); | |
var index = 0; | |
while (first < fin) { | |
viewT.setUint8(index++, viewS.getUint8(first++)); | |
} return result; | |
} | |
}); | |
_dereq_(121)(ARRAY_BUFFER); | |
},{"121":121,"125":125,"135":135,"139":139,"143":143,"144":144,"36":36,"60":60,"62":62,"68":68,"79":79}],278:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
$export($export.G + $export.W + $export.F * !_dereq_(144).ABV, { | |
DataView: _dereq_(143).DataView | |
}); | |
},{"143":143,"144":144,"60":60}],279:[function(_dereq_,module,exports){ | |
_dereq_(142)('Float32', 4, function (init) { | |
return function Float32Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],280:[function(_dereq_,module,exports){ | |
_dereq_(142)('Float64', 8, function (init) { | |
return function Float64Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],281:[function(_dereq_,module,exports){ | |
_dereq_(142)('Int16', 2, function (init) { | |
return function Int16Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],282:[function(_dereq_,module,exports){ | |
_dereq_(142)('Int32', 4, function (init) { | |
return function Int32Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],283:[function(_dereq_,module,exports){ | |
_dereq_(142)('Int8', 1, function (init) { | |
return function Int8Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],284:[function(_dereq_,module,exports){ | |
_dereq_(142)('Uint16', 2, function (init) { | |
return function Uint16Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],285:[function(_dereq_,module,exports){ | |
_dereq_(142)('Uint32', 4, function (init) { | |
return function Uint32Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],286:[function(_dereq_,module,exports){ | |
_dereq_(142)('Uint8', 1, function (init) { | |
return function Uint8Array(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}); | |
},{"142":142}],287:[function(_dereq_,module,exports){ | |
_dereq_(142)('Uint8', 1, function (init) { | |
return function Uint8ClampedArray(data, byteOffset, length) { | |
return init(this, data, byteOffset, length); | |
}; | |
}, true); | |
},{"142":142}],288:[function(_dereq_,module,exports){ | |
'use strict'; | |
var global = _dereq_(68); | |
var each = _dereq_(40)(0); | |
var redefine = _dereq_(116); | |
var meta = _dereq_(92); | |
var assign = _dereq_(95); | |
var weak = _dereq_(48); | |
var isObject = _dereq_(79); | |
var validate = _dereq_(147); | |
var NATIVE_WEAK_MAP = _dereq_(147); | |
var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; | |
var WEAK_MAP = 'WeakMap'; | |
var getWeak = meta.getWeak; | |
var isExtensible = Object.isExtensible; | |
var uncaughtFrozenStore = weak.ufstore; | |
var InternalMap; | |
var wrapper = function (get) { | |
return function WeakMap() { | |
return get(this, arguments.length > 0 ? arguments[0] : undefined); | |
}; | |
}; | |
var methods = { | |
// 23.3.3.3 WeakMap.prototype.get(key) | |
get: function get(key) { | |
if (isObject(key)) { | |
var data = getWeak(key); | |
if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); | |
return data ? data[this._i] : undefined; | |
} | |
}, | |
// 23.3.3.5 WeakMap.prototype.set(key, value) | |
set: function set(key, value) { | |
return weak.def(validate(this, WEAK_MAP), key, value); | |
} | |
}; | |
// 23.3 WeakMap Objects | |
var $WeakMap = module.exports = _dereq_(49)(WEAK_MAP, wrapper, methods, weak, true, true); | |
// IE11 WeakMap frozen keys fix | |
if (NATIVE_WEAK_MAP && IS_IE11) { | |
InternalMap = weak.getConstructor(wrapper, WEAK_MAP); | |
assign(InternalMap.prototype, methods); | |
meta.NEED = true; | |
each(['delete', 'has', 'get', 'set'], function (key) { | |
var proto = $WeakMap.prototype; | |
var method = proto[key]; | |
redefine(proto, key, function (a, b) { | |
// store frozen objects on internal weakmap shim | |
if (isObject(a) && !isExtensible(a)) { | |
if (!this._f) this._f = new InternalMap(); | |
var result = this._f[key](a, b); | |
return key == 'set' ? this : result; | |
// store all the rest on native weakmap | |
} return method.call(this, a, b); | |
}); | |
}); | |
} | |
},{"116":116,"147":147,"40":40,"48":48,"49":49,"68":68,"79":79,"92":92,"95":95}],289:[function(_dereq_,module,exports){ | |
'use strict'; | |
var weak = _dereq_(48); | |
var validate = _dereq_(147); | |
var WEAK_SET = 'WeakSet'; | |
// 23.4 WeakSet Objects | |
_dereq_(49)(WEAK_SET, function (get) { | |
return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; | |
}, { | |
// 23.4.3.1 WeakSet.prototype.add(value) | |
add: function add(value) { | |
return weak.def(validate(this, WEAK_SET), value, true); | |
} | |
}, weak, false, true); | |
},{"147":147,"48":48,"49":49}],290:[function(_dereq_,module,exports){ | |
'use strict'; | |
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap | |
var $export = _dereq_(60); | |
var flattenIntoArray = _dereq_(65); | |
var toObject = _dereq_(140); | |
var toLength = _dereq_(139); | |
var aFunction = _dereq_(31); | |
var arraySpeciesCreate = _dereq_(43); | |
$export($export.P, 'Array', { | |
flatMap: function flatMap(callbackfn /* , thisArg */) { | |
var O = toObject(this); | |
var sourceLen, A; | |
aFunction(callbackfn); | |
sourceLen = toLength(O.length); | |
A = arraySpeciesCreate(O, 0); | |
flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); | |
return A; | |
} | |
}); | |
_dereq_(33)('flatMap'); | |
},{"139":139,"140":140,"31":31,"33":33,"43":43,"60":60,"65":65}],291:[function(_dereq_,module,exports){ | |
'use strict'; | |
// https://github.com/tc39/Array.prototype.includes | |
var $export = _dereq_(60); | |
var $includes = _dereq_(39)(true); | |
$export($export.P, 'Array', { | |
includes: function includes(el /* , fromIndex = 0 */) { | |
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); | |
} | |
}); | |
_dereq_(33)('includes'); | |
},{"33":33,"39":39,"60":60}],292:[function(_dereq_,module,exports){ | |
// https://github.com/tc39/proposal-object-values-entries | |
var $export = _dereq_(60); | |
var $entries = _dereq_(108)(true); | |
$export($export.S, 'Object', { | |
entries: function entries(it) { | |
return $entries(it); | |
} | |
}); | |
},{"108":108,"60":60}],293:[function(_dereq_,module,exports){ | |
// https://github.com/tc39/proposal-object-getownpropertydescriptors | |
var $export = _dereq_(60); | |
var ownKeys = _dereq_(109); | |
var toIObject = _dereq_(138); | |
var gOPD = _dereq_(99); | |
var createProperty = _dereq_(51); | |
$export($export.S, 'Object', { | |
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { | |
var O = toIObject(object); | |
var getDesc = gOPD.f; | |
var keys = ownKeys(O); | |
var result = {}; | |
var i = 0; | |
var key, desc; | |
while (keys.length > i) { | |
desc = getDesc(O, key = keys[i++]); | |
if (desc !== undefined) createProperty(result, key, desc); | |
} | |
return result; | |
} | |
}); | |
},{"109":109,"138":138,"51":51,"60":60,"99":99}],294:[function(_dereq_,module,exports){ | |
// https://github.com/tc39/proposal-object-values-entries | |
var $export = _dereq_(60); | |
var $values = _dereq_(108)(false); | |
$export($export.S, 'Object', { | |
values: function values(it) { | |
return $values(it); | |
} | |
}); | |
},{"108":108,"60":60}],295:[function(_dereq_,module,exports){ | |
// https://github.com/tc39/proposal-promise-finally | |
'use strict'; | |
var $export = _dereq_(60); | |
var core = _dereq_(50); | |
var global = _dereq_(68); | |
var speciesConstructor = _dereq_(125); | |
var promiseResolve = _dereq_(113); | |
$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { | |
var C = speciesConstructor(this, core.Promise || global.Promise); | |
var isFunction = typeof onFinally == 'function'; | |
return this.then( | |
isFunction ? function (x) { | |
return promiseResolve(C, onFinally()).then(function () { return x; }); | |
} : onFinally, | |
isFunction ? function (e) { | |
return promiseResolve(C, onFinally()).then(function () { throw e; }); | |
} : onFinally | |
); | |
} }); | |
},{"113":113,"125":125,"50":50,"60":60,"68":68}],296:[function(_dereq_,module,exports){ | |
'use strict'; | |
// https://github.com/tc39/proposal-string-pad-start-end | |
var $export = _dereq_(60); | |
var $pad = _dereq_(130); | |
var userAgent = _dereq_(146); | |
// https://github.com/zloirock/core-js/issues/280 | |
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); | |
$export($export.P + $export.F * WEBKIT_BUG, 'String', { | |
padEnd: function padEnd(maxLength /* , fillString = ' ' */) { | |
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); | |
} | |
}); | |
},{"130":130,"146":146,"60":60}],297:[function(_dereq_,module,exports){ | |
'use strict'; | |
// https://github.com/tc39/proposal-string-pad-start-end | |
var $export = _dereq_(60); | |
var $pad = _dereq_(130); | |
var userAgent = _dereq_(146); | |
// https://github.com/zloirock/core-js/issues/280 | |
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent); | |
$export($export.P + $export.F * WEBKIT_BUG, 'String', { | |
padStart: function padStart(maxLength /* , fillString = ' ' */) { | |
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); | |
} | |
}); | |
},{"130":130,"146":146,"60":60}],298:[function(_dereq_,module,exports){ | |
'use strict'; | |
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim | |
_dereq_(132)('trimLeft', function ($trim) { | |
return function trimLeft() { | |
return $trim(this, 1); | |
}; | |
}, 'trimStart'); | |
},{"132":132}],299:[function(_dereq_,module,exports){ | |
'use strict'; | |
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim | |
_dereq_(132)('trimRight', function ($trim) { | |
return function trimRight() { | |
return $trim(this, 2); | |
}; | |
}, 'trimEnd'); | |
},{"132":132}],300:[function(_dereq_,module,exports){ | |
_dereq_(148)('asyncIterator'); | |
},{"148":148}],301:[function(_dereq_,module,exports){ | |
var $iterators = _dereq_(162); | |
var getKeys = _dereq_(105); | |
var redefine = _dereq_(116); | |
var global = _dereq_(68); | |
var hide = _dereq_(70); | |
var Iterators = _dereq_(86); | |
var wks = _dereq_(150); | |
var ITERATOR = wks('iterator'); | |
var TO_STRING_TAG = wks('toStringTag'); | |
var ArrayValues = Iterators.Array; | |
var DOMIterables = { | |
CSSRuleList: true, // TODO: Not spec compliant, should be false. | |
CSSStyleDeclaration: false, | |
CSSValueList: false, | |
ClientRectList: false, | |
DOMRectList: false, | |
DOMStringList: false, | |
DOMTokenList: true, | |
DataTransferItemList: false, | |
FileList: false, | |
HTMLAllCollection: false, | |
HTMLCollection: false, | |
HTMLFormElement: false, | |
HTMLSelectElement: false, | |
MediaList: true, // TODO: Not spec compliant, should be false. | |
MimeTypeArray: false, | |
NamedNodeMap: false, | |
NodeList: true, | |
PaintRequestList: false, | |
Plugin: false, | |
PluginArray: false, | |
SVGLengthList: false, | |
SVGNumberList: false, | |
SVGPathSegList: false, | |
SVGPointList: false, | |
SVGStringList: false, | |
SVGTransformList: false, | |
SourceBufferList: false, | |
StyleSheetList: true, // TODO: Not spec compliant, should be false. | |
TextTrackCueList: false, | |
TextTrackList: false, | |
TouchList: false | |
}; | |
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { | |
var NAME = collections[i]; | |
var explicit = DOMIterables[NAME]; | |
var Collection = global[NAME]; | |
var proto = Collection && Collection.prototype; | |
var key; | |
if (proto) { | |
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); | |
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); | |
Iterators[NAME] = ArrayValues; | |
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); | |
} | |
} | |
},{"105":105,"116":116,"150":150,"162":162,"68":68,"70":70,"86":86}],302:[function(_dereq_,module,exports){ | |
var $export = _dereq_(60); | |
var $task = _dereq_(134); | |
$export($export.G + $export.B, { | |
setImmediate: $task.set, | |
clearImmediate: $task.clear | |
}); | |
},{"134":134,"60":60}],303:[function(_dereq_,module,exports){ | |
// ie9- setTimeout & setInterval additional parameters fix | |
var global = _dereq_(68); | |
var $export = _dereq_(60); | |
var userAgent = _dereq_(146); | |
var slice = [].slice; | |
var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check | |
var wrap = function (set) { | |
return function (fn, time /* , ...args */) { | |
var boundArgs = arguments.length > 2; | |
var args = boundArgs ? slice.call(arguments, 2) : false; | |
return set(boundArgs ? function () { | |
// eslint-disable-next-line no-new-func | |
(typeof fn == 'function' ? fn : Function(fn)).apply(this, args); | |
} : fn, time); | |
}; | |
}; | |
$export($export.G + $export.B + $export.F * MSIE, { | |
setTimeout: wrap(global.setTimeout), | |
setInterval: wrap(global.setInterval) | |
}); | |
},{"146":146,"60":60,"68":68}],304:[function(_dereq_,module,exports){ | |
_dereq_(303); | |
_dereq_(302); | |
_dereq_(301); | |
module.exports = _dereq_(50); | |
},{"301":301,"302":302,"303":303,"50":50}],305:[function(_dereq_,module,exports){ | |
/** | |
* Copyright (c) 2014-present, Facebook, Inc. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
*/ | |
var runtime = (function (exports) { | |
"use strict"; | |
var Op = Object.prototype; | |
var hasOwn = Op.hasOwnProperty; | |
var undefined; // More compressible than void 0. | |
var $Symbol = typeof Symbol === "function" ? Symbol : {}; | |
var iteratorSymbol = $Symbol.iterator || "@@iterator"; | |
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; | |
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; | |
function wrap(innerFn, outerFn, self, tryLocsList) { | |
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. | |
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; | |
var generator = Object.create(protoGenerator.prototype); | |
var context = new Context(tryLocsList || []); | |
// The ._invoke method unifies the implementations of the .next, | |
// .throw, and .return methods. | |
generator._invoke = makeInvokeMethod(innerFn, self, context); | |
return generator; | |
} | |
exports.wrap = wrap; | |
// Try/catch helper to minimize deoptimizations. Returns a completion | |
// record like context.tryEntries[i].completion. This interface could | |
// have been (and was previously) designed to take a closure to be | |
// invoked without arguments, but in all the cases we care about we | |
// already have an existing method we want to call, so there's no need | |
// to create a new function object. We can even get away with assuming | |
// the method takes exactly one argument, since that happens to be true | |
// in every case, so we don't have to touch the arguments object. The | |
// only additional allocation required is the completion record, which | |
// has a stable shape and so hopefully should be cheap to allocate. | |
function tryCatch(fn, obj, arg) { | |
try { | |
return { type: "normal", arg: fn.call(obj, arg) }; | |
} catch (err) { | |
return { type: "throw", arg: err }; | |
} | |
} | |
var GenStateSuspendedStart = "suspendedStart"; | |
var GenStateSuspendedYield = "suspendedYield"; | |
var GenStateExecuting = "executing"; | |
var GenStateCompleted = "completed"; | |
// Returning this object from the innerFn has the same effect as | |
// breaking out of the dispatch switch statement. | |
var ContinueSentinel = {}; | |
// Dummy constructor functions that we use as the .constructor and | |
// .constructor.prototype properties for functions that return Generator | |
// objects. For full spec compliance, you may wish to configure your | |
// minifier not to mangle the names of these two functions. | |
function Generator() {} | |
function GeneratorFunction() {} | |
function GeneratorFunctionPrototype() {} | |
// This is a polyfill for %IteratorPrototype% for environments that | |
// don't natively support it. | |
var IteratorPrototype = {}; | |
IteratorPrototype[iteratorSymbol] = function () { | |
return this; | |
}; | |
var getProto = Object.getPrototypeOf; | |
var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); | |
if (NativeIteratorPrototype && | |
NativeIteratorPrototype !== Op && | |
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { | |
// This environment has a native %IteratorPrototype%; use it instead | |
// of the polyfill. | |
IteratorPrototype = NativeIteratorPrototype; | |
} | |
var Gp = GeneratorFunctionPrototype.prototype = | |
Generator.prototype = Object.create(IteratorPrototype); | |
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; | |
GeneratorFunctionPrototype.constructor = GeneratorFunction; | |
GeneratorFunctionPrototype[toStringTagSymbol] = | |
GeneratorFunction.displayName = "GeneratorFunction"; | |
// Helper for defining the .next, .throw, and .return methods of the | |
// Iterator interface in terms of a single ._invoke method. | |
function defineIteratorMethods(prototype) { | |
["next", "throw", "return"].forEach(function(method) { | |
prototype[method] = function(arg) { | |
return this._invoke(method, arg); | |
}; | |
}); | |
} | |
exports.isGeneratorFunction = function(genFun) { | |
var ctor = typeof genFun === "function" && genFun.constructor; | |
return ctor | |
? ctor === GeneratorFunction || | |
// For the native GeneratorFunction constructor, the best we can | |
// do is to check its .name property. | |
(ctor.displayName || ctor.name) === "GeneratorFunction" | |
: false; | |
}; | |
exports.mark = function(genFun) { | |
if (Object.setPrototypeOf) { | |
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); | |
} else { | |
genFun.__proto__ = GeneratorFunctionPrototype; | |
if (!(toStringTagSymbol in genFun)) { | |
genFun[toStringTagSymbol] = "GeneratorFunction"; | |
} | |
} | |
genFun.prototype = Object.create(Gp); | |
return genFun; | |
}; | |
// Within the body of any async function, `await x` is transformed to | |
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test | |
// `hasOwn.call(value, "__await")` to determine if the yielded value is | |
// meant to be awaited. | |
exports.awrap = function(arg) { | |
return { __await: arg }; | |
}; | |
function AsyncIterator(generator, PromiseImpl) { | |
function invoke(method, arg, resolve, reject) { | |
var record = tryCatch(generator[method], generator, arg); | |
if (record.type === "throw") { | |
reject(record.arg); | |
} else { | |
var result = record.arg; | |
var value = result.value; | |
if (value && | |
typeof value === "object" && | |
hasOwn.call(value, "__await")) { | |
return PromiseImpl.resolve(value.__await).then(function(value) { | |
invoke("next", value, resolve, reject); | |
}, function(err) { | |
invoke("throw", err, resolve, reject); | |
}); | |
} | |
return PromiseImpl.resolve(value).then(function(unwrapped) { | |
// When a yielded Promise is resolved, its final value becomes | |
// the .value of the Promise<{value,done}> result for the | |
// current iteration. | |
result.value = unwrapped; | |
resolve(result); | |
}, function(error) { | |
// If a rejected Promise was yielded, throw the rejection back | |
// into the async generator function so it can be handled there. | |
return invoke("throw", error, resolve, reject); | |
}); | |
} | |
} | |
var previousPromise; | |
function enqueue(method, arg) { | |
function callInvokeWithMethodAndArg() { | |
return new PromiseImpl(function(resolve, reject) { | |
invoke(method, arg, resolve, reject); | |
}); | |
} | |
return previousPromise = | |
// If enqueue has been called before, then we want to wait until | |
// all previous Promises have been resolved before calling invoke, | |
// so that results are always delivered in the correct order. If | |
// enqueue has not been called before, then it is important to | |
// call invoke immediately, without waiting on a callback to fire, | |
// so that the async generator function has the opportunity to do | |
// any necessary setup in a predictable way. This predictability | |
// is why the Promise constructor synchronously invokes its | |
// executor callback, and why async functions synchronously | |
// execute code before the first await. Since we implement simple | |
// async functions in terms of async generators, it is especially | |
// important to get this right, even though it requires care. | |
previousPromise ? previousPromise.then( | |
callInvokeWithMethodAndArg, | |
// Avoid propagating failures to Promises returned by later | |
// invocations of the iterator. | |
callInvokeWithMethodAndArg | |
) : callInvokeWithMethodAndArg(); | |
} | |
// Define the unified helper method that is used to implement .next, | |
// .throw, and .return (see defineIteratorMethods). | |
this._invoke = enqueue; | |
} | |
defineIteratorMethods(AsyncIterator.prototype); | |
AsyncIterator.prototype[asyncIteratorSymbol] = function () { | |
return this; | |
}; | |
exports.AsyncIterator = AsyncIterator; | |
// Note that simple async functions are implemented on top of | |
// AsyncIterator objects; they just return a Promise for the value of | |
// the final result produced by the iterator. | |
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { | |
if (PromiseImpl === void 0) PromiseImpl = Promise; | |
var iter = new AsyncIterator( | |
wrap(innerFn, outerFn, self, tryLocsList), | |
PromiseImpl | |
); | |
return exports.isGeneratorFunction(outerFn) | |
? iter // If outerFn is a generator, return the full iterator. | |
: iter.next().then(function(result) { | |
return result.done ? result.value : iter.next(); | |
}); | |
}; | |
function makeInvokeMethod(innerFn, self, context) { | |
var state = GenStateSuspendedStart; | |
return function invoke(method, arg) { | |
if (state === GenStateExecuting) { | |
throw new Error("Generator is already running"); | |
} | |
if (state === GenStateCompleted) { | |
if (method === "throw") { | |
throw arg; | |
} | |
// Be forgiving, per 25.3.3.3.3 of the spec: | |
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume | |
return doneResult(); | |
} | |
context.method = method; | |
context.arg = arg; | |
while (true) { | |
var delegate = context.delegate; | |
if (delegate) { | |
var delegateResult = maybeInvokeDelegate(delegate, context); | |
if (delegateResult) { | |
if (delegateResult === ContinueSentinel) continue; | |
return delegateResult; | |
} | |
} | |
if (context.method === "next") { | |
// Setting context._sent for legacy support of Babel's | |
// function.sent implementation. | |
context.sent = context._sent = context.arg; | |
} else if (context.method === "throw") { | |
if (state === GenStateSuspendedStart) { | |
state = GenStateCompleted; | |
throw context.arg; | |
} | |
context.dispatchException(context.arg); | |
} else if (context.method === "return") { | |
context.abrupt("return", context.arg); | |
} | |
state = GenStateExecuting; | |
var record = tryCatch(innerFn, self, context); | |
if (record.type === "normal") { | |
// If an exception is thrown from innerFn, we leave state === | |
// GenStateExecuting and loop back for another invocation. | |
state = context.done | |
? GenStateCompleted | |
: GenStateSuspendedYield; | |
if (record.arg === ContinueSentinel) { | |
continue; | |
} | |
return { | |
value: record.arg, | |
done: context.done | |
}; | |
} else if (record.type === "throw") { | |
state = GenStateCompleted; | |
// Dispatch the exception by looping back around to the | |
// context.dispatchException(context.arg) call above. | |
context.method = "throw"; | |
context.arg = record.arg; | |
} | |
} | |
}; | |
} | |
// Call delegate.iterator[context.method](context.arg) and handle the | |
// result, either by returning a { value, done } result from the | |
// delegate iterator, or by modifying context.method and context.arg, | |
// setting context.delegate to null, and returning the ContinueSentinel. | |
function maybeInvokeDelegate(delegate, context) { | |
var method = delegate.iterator[context.method]; | |
if (method === undefined) { | |
// A .throw or .return when the delegate iterator has no .throw | |
// method always terminates the yield* loop. | |
context.delegate = null; | |
if (context.method === "throw") { | |
// Note: ["return"] must be used for ES3 parsing compatibility. | |
if (delegate.iterator["return"]) { | |
// If the delegate iterator has a return method, give it a | |
// chance to clean up. | |
context.method = "return"; | |
context.arg = undefined; | |
maybeInvokeDelegate(delegate, context); | |
if (context.method === "throw") { | |
// If maybeInvokeDelegate(context) changed context.method from | |
// "return" to "throw", let that override the TypeError below. | |
return ContinueSentinel; | |
} | |
} | |
context.method = "throw"; | |
context.arg = new TypeError( | |
"The iterator does not provide a 'throw' method"); | |
} | |
return ContinueSentinel; | |
} | |
var record = tryCatch(method, delegate.iterator, context.arg); | |
if (record.type === "throw") { | |
context.method = "throw"; | |
context.arg = record.arg; | |
context.delegate = null; | |
return ContinueSentinel; | |
} | |
var info = record.arg; | |
if (! info) { | |
context.method = "throw"; | |
context.arg = new TypeError("iterator result is not an object"); | |
context.delegate = null; | |
return ContinueSentinel; | |
} | |
if (info.done) { | |
// Assign the result of the finished delegate to the temporary | |
// variable specified by delegate.resultName (see delegateYield). | |
context[delegate.resultName] = info.value; | |
// Resume execution at the desired location (see delegateYield). | |
context.next = delegate.nextLoc; | |
// If context.method was "throw" but the delegate handled the | |
// exception, let the outer generator proceed normally. If | |
// context.method was "next", forget context.arg since it has been | |
// "consumed" by the delegate iterator. If context.method was | |
// "return", allow the original .return call to continue in the | |
// outer generator. | |
if (context.method !== "return") { | |
context.method = "next"; | |
context.arg = undefined; | |
} | |
} else { | |
// Re-yield the result returned by the delegate method. | |
return info; | |
} | |
// The delegate iterator is finished, so forget it and continue with | |
// the outer generator. | |
context.delegate = null; | |
return ContinueSentinel; | |
} | |
// Define Generator.prototype.{next,throw,return} in terms of the | |
// unified ._invoke helper method. | |
defineIteratorMethods(Gp); | |
Gp[toStringTagSymbol] = "Generator"; | |
// A Generator should always return itself as the iterator object when the | |
// @@iterator function is called on it. Some browsers' implementations of the | |
// iterator prototype chain incorrectly implement this, causing the Generator | |
// object to not be returned from this call. This ensures that doesn't happen. | |
// See https://github.com/facebook/regenerator/issues/274 for more details. | |
Gp[iteratorSymbol] = function() { | |
return this; | |
}; | |
Gp.toString = function() { | |
return "[object Generator]"; | |
}; | |
function pushTryEntry(locs) { | |
var entry = { tryLoc: locs[0] }; | |
if (1 in locs) { | |
entry.catchLoc = locs[1]; | |
} | |
if (2 in locs) { | |
entry.finallyLoc = locs[2]; | |
entry.afterLoc = locs[3]; | |
} | |
this.tryEntries.push(entry); | |
} | |
function resetTryEntry(entry) { | |
var record = entry.completion || {}; | |
record.type = "normal"; | |
delete record.arg; | |
entry.completion = record; | |
} | |
function Context(tryLocsList) { | |
// The root entry object (effectively a try statement without a catch | |
// or a finally block) gives us a place to store values thrown from | |
// locations where there is no enclosing try statement. | |
this.tryEntries = [{ tryLoc: "root" }]; | |
tryLocsList.forEach(pushTryEntry, this); | |
this.reset(true); | |
} | |
exports.keys = function(object) { | |
var keys = []; | |
for (var key in object) { | |
keys.push(key); | |
} | |
keys.reverse(); | |
// Rather than returning an object with a next method, we keep | |
// things simple and return the next function itself. | |
return function next() { | |
while (keys.length) { | |
var key = keys.pop(); | |
if (key in object) { | |
next.value = key; | |
next.done = false; | |
return next; | |
} | |
} | |
// To avoid creating an additional object, we just hang the .value | |
// and .done properties off the next function object itself. This | |
// also ensures that the minifier will not anonymize the function. | |
next.done = true; | |
return next; | |
}; | |
}; | |
function values(iterable) { | |
if (iterable) { | |
var iteratorMethod = iterable[iteratorSymbol]; | |
if (iteratorMethod) { | |
return iteratorMethod.call(iterable); | |
} | |
if (typeof iterable.next === "function") { | |
return iterable; | |
} | |
if (!isNaN(iterable.length)) { | |
var i = -1, next = function next() { | |
while (++i < iterable.length) { | |
if (hasOwn.call(iterable, i)) { | |
next.value = iterable[i]; | |
next.done = false; | |
return next; | |
} | |
} | |
next.value = undefined; | |
next.done = true; | |
return next; | |
}; | |
return next.next = next; | |
} | |
} | |
// Return an iterator with no values. | |
return { next: doneResult }; | |
} | |
exports.values = values; | |
function doneResult() { | |
return { value: undefined, done: true }; | |
} | |
Context.prototype = { | |
constructor: Context, | |
reset: function(skipTempReset) { | |
this.prev = 0; | |
this.next = 0; | |
// Resetting context._sent for legacy support of Babel's | |
// function.sent implementation. | |
this.sent = this._sent = undefined; | |
this.done = false; | |
this.delegate = null; | |
this.method = "next"; | |
this.arg = undefined; | |
this.tryEntries.forEach(resetTryEntry); | |
if (!skipTempReset) { | |
for (var name in this) { | |
// Not sure about the optimal order of these conditions: | |
if (name.charAt(0) === "t" && | |
hasOwn.call(this, name) && | |
!isNaN(+name.slice(1))) { | |
this[name] = undefined; | |
} | |
} | |
} | |
}, | |
stop: function() { | |
this.done = true; | |
var rootEntry = this.tryEntries[0]; | |
var rootRecord = rootEntry.completion; | |
if (rootRecord.type === "throw") { | |
throw rootRecord.arg; | |
} | |
return this.rval; | |
}, | |
dispatchException: function(exception) { | |
if (this.done) { | |
throw exception; | |
} | |
var context = this; | |
function handle(loc, caught) { | |
record.type = "throw"; | |
record.arg = exception; | |
context.next = loc; | |
if (caught) { | |
// If the dispatched exception was caught by a catch block, | |
// then let that catch block handle the exception normally. | |
context.method = "next"; | |
context.arg = undefined; | |
} | |
return !! caught; | |
} | |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
var entry = this.tryEntries[i]; | |
var record = entry.completion; | |
if (entry.tryLoc === "root") { | |
// Exception thrown outside of any try block that could handle | |
// it, so set the completion value of the entire function to | |
// throw the exception. | |
return handle("end"); | |
} | |
if (entry.tryLoc <= this.prev) { | |
var hasCatch = hasOwn.call(entry, "catchLoc"); | |
var hasFinally = hasOwn.call(entry, "finallyLoc"); | |
if (hasCatch && hasFinally) { | |
if (this.prev < entry.catchLoc) { | |
return handle(entry.catchLoc, true); | |
} else if (this.prev < entry.finallyLoc) { | |
return handle(entry.finallyLoc); | |
} | |
} else if (hasCatch) { | |
if (this.prev < entry.catchLoc) { | |
return handle(entry.catchLoc, true); | |
} | |
} else if (hasFinally) { | |
if (this.prev < entry.finallyLoc) { | |
return handle(entry.finallyLoc); | |
} | |
} else { | |
throw new Error("try statement without catch or finally"); | |
} | |
} | |
} | |
}, | |
abrupt: function(type, arg) { | |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
var entry = this.tryEntries[i]; | |
if (entry.tryLoc <= this.prev && | |
hasOwn.call(entry, "finallyLoc") && | |
this.prev < entry.finallyLoc) { | |
var finallyEntry = entry; | |
break; | |
} | |
} | |
if (finallyEntry && | |
(type === "break" || | |
type === "continue") && | |
finallyEntry.tryLoc <= arg && | |
arg <= finallyEntry.finallyLoc) { | |
// Ignore the finally entry if control is not jumping to a | |
// location outside the try/catch block. | |
finallyEntry = null; | |
} | |
var record = finallyEntry ? finallyEntry.completion : {}; | |
record.type = type; | |
record.arg = arg; | |
if (finallyEntry) { | |
this.method = "next"; | |
this.next = finallyEntry.finallyLoc; | |
return ContinueSentinel; | |
} | |
return this.complete(record); | |
}, | |
complete: function(record, afterLoc) { | |
if (record.type === "throw") { | |
throw record.arg; | |
} | |
if (record.type === "break" || | |
record.type === "continue") { | |
this.next = record.arg; | |
} else if (record.type === "return") { | |
this.rval = this.arg = record.arg; | |
this.method = "return"; | |
this.next = "end"; | |
} else if (record.type === "normal" && afterLoc) { | |
this.next = afterLoc; | |
} | |
return ContinueSentinel; | |
}, | |
finish: function(finallyLoc) { | |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
var entry = this.tryEntries[i]; | |
if (entry.finallyLoc === finallyLoc) { | |
this.complete(entry.completion, entry.afterLoc); | |
resetTryEntry(entry); | |
return ContinueSentinel; | |
} | |
} | |
}, | |
"catch": function(tryLoc) { | |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
var entry = this.tryEntries[i]; | |
if (entry.tryLoc === tryLoc) { | |
var record = entry.completion; | |
if (record.type === "throw") { | |
var thrown = record.arg; | |
resetTryEntry(entry); | |
} | |
return thrown; | |
} | |
} | |
// The context.catch method must only be called with a location | |
// argument that corresponds to a known catch block. | |
throw new Error("illegal catch attempt"); | |
}, | |
delegateYield: function(iterable, resultName, nextLoc) { | |
this.delegate = { | |
iterator: values(iterable), | |
resultName: resultName, | |
nextLoc: nextLoc | |
}; | |
if (this.method === "next") { | |
// Deliberately forget the last sent value so that we don't | |
// accidentally pass it on to the delegate. | |
this.arg = undefined; | |
} | |
return ContinueSentinel; | |
} | |
}; | |
// Regardless of whether this script is executing as a CommonJS module | |
// or not, return the runtime object so that we can declare the variable | |
// regeneratorRuntime in the outer scope, which allows this module to be | |
// injected easily by `bin/regenerator --include-runtime script.js`. | |
return exports; | |
}( | |
// If this script is executing as a CommonJS module, use module.exports | |
// as the regeneratorRuntime namespace. Otherwise create a new empty | |
// object. Either way, the resulting object will be used to initialize | |
// the regeneratorRuntime variable at the top of this file. | |
typeof module === "object" ? module.exports : {} | |
)); | |
try { | |
regeneratorRuntime = runtime; | |
} catch (accidentalStrictMode) { | |
// This module should not be running in strict mode, so the above | |
// assignment should always work unless something is misconfigured. Just | |
// in case runtime.js accidentally runs in strict mode, we can escape | |
// strict mode using a global Function call. This could conceivably fail | |
// if a Content Security Policy forbids using Function, but in that case | |
// the proper solution is to fix the accidental strict mode problem. If | |
// you've misconfigured your bundler to force strict mode and applied a | |
// CSP to forbid Function, and you're not willing to fix either of those | |
// problems, please detail your unique predicament in a GitHub issue. | |
Function("r", "regeneratorRuntime = r")(runtime); | |
} | |
},{}],306:[function(_dereq_,module,exports){ | |
"use strict"; | |
_dereq_(307); | |
var _global = _interopRequireDefault(_dereq_(13)); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | |
if (_global["default"]._babelPolyfill && typeof console !== "undefined" && console.warn) { | |
console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended " + "and may have consequences if different versions of the polyfills are applied sequentially. " + "If you do need to load the polyfill more than once, use @babel/polyfill/noConflict " + "instead to bypass the warning."); | |
} | |
_global["default"]._babelPolyfill = true; | |
},{"13":13,"307":307}],307:[function(_dereq_,module,exports){ | |
"use strict"; | |
_dereq_(1); | |
_dereq_(3); | |
_dereq_(2); | |
_dereq_(9); | |
_dereq_(8); | |
_dereq_(11); | |
_dereq_(10); | |
_dereq_(12); | |
_dereq_(5); | |
_dereq_(6); | |
_dereq_(4); | |
_dereq_(7); | |
_dereq_(304); | |
_dereq_(305); | |
},{"1":1,"10":10,"11":11,"12":12,"2":2,"3":3,"304":304,"305":305,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9}]},{},[306]); | |
})(this); | |
////////////////////////////////////////////////////////////////////// | |
// es5-shim | |
////////////////////////////////////////////////////////////////////// | |
(function(global) { | |
var module = new ModuleObject(); | |
/*! | |
* https://github.com/es-shims/es5-shim | |
* @license es5-shim Copyright 2009-2020 by contributors, MIT License | |
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE | |
*/ | |
(function(t,e){"use strict";if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){var t=Array;var e=t.prototype;var r=Object;var n=r.prototype;var i=Function;var a=i.prototype;var o=String;var u=o.prototype;var f=Number;var l=f.prototype;var s=e.slice;var c=e.splice;var v=e.push;var h=e.unshift;var p=e.concat;var y=e.join;var d=a.call;var g=a.apply;var w=Math.max;var b=Math.min;var T=Math.floor;var m=Math.abs;var D=Math.pow;var S=n.toString;var x=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var O;var E=Function.prototype.toString,j=/^\s*class /,I=function isES6ClassFn(t){try{var e=E.call(t);var r=e.replace(/\/\/.*\n/g,"");var n=r.replace(/\/\*[.\s\S]*\*\//g,"");var i=n.replace(/\n/gm," ").replace(/ {2}/g," ");return j.test(i)}catch(a){return false}},U=function tryFunctionObject(t){try{if(I(t)){return false}E.call(t);return true}catch(e){return false}},$="[object Function]",F="[object GeneratorFunction]",O=function isCallable(t){if(!t){return false}if(typeof t!=="function"&&typeof t!=="object"){return false}if(x){return U(t)}if(I(t)){return false}var e=S.call(t);return e===$||e===F};var N;var M=RegExp.prototype.exec,C=function tryRegexExec(t){try{M.call(t);return true}catch(e){return false}},k="[object RegExp]";N=function isRegex(t){if(typeof t!=="object"){return false}return x?C(t):S.call(t)===k};var A;var R=String.prototype.valueOf,P=function tryStringObject(t){try{R.call(t);return true}catch(e){return false}},J="[object String]";A=function isString(t){if(typeof t==="string"){return true}if(typeof t!=="object"){return false}return x?P(t):S.call(t)===J};var Y=r.defineProperty&&function(){try{var t={};r.defineProperty(t,"x",{enumerable:false,value:t});for(var e in t){return false}return t.x===t}catch(n){return false}}();var z=function(t){var e;if(Y){e=function(t,e,n,i){if(!i&&e in t){return}r.defineProperty(t,e,{configurable:true,enumerable:false,writable:true,value:n})}}else{e=function(t,e,r,n){if(!n&&e in t){return}t[e]=r}}return function defineProperties(r,n,i){for(var a in n){if(t.call(n,a)){e(r,a,n[a],i)}}}}(n.hasOwnProperty);var Z=function isPrimitive(t){var e=typeof t;return t===null||e!=="object"&&e!=="function"};var G=f.isNaN||function isActualNaN(t){return t!==t};var H={ToInteger:function ToInteger(t){var e=+t;if(G(e)){e=0}else if(e!==0&&e!==1/0&&e!==-(1/0)){e=(e>0||-1)*T(m(e))}return e},ToPrimitive:function ToPrimitive(t){var e,r,n;if(Z(t)){return t}r=t.valueOf;if(O(r)){e=r.call(t);if(Z(e)){return e}}n=t.toString;if(O(n)){e=n.call(t);if(Z(e)){return e}}throw new TypeError},ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return r(t)},ToUint32:function ToUint32(t){return t>>>0}};var W=function Empty(){};z(a,{bind:function bind(t){var e=this;if(!O(e)){throw new TypeError("Function.prototype.bind called on incompatible "+e)}var n=s.call(arguments,1);var a;var o=function(){if(this instanceof a){var i=g.call(e,this,p.call(n,s.call(arguments)));if(r(i)===i){return i}return this}else{return g.call(e,t,p.call(n,s.call(arguments)))}};var u=w(0,e.length-n.length);var f=[];for(var l=0;l<u;l++){v.call(f,"$"+l)}a=i("binder","return function ("+y.call(f,",")+"){ return binder.apply(this, arguments); }")(o);if(e.prototype){W.prototype=e.prototype;a.prototype=new W;W.prototype=null}return a}});var B=d.bind(n.hasOwnProperty);var X=d.bind(n.toString);var L=d.bind(s);var q=g.bind(s);if(typeof document==="object"&&document&&document.documentElement){try{L(document.documentElement.childNodes)}catch(K){var Q=L;var V=q;L=function arraySliceIE(t){var e=[];var r=t.length;while(r-- >0){e[r]=t[r]}return V(e,Q(arguments,1))};q=function arraySliceApplyIE(t,e){return V(L(t),e)}}}var _=d.bind(u.slice);var tt=d.bind(u.split);var et=d.bind(u.indexOf);var rt=d.bind(v);var nt=d.bind(n.propertyIsEnumerable);var it=d.bind(e.sort);var at=t.isArray||function isArray(t){return X(t)==="[object Array]"};var ot=[].unshift(0)!==1;z(e,{unshift:function(){h.apply(this,arguments);return this.length}},ot);z(t,{isArray:at});var ut=r("a");var ft=ut[0]!=="a"||!(0 in ut);var lt=function properlyBoxed(t){var e=true;var r=true;var n=false;if(t){try{t.call("foo",function(t,r,n){if(typeof n!=="object"){e=false}});t.call([1],function(){"use strict";r=typeof this==="string"},"x")}catch(i){n=true}}return!!t&&!n&&e&&r};z(e,{forEach:function forEach(t){var e=H.ToObject(this);var r=ft&&A(this)?tt(this,""):e;var n=-1;var i=H.ToUint32(r.length);var a;if(arguments.length>1){a=arguments[1]}if(!O(t)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<i){if(n in r){if(typeof a==="undefined"){t(r[n],n,e)}else{t.call(a,r[n],n,e)}}}}},!lt(e.forEach));z(e,{map:function map(e){var r=H.ToObject(this);var n=ft&&A(this)?tt(this,""):r;var i=H.ToUint32(n.length);var a=t(i);var o;if(arguments.length>1){o=arguments[1]}if(!O(e)){throw new TypeError("Array.prototype.map callback must be a function")}for(var u=0;u<i;u++){if(u in n){if(typeof o==="undefined"){a[u]=e(n[u],u,r)}else{a[u]=e.call(o,n[u],u,r)}}}return a}},!lt(e.map));z(e,{filter:function filter(t){var e=H.ToObject(this);var r=ft&&A(this)?tt(this,""):e;var n=H.ToUint32(r.length);var i=[];var a;var o;if(arguments.length>1){o=arguments[1]}if(!O(t)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var u=0;u<n;u++){if(u in r){a=r[u];if(typeof o==="undefined"?t(a,u,e):t.call(o,a,u,e)){rt(i,a)}}}return i}},!lt(e.filter));z(e,{every:function every(t){var e=H.ToObject(this);var r=ft&&A(this)?tt(this,""):e;var n=H.ToUint32(r.length);var i;if(arguments.length>1){i=arguments[1]}if(!O(t)){throw new TypeError("Array.prototype.every callback must be a function")}for(var a=0;a<n;a++){if(a in r&&!(typeof i==="undefined"?t(r[a],a,e):t.call(i,r[a],a,e))){return false}}return true}},!lt(e.every));z(e,{some:function some(t){var e=H.ToObject(this);var r=ft&&A(this)?tt(this,""):e;var n=H.ToUint32(r.length);var i;if(arguments.length>1){i=arguments[1]}if(!O(t)){throw new TypeError("Array.prototype.some callback must be a function")}for(var a=0;a<n;a++){if(a in r&&(typeof i==="undefined"?t(r[a],a,e):t.call(i,r[a],a,e))){return true}}return false}},!lt(e.some));var st=false;if(e.reduce){st=typeof e.reduce.call("es5",function(t,e,r,n){return n})==="object"}z(e,{reduce:function reduce(t){var e=H.ToObject(this);var r=ft&&A(this)?tt(this,""):e;var n=H.ToUint32(r.length);if(!O(t)){throw new TypeError("Array.prototype.reduce callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduce of empty array with no initial value")}var i=0;var a;if(arguments.length>=2){a=arguments[1]}else{do{if(i in r){a=r[i++];break}if(++i>=n){throw new TypeError("reduce of empty array with no initial value")}}while(true)}for(;i<n;i++){if(i in r){a=t(a,r[i],i,e)}}return a}},!st);var ct=false;if(e.reduceRight){ct=typeof e.reduceRight.call("es5",function(t,e,r,n){return n})==="object"}z(e,{reduceRight:function reduceRight(t){var e=H.ToObject(this);var r=ft&&A(this)?tt(this,""):e;var n=H.ToUint32(r.length);if(!O(t)){throw new TypeError("Array.prototype.reduceRight callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduceRight of empty array with no initial value")}var i;var a=n-1;if(arguments.length>=2){i=arguments[1]}else{do{if(a in r){i=r[a--];break}if(--a<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}if(a<0){return i}do{if(a in r){i=t(i,r[a],a,e)}}while(a--);return i}},!ct);var vt=e.indexOf&&[0,1].indexOf(1,2)!==-1;z(e,{indexOf:function indexOf(t){var e=ft&&A(this)?tt(this,""):H.ToObject(this);var r=H.ToUint32(e.length);if(r===0){return-1}var n=0;if(arguments.length>1){n=H.ToInteger(arguments[1])}n=n>=0?n:w(0,r+n);for(;n<r;n++){if(n in e&&e[n]===t){return n}}return-1}},vt);var ht=e.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;z(e,{lastIndexOf:function lastIndexOf(t){var e=ft&&A(this)?tt(this,""):H.ToObject(this);var r=H.ToUint32(e.length);if(r===0){return-1}var n=r-1;if(arguments.length>1){n=b(n,H.ToInteger(arguments[1]))}n=n>=0?n:r-m(n);for(;n>=0;n--){if(n in e&&t===e[n]){return n}}return-1}},ht);var pt=function(){var t=[1,2];var e=t.splice();return t.length===2&&at(e)&&e.length===0}();z(e,{splice:function splice(t,e){if(arguments.length===0){return[]}else{return c.apply(this,arguments)}}},!pt);var yt=function(){var t={};e.splice.call(t,0,0,1);return t.length===1}();z(e,{splice:function splice(t,e){if(arguments.length===0){return[]}var r=arguments;this.length=w(H.ToInteger(this.length),0);if(arguments.length>0&&typeof e!=="number"){r=L(arguments);if(r.length<2){rt(r,this.length-t)}else{r[1]=H.ToInteger(e)}}return c.apply(this,r)}},!yt);var dt=function(){var e=new t(1e5);e[8]="x";e.splice(1,1);return e.indexOf("x")===7}();var gt=function(){var t=256;var e=[];e[t]="a";e.splice(t+1,0,"b");return e[t]==="a"}();z(e,{splice:function splice(t,e){var r=H.ToObject(this);var n=[];var i=H.ToUint32(r.length);var a=H.ToInteger(t);var u=a<0?w(i+a,0):b(a,i);var f=arguments.length===0?0:arguments.length===1?i-u:b(w(H.ToInteger(e),0),i-u);var l=0;var s;while(l<f){s=o(u+l);if(B(r,s)){n[l]=r[s]}l+=1}var c=L(arguments,2);var v=c.length;var h;if(v<f){l=u;var p=i-f;while(l<p){s=o(l+f);h=o(l+v);if(B(r,s)){r[h]=r[s]}else{delete r[h]}l+=1}l=i;var y=i-f+v;while(l>y){delete r[l-1];l-=1}}else if(v>f){l=i-f;while(l>u){s=o(l+f-1);h=o(l+v-1);if(B(r,s)){r[h]=r[s]}else{delete r[h]}l-=1}}l=u;for(var d=0;d<c.length;++d){r[l]=c[d];l+=1}r.length=i-f+v;return n}},!dt||!gt);var wt=e.join;var bt;try{bt=Array.prototype.join.call("123",",")!=="1,2,3"}catch(K){bt=true}if(bt){z(e,{join:function join(t){var e=typeof t==="undefined"?",":t;return wt.call(A(this)?tt(this,""):this,e)}},bt)}var Tt=[1,2].join(undefined)!=="1,2";if(Tt){z(e,{join:function join(t){var e=typeof t==="undefined"?",":t;return wt.call(this,e)}},Tt)}var mt=function push(t){var e=H.ToObject(this);var r=H.ToUint32(e.length);var n=0;while(n<arguments.length){e[r+n]=arguments[n];n+=1}e.length=r+n;return r+n};var Dt=function(){var t={};var e=Array.prototype.push.call(t,undefined);return e!==1||t.length!==1||typeof t[0]!=="undefined"||!B(t,0)}();z(e,{push:function push(t){if(at(this)){return v.apply(this,arguments)}return mt.apply(this,arguments)}},Dt);var St=function(){var t=[];var e=t.push(undefined);return e!==1||t.length!==1||typeof t[0]!=="undefined"||!B(t,0)}();z(e,{push:mt},St);z(e,{slice:function(t,e){var r=A(this)?tt(this,""):this;return q(r,arguments)}},ft);var xt=function(){try{[1,2].sort(null)}catch(t){try{[1,2].sort({})}catch(e){return false}}return true}();var Ot=function(){try{[1,2].sort(/a/);return false}catch(t){}return true}();var Et=function(){try{[1,2].sort(undefined);return true}catch(t){}return false}();z(e,{sort:function sort(t){if(typeof t==="undefined"){return it(this)}if(!O(t)){throw new TypeError("Array.prototype.sort callback must be a function")}return it(this,t)}},xt||!Et||!Ot);var jt=!nt({toString:null},"toString");var It=nt(function(){},"prototype");var Ut=!B("x","0");var $t=function(t){var e=t.constructor;return e&&e.prototype===t};var Ft={$applicationCache:true,$console:true,$external:true,$frame:true,$frameElement:true,$frames:true,$innerHeight:true,$innerWidth:true,$onmozfullscreenchange:true,$onmozfullscreenerror:true,$outerHeight:true,$outerWidth:true,$pageXOffset:true,$pageYOffset:true,$parent:true,$scrollLeft:true,$scrollTop:true,$scrollX:true,$scrollY:true,$self:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$window:true,$width:true,$height:true,$top:true,$localStorage:true};var Nt=function(){if(typeof window==="undefined"){return false}for(var t in window){try{if(!Ft["$"+t]&&B(window,t)&&window[t]!==null&&typeof window[t]==="object"){$t(window[t])}}catch(e){return true}}return false}();var Mt=function(t){if(typeof window==="undefined"||!Nt){return $t(t)}try{return $t(t)}catch(e){return false}};var Ct=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var kt=Ct.length;var At=function isArguments(t){return X(t)==="[object Arguments]"};var Rt=function isArguments(t){return t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&!at(t)&&O(t.callee)};var Pt=At(arguments)?At:Rt;z(r,{keys:function keys(t){var e=O(t);var r=Pt(t);var n=t!==null&&typeof t==="object";var i=n&&A(t);if(!n&&!e&&!r){throw new TypeError("Object.keys called on a non-object")}var a=[];var u=It&&e;if(i&&Ut||r){for(var f=0;f<t.length;++f){rt(a,o(f))}}if(!r){for(var l in t){if(!(u&&l==="prototype")&&B(t,l)){rt(a,o(l))}}}if(jt){var s=Mt(t);for(var c=0;c<kt;c++){var v=Ct[c];if(!(s&&v==="constructor")&&B(t,v)){rt(a,v)}}}return a}});var Jt=r.keys&&function(){return r.keys(arguments).length===2}(1,2);var Yt=r.keys&&function(){var t=r.keys(arguments);return arguments.length!==1||t.length!==1||t[0]!==1}(1);var zt=r.keys;z(r,{keys:function keys(t){if(Pt(t)){return zt(L(t))}else{return zt(t)}}},!Jt||Yt);var Zt=new Date(-0xc782b5b342b24).getUTCMonth()!==0;var Gt=new Date(-0x55d318d56a724);var Ht=new Date(14496624e5);var Wt=Gt.toUTCString()!=="Mon, 01 Jan -45875 11:59:59 GMT";var Bt;var Xt;var Lt=Gt.getTimezoneOffset();if(Lt<-720){Bt=Gt.toDateString()!=="Tue Jan 02 -45875";Xt=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Ht))}else{Bt=Gt.toDateString()!=="Mon Jan 01 -45875";Xt=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Ht))}var qt=d.bind(Date.prototype.getFullYear);var Kt=d.bind(Date.prototype.getMonth);var Qt=d.bind(Date.prototype.getDate);var Vt=d.bind(Date.prototype.getUTCFullYear);var _t=d.bind(Date.prototype.getUTCMonth);var te=d.bind(Date.prototype.getUTCDate);var ee=d.bind(Date.prototype.getUTCDay);var re=d.bind(Date.prototype.getUTCHours);var ne=d.bind(Date.prototype.getUTCMinutes);var ie=d.bind(Date.prototype.getUTCSeconds);var ae=d.bind(Date.prototype.getUTCMilliseconds);var oe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var fe=function daysInMonth(t,e){return Qt(new Date(e,t,0))};z(Date.prototype,{getFullYear:function getFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=qt(this);if(t<0&&Kt(this)>11){return t+1}return t},getMonth:function getMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=qt(this);var e=Kt(this);if(t<0&&e>11){return 0}return e},getDate:function getDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=qt(this);var e=Kt(this);var r=Qt(this);if(t<0&&e>11){if(e===12){return r}var n=fe(0,t+1);return n-r+1}return r},getUTCFullYear:function getUTCFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Vt(this);if(t<0&&_t(this)>11){return t+1}return t},getUTCMonth:function getUTCMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Vt(this);var e=_t(this);if(t<0&&e>11){return 0}return e},getUTCDate:function getUTCDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Vt(this);var e=_t(this);var r=te(this);if(t<0&&e>11){if(e===12){return r}var n=fe(0,t+1);return n-r+1}return r}},Zt);z(Date.prototype,{toUTCString:function toUTCString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=ee(this);var e=te(this);var r=_t(this);var n=Vt(this);var i=re(this);var a=ne(this);var o=ie(this);return oe[t]+", "+(e<10?"0"+e:e)+" "+ue[r]+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"}},Zt||Wt);z(Date.prototype,{toDateString:function toDateString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var e=this.getDate();var r=this.getMonth();var n=this.getFullYear();return oe[t]+" "+ue[r]+" "+(e<10?"0"+e:e)+" "+n}},Zt||Bt);if(Zt||Xt){Date.prototype.toString=function toString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var e=this.getDate();var r=this.getMonth();var n=this.getFullYear();var i=this.getHours();var a=this.getMinutes();var o=this.getSeconds();var u=this.getTimezoneOffset();var f=T(m(u)/60);var l=T(m(u)%60);return oe[t]+" "+ue[r]+" "+(e<10?"0"+e:e)+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"+(u>0?"-":"+")+(f<10?"0"+f:f)+(l<10?"0"+l:l)};if(Y){r.defineProperty(Date.prototype,"toString",{configurable:true,enumerable:false,writable:true})}}var le=-621987552e5;var se="-000001";var ce=Date.prototype.toISOString&&new Date(le).toISOString().indexOf(se)===-1;var ve=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z";var he=d.bind(Date.prototype.getTime);z(Date.prototype,{toISOString:function toISOString(){if(!isFinite(this)||!isFinite(he(this))){throw new RangeError("Date.prototype.toISOString called on non-finite value.")}var t=Vt(this);var e=_t(this);t+=T(e/12);e=(e%12+12)%12;var r=[e+1,te(this),re(this),ne(this),ie(this)];t=(t<0?"-":t>9999?"+":"")+_("00000"+m(t),0<=t&&t<=9999?-4:-6);for(var n=0;n<r.length;++n){r[n]=_("00"+r[n],-2)}return t+"-"+L(r,0,2).join("-")+"T"+L(r,2).join(":")+"."+_("000"+ae(this),-3)+"Z"}},ce||ve);var pe=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(le).toJSON().indexOf(se)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(t){return false}}();if(!pe){Date.prototype.toJSON=function toJSON(t){var e=r(this);var n=H.ToPrimitive(e);if(typeof n==="number"&&!isFinite(n)){return null}var i=e.toISOString;if(!O(i)){throw new TypeError("toISOString property is not callable")}return i.call(e)}}var ye=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var de=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z"));var ge=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(ge||de||!ye){var we=D(2,31)-1;var be=G(new Date(1970,0,1,0,0,0,we+1).getTime());Date=function(t){var e=function Date(r,n,i,a,u,f,l){var s=arguments.length;var c;if(this instanceof t){var v=f;var h=l;if(be&&s>=7&&l>we){var p=T(l/we)*we;var y=T(p/1e3);v+=y;h-=y*1e3}c=s===1&&o(r)===r?new t(e.parse(r)):s>=7?new t(r,n,i,a,u,v,h):s>=6?new t(r,n,i,a,u,v):s>=5?new t(r,n,i,a,u):s>=4?new t(r,n,i,a):s>=3?new t(r,n,i):s>=2?new t(r,n):s>=1?new t(r instanceof t?+r:r):new t}else{c=t.apply(this,arguments)}if(!Z(c)){z(c,{constructor:e},true)}return c};var r=new RegExp("^"+"(\\d{4}|[+-]\\d{6})"+"(?:-(\\d{2})"+"(?:-(\\d{2})"+"(?:"+"T(\\d{2})"+":(\\d{2})"+"(?:"+":(\\d{2})"+"(?:(\\.\\d{1,}))?"+")?"+"("+"Z|"+"(?:"+"([-+])"+"(\\d{2})"+":(\\d{2})"+")"+")?)?)?)?"+"$");var n=[0,31,59,90,120,151,181,212,243,273,304,334,365];var i=function dayFromMonth(t,e){var r=e>1?1:0;return n[e]+T((t-1969+r)/4)-T((t-1901+r)/100)+T((t-1601+r)/400)+365*(t-1970)};var a=function toUTC(e){var r=0;var n=e;if(be&&n>we){var i=T(n/we)*we;var a=T(i/1e3);r+=a;n-=a*1e3}return f(new t(1970,0,1,0,0,r,n))};for(var u in t){if(B(t,u)){e[u]=t[u]}}z(e,{now:t.now,UTC:t.UTC},true);e.prototype=t.prototype;z(e.prototype,{constructor:e},true);var l=function parse(e){var n=r.exec(e);if(n){var o=f(n[1]),u=f(n[2]||1)-1,l=f(n[3]||1)-1,s=f(n[4]||0),c=f(n[5]||0),v=f(n[6]||0),h=T(f(n[7]||0)*1e3),p=Boolean(n[4]&&!n[8]),y=n[9]==="-"?1:-1,d=f(n[10]||0),g=f(n[11]||0),w;var b=c>0||v>0||h>0;if(s<(b?24:25)&&c<60&&v<60&&h<1e3&&u>-1&&u<12&&d<24&&g<60&&l>-1&&l<i(o,u+1)-i(o,u)){w=((i(o,u)+l)*24+s+d*y)*60;w=((w+c+g*y)*60+v)*1e3+h;if(p){w=a(w)}if(-864e13<=w&&w<=864e13){return w}}return NaN}return t.parse.apply(this,arguments)};z(e,{parse:l});return e}(Date)}if(!Date.now){Date.now=function now(){return(new Date).getTime()}}var Te=l.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||(1000000000000000128).toFixed(0)!=="1000000000000000128");var me={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function multiply(t,e){var r=-1;var n=e;while(++r<me.size){n+=t*me.data[r];me.data[r]=n%me.base;n=T(n/me.base)}},divide:function divide(t){var e=me.size;var r=0;while(--e>=0){r+=me.data[e];me.data[e]=T(r/t);r=r%t*me.base}},numToString:function numToString(){var t=me.size;var e="";while(--t>=0){if(e!==""||t===0||me.data[t]!==0){var r=o(me.data[t]);if(e===""){e=r}else{e+=_("0000000",0,7-r.length)+r}}}return e},pow:function pow(t,e,r){return e===0?r:e%2===1?pow(t,e-1,r*t):pow(t*t,e/2,r)},log:function log(t){var e=0;var r=t;while(r>=4096){e+=12;r/=4096}while(r>=2){e+=1;r/=2}return e}};var De=function toFixed(t){var e,r,n,i,a,u,l,s;e=f(t);e=G(e)?0:T(e);if(e<0||e>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}r=f(this);if(G(r)){return"NaN"}if(r<=-1e21||r>=1e21){return o(r)}n="";if(r<0){n="-";r=-r}i="0";if(r>1e-21){a=me.log(r*me.pow(2,69,1))-69;u=a<0?r*me.pow(2,-a,1):r/me.pow(2,a,1);u*=4503599627370496;a=52-a;if(a>0){me.multiply(0,u);l=e;while(l>=7){me.multiply(1e7,0);l-=7}me.multiply(me.pow(10,l,1),0);l=a-1;while(l>=23){me.divide(1<<23);l-=23}me.divide(1<<l);me.multiply(1,1);me.divide(2);i=me.numToString()}else{me.multiply(0,u);me.multiply(1<<-a,0);i=me.numToString()+_("0.00000000000000000000",2,2+e)}}if(e>0){s=i.length;if(s<=e){i=n+_("0.0000000000000000000",0,e-s+2)+i}else{i=n+_(i,0,s-e)+"."+_(i,s-e)}}else{i=n+i}return i};z(l,{toFixed:De},Te);var Se=function(){try{return 1..toPrecision(undefined)==="1"}catch(t){return true}}();var xe=l.toPrecision;z(l,{toPrecision:function toPrecision(t){return typeof t==="undefined"?xe.call(this):xe.call(this,t)}},Se);if("ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||"tesst".split(/(s)*/)[1]==="t"||"test".split(/(?:)/,-1).length!==4||"".split(/.?/).length||".".split(/()()/).length>1){(function(){var t=typeof/()??/.exec("")[1]==="undefined";var e=D(2,32)-1;u.split=function split(r,n){var i=String(this);if(typeof r==="undefined"&&n===0){return[]}if(!N(r)){return tt(this,r,n)}var a=[];var o=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(r.sticky?"y":""),u=0,f,l,s,c;var h=new RegExp(r.source,o+"g");if(!t){f=new RegExp("^"+h.source+"$(?!\\s)",o)}var p=typeof n==="undefined"?e:H.ToUint32(n);l=h.exec(i);while(l){s=l.index+l[0].length;if(s>u){rt(a,_(i,u,l.index));if(!t&&l.length>1){l[0].replace(f,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){l[t]=void 0}}})}if(l.length>1&&l.index<i.length){v.apply(a,L(l,1))}c=l[0].length;u=s;if(a.length>=p){break}}if(h.lastIndex===l.index){h.lastIndex++}l=h.exec(i)}if(u===i.length){if(c||!h.test("")){rt(a,"")}}else{rt(a,_(i,u))}return a.length>p?L(a,0,p):a}})()}else if("0".split(void 0,0).length){u.split=function split(t,e){if(typeof t==="undefined"&&e===0){return[]}return tt(this,t,e)}}var Oe=u.replace;var Ee=function(){var t=[];"x".replace(/x(.)?/g,function(e,r){rt(t,r)});return t.length===1&&typeof t[0]==="undefined"}();if(!Ee){u.replace=function replace(t,e){var r=O(e);var n=N(t)&&/\)[*?]/.test(t.source);if(!r||!n){return Oe.call(this,t,e)}else{var i=function(r){var n=arguments.length;var i=t.lastIndex;t.lastIndex=0;var a=t.exec(r)||[];t.lastIndex=i;rt(a,arguments[n-2],arguments[n-1]);return e.apply(this,a)};return Oe.call(this,t,i)}}}var je=u.substr;var Ie="".substr&&"0b".substr(-1)!=="b";z(u,{substr:function substr(t,e){var r=t;if(t<0){r=w(this.length+t,0)}return je.call(this,r,e)}},Ie);var Ue="\t\n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var $e="\u200b";var Fe="["+Ue+"]";var Ne=new RegExp("^"+Fe+Fe+"*");var Me=new RegExp(Fe+Fe+"*$");var Ce=u.trim&&(Ue.trim()||!$e.trim());z(u,{trim:function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return o(this).replace(Ne,"").replace(Me,"")}},Ce);var ke=d.bind(String.prototype.trim);var Ae=u.lastIndexOf&&"abc\u3042\u3044".lastIndexOf("\u3042\u3044",2)!==-1;z(u,{lastIndexOf:function lastIndexOf(t){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var e=o(this);var r=o(t);var n=arguments.length>1?f(arguments[1]):NaN;var i=G(n)?Infinity:H.ToInteger(n);var a=b(w(i,0),e.length);var u=r.length;var l=a+u;while(l>0){l=w(0,l-u);var s=et(_(e,l,a+u),r);if(s!==-1){return l+s}}return-1}},Ae);var Re=u.lastIndexOf;z(u,{lastIndexOf:function lastIndexOf(t){return Re.apply(this,arguments)}},u.lastIndexOf.length!==1);if(parseInt(Ue+"08")!==8||parseInt(Ue+"0x16")!==22){parseInt=function(t){var e=/^[-+]?0[xX]/;return function parseInt(r,n){if(typeof r==="symbol"){""+r}var i=ke(String(r));var a=f(n)||(e.test(i)?16:10);return t(i,a)}}(parseInt)}if(1/parseFloat("-0")!==-Infinity){parseFloat=function(t){return function parseFloat(e){var r=ke(String(e));var n=t(r);return n===0&&_(r,0,1)==="-"?-0:n}}(parseFloat)}if(String(new RangeError("test"))!=="RangeError: test"){var Pe=function toString(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var t=this.name;if(typeof t==="undefined"){t="Error"}else if(typeof t!=="string"){t=o(t)}var e=this.message;if(typeof e==="undefined"){e=""}else if(typeof e!=="string"){e=o(e)}if(!t){return e}if(!e){return t}return t+": "+e};Error.prototype.toString=Pe}if(Y){var Je=function(t,e){if(nt(t,e)){var r=Object.getOwnPropertyDescriptor(t,e);if(r.configurable){r.enumerable=false;Object.defineProperty(t,e,r)}}};Je(Error.prototype,"message");if(Error.prototype.message!==""){Error.prototype.message=""}Je(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var Ye=function toString(){var t="/"+this.source+"/";if(this.global){t+="g"}if(this.ignoreCase){t+="i"}if(this.multiline){t+="m"}return t};RegExp.prototype.toString=Ye}}); | |
//# sourceMappingURL=es5-shim.map | |
})(this); | |
////////////////////////////////////////////////////////////////////// | |
// es5-sham | |
////////////////////////////////////////////////////////////////////// | |
(function(global) { | |
var module = new ModuleObject(); | |
/*! | |
* https://github.com/es-shims/es5-shim | |
* @license es5-shim Copyright 2009-2020 by contributors, MIT License | |
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE | |
*/ | |
(function(e,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){var e=Function.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n=e.bind(t.propertyIsEnumerable);var o=e.bind(t.toString);var i;var c;var f;var a;var l=r(t,"__defineGetter__");if(l){i=e.bind(t.__defineGetter__);c=e.bind(t.__defineSetter__);f=e.bind(t.__lookupGetter__);a=e.bind(t.__lookupSetter__)}var u=function isPrimitive(e){return e==null||typeof e!=="object"&&typeof e!=="function"};if(!Object.getPrototypeOf){Object.getPrototypeOf=function getPrototypeOf(e){var r=e.__proto__;if(r||r==null){return r}else if(o(e.constructor)==="[object Function]"){return e.constructor.prototype}else if(e instanceof Object){return t}else{return null}}}if(Object.defineProperty){var s=function doesGetOwnPropertyDescriptorWork(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};var p=s({});var b=typeof document==="undefined"||s(document.createElement("div"));if(!b||!p){var O=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||O){var d="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(e,o){if(u(e)){throw new TypeError(d+e)}if(O){try{return O.call(Object,e,o)}catch(i){}}var c;if(!r(e,o)){return c}c={enumerable:n(e,o),configurable:true};if(l){var s=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var b=f(e,o);var y=a(e,o);if(p){e.__proto__=s}if(b||y){if(b){c.get=b}if(y){c.set=y}return c}}c.value=e[o];c.writable=true;return c}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function getOwnPropertyNames(e){return Object.keys(e)}}if(!Object.create){var y;var j=!({__proto__:null}instanceof Object);var v=function shouldUseActiveX(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var _=function getEmptyViaActiveX(){var e;var t;t=new ActiveXObject("htmlfile");var r="script";t.write("<"+r+"></"+r+">");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var w=function getEmptyViaIFrame(){var e=document.createElement("iframe");var t=document.body||document.documentElement;var r;e.style.display="none";t.appendChild(e);e.src="javascript:";r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;return r};if(j||typeof document==="undefined"){y=function(){return{__proto__:null}}}else{y=function(){var e=v()?_():w();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;var t=function Empty(){};t.prototype=e;y=function(){return new t};return new t}}Object.create=function create(e,t){var r;var n=function Type(){};if(e===null){r=y()}else if(u(e)){throw new TypeError("Object prototype may only be an Object or null")}else{n.prototype=e;r=new n;r.__proto__=e}if(t!==void 0){Object.defineProperties(r,t)}return r}}var m=function doesDefinePropertyWork(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var P=m({});var E=typeof document==="undefined"||m(document.createElement("div"));if(!P||!E){var h=Object.defineProperty,g=Object.defineProperties}}if(!Object.defineProperty||h){var z="Property description must be an object: ";var T="Object.defineProperty called on non-object: ";var x="getters & setters can not be defined on this javascript engine";Object.defineProperty=function defineProperty(e,r,n){if(u(e)){throw new TypeError(T+e)}if(u(n)){throw new TypeError(z+n)}if(h){try{return h.call(Object,e,r,n)}catch(o){}}if("value"in n){if(l&&(f(e,r)||a(e,r))){var s=e.__proto__;e.__proto__=t;delete e[r];e[r]=n.value;e.__proto__=s}else{e[r]=n.value}}else{var p="get"in n;var b="set"in n;if(!l&&(p||b)){throw new TypeError(x)}if(p){i(e,r,n.get)}if(b){c(e,r,n.set)}}return e}}if(!Object.defineProperties||g){Object.defineProperties=function defineProperties(e,t){if(g){try{return g.call(Object,e,t)}catch(r){}}Object.keys(t).forEach(function(r){if(r!=="__proto__"){Object.defineProperty(e,r,t[r])}});return e}}if(!Object.seal){Object.seal=function seal(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function freeze(e){if(Object(e)!==e){throw new TypeError("Object.freeze can only be called on Objects.")}return e}}try{Object.freeze(function(){})}catch(S){Object.freeze=function(e){return function freeze(t){if(typeof t==="function"){return t}else{return e(t)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function preventExtensions(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function isSealed(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function isFrozen(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function isExtensible(e){if(Object(e)!==e){throw new TypeError("Object.isExtensible can only be called on Objects.")}var t="";while(r(e,t)){t+="?"}e[t]=true;var n=r(e,t);delete e[t];return n}}}); | |
//# sourceMappingURL=es5-sham.map | |
})(this); | |
////////////////////////////////////////////////////////////////////// | |
// es6-shim | |
////////////////////////////////////////////////////////////////////// | |
(function(global) { | |
var module = new ModuleObject(); | |
/*! | |
* https://github.com/paulmillr/es6-shim | |
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) | |
* and contributors, MIT License | |
* es6-shim: v0.35.4 | |
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE | |
* Details and documentation: | |
* https://github.com/paulmillr/es6-shim/ | |
*/ | |
// UMD (Universal Module Definition) | |
// see https://github.com/umdjs/umd/blob/master/returnExports.js | |
(function (root, factory) { | |
/*global define */ | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(factory); | |
} else if (typeof exports === 'object') { | |
// Node. Does not work with strict CommonJS, but | |
// only CommonJS-like environments that support module.exports, | |
// like Node. | |
module.exports = factory(); | |
} else { | |
// Browser globals (root is window) | |
root.returnExports = factory(); | |
} | |
}(this, function () { | |
'use strict'; | |
var _apply = Function.call.bind(Function.apply); | |
var _call = Function.call.bind(Function.call); | |
var isArray = Array.isArray; | |
var keys = Object.keys; | |
var not = function notThunker(func) { | |
return function notThunk() { | |
return !_apply(func, this, arguments); | |
}; | |
}; | |
var throwsError = function (func) { | |
try { | |
func(); | |
return false; | |
} catch (e) { | |
return true; | |
} | |
}; | |
var valueOrFalseIfThrows = function valueOrFalseIfThrows(func) { | |
try { | |
return func(); | |
} catch (e) { | |
return false; | |
} | |
}; | |
var isCallableWithoutNew = not(throwsError); | |
var arePropertyDescriptorsSupported = function () { | |
// if Object.defineProperty exists but throws, it's IE 8 | |
return !throwsError(function () { | |
return Object.defineProperty({}, 'x', { get: function () { } }); // eslint-disable-line getter-return | |
}); | |
}; | |
var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported(); | |
var functionsHaveNames = (function foo() {}).name === 'foo'; // eslint-disable-line no-extra-parens | |
var _forEach = Function.call.bind(Array.prototype.forEach); | |
var _reduce = Function.call.bind(Array.prototype.reduce); | |
var _filter = Function.call.bind(Array.prototype.filter); | |
var _some = Function.call.bind(Array.prototype.some); | |
var defineProperty = function (object, name, value, force) { | |
if (!force && name in object) { return; } | |
if (supportsDescriptors) { | |
Object.defineProperty(object, name, { | |
configurable: true, | |
enumerable: false, | |
writable: true, | |
value: value | |
}); | |
} else { | |
object[name] = value; | |
} | |
}; | |
// Define configurable, writable and non-enumerable props | |
// if they don’t exist. | |
var defineProperties = function (object, map, forceOverride) { | |
_forEach(keys(map), function (name) { | |
var method = map[name]; | |
defineProperty(object, name, method, !!forceOverride); | |
}); | |
}; | |
var _toString = Function.call.bind(Object.prototype.toString); | |
var isCallable = typeof /abc/ === 'function' ? function IsCallableSlow(x) { | |
// Some old browsers (IE, FF) say that typeof /abc/ === 'function' | |
return typeof x === 'function' && _toString(x) === '[object Function]'; | |
} : function IsCallableFast(x) { return typeof x === 'function'; }; | |
var Value = { | |
getter: function (object, name, getter) { | |
if (!supportsDescriptors) { | |
throw new TypeError('getters require true ES5 support'); | |
} | |
Object.defineProperty(object, name, { | |
configurable: true, | |
enumerable: false, | |
get: getter | |
}); | |
}, | |
proxy: function (originalObject, key, targetObject) { | |
if (!supportsDescriptors) { | |
throw new TypeError('getters require true ES5 support'); | |
} | |
var originalDescriptor = Object.getOwnPropertyDescriptor(originalObject, key); | |
Object.defineProperty(targetObject, key, { | |
configurable: originalDescriptor.configurable, | |
enumerable: originalDescriptor.enumerable, | |
get: function getKey() { return originalObject[key]; }, | |
set: function setKey(value) { originalObject[key] = value; } | |
}); | |
}, | |
redefine: function (object, property, newValue) { | |
if (supportsDescriptors) { | |
var descriptor = Object.getOwnPropertyDescriptor(object, property); | |
descriptor.value = newValue; | |
Object.defineProperty(object, property, descriptor); | |
} else { | |
object[property] = newValue; | |
} | |
}, | |
defineByDescriptor: function (object, property, descriptor) { | |
if (supportsDescriptors) { | |
Object.defineProperty(object, property, descriptor); | |
} else if ('value' in descriptor) { | |
object[property] = descriptor.value; | |
} | |
}, | |
preserveToString: function (target, source) { | |
if (source && isCallable(source.toString)) { | |
defineProperty(target, 'toString', source.toString.bind(source), true); | |
} | |
} | |
}; | |
// Simple shim for Object.create on ES3 browsers | |
// (unlike real shim, no attempt to support `prototype === null`) | |
var create = Object.create || function (prototype, properties) { | |
var Prototype = function Prototype() {}; | |
Prototype.prototype = prototype; | |
var object = new Prototype(); | |
if (typeof properties !== 'undefined') { | |
keys(properties).forEach(function (key) { | |
Value.defineByDescriptor(object, key, properties[key]); | |
}); | |
} | |
return object; | |
}; | |
var supportsSubclassing = function (C, f) { | |
if (!Object.setPrototypeOf) { return false; /* skip test on IE < 11 */ } | |
return valueOrFalseIfThrows(function () { | |
var Sub = function Subclass(arg) { | |
var o = new C(arg); | |
Object.setPrototypeOf(o, Subclass.prototype); | |
return o; | |
}; | |
Object.setPrototypeOf(Sub, C); | |
Sub.prototype = create(C.prototype, { | |
constructor: { value: Sub } | |
}); | |
return f(Sub); | |
}); | |
}; | |
var getGlobal = function () { | |
/* global self, window */ | |
// the only reliable means to get the global object is | |
// `Function('return this')()` | |
// However, this causes CSP violations in Chrome apps. | |
if (typeof self !== 'undefined') { return self; } | |
if (typeof window !== 'undefined') { return window; } | |
if (typeof global !== 'undefined') { return global; } | |
throw new Error('unable to locate global object'); | |
}; | |
var globals = getGlobal(); | |
var globalIsFinite = globals.isFinite; | |
var _indexOf = Function.call.bind(String.prototype.indexOf); | |
var _arrayIndexOfApply = Function.apply.bind(Array.prototype.indexOf); | |
var _concat = Function.call.bind(Array.prototype.concat); | |
// var _sort = Function.call.bind(Array.prototype.sort); | |
var _strSlice = Function.call.bind(String.prototype.slice); | |
var _push = Function.call.bind(Array.prototype.push); | |
var _pushApply = Function.apply.bind(Array.prototype.push); | |
var _join = Function.call.bind(Array.prototype.join); | |
var _shift = Function.call.bind(Array.prototype.shift); | |
var _max = Math.max; | |
var _min = Math.min; | |
var _floor = Math.floor; | |
var _abs = Math.abs; | |
var _exp = Math.exp; | |
var _log = Math.log; | |
var _sqrt = Math.sqrt; | |
var _hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); | |
var ArrayIterator; // make our implementation private | |
var noop = function () {}; | |
var OrigMap = globals.Map; | |
var origMapDelete = OrigMap && OrigMap.prototype['delete']; | |
var origMapGet = OrigMap && OrigMap.prototype.get; | |
var origMapHas = OrigMap && OrigMap.prototype.has; | |
var origMapSet = OrigMap && OrigMap.prototype.set; | |
var Symbol = globals.Symbol || {}; | |
var symbolSpecies = Symbol.species || '@@species'; | |
var numberIsNaN = Number.isNaN || function isNaN(value) { | |
// NaN !== NaN, but they are identical. | |
// NaNs are the only non-reflexive value, i.e., if x !== x, | |
// then x is NaN. | |
// isNaN is broken: it converts its argument to number, so | |
// isNaN('foo') => true | |
return value !== value; | |
}; | |
var numberIsFinite = Number.isFinite || function isFinite(value) { | |
return typeof value === 'number' && globalIsFinite(value); | |
}; | |
var _sign = isCallable(Math.sign) ? Math.sign : function sign(value) { | |
var number = Number(value); | |
if (number === 0) { return number; } | |
if (numberIsNaN(number)) { return number; } | |
return number < 0 ? -1 : 1; | |
}; | |
var _log1p = function log1p(value) { | |
var x = Number(value); | |
if (x < -1 || numberIsNaN(x)) { return NaN; } | |
if (x === 0 || x === Infinity) { return x; } | |
if (x === -1) { return -Infinity; } | |
return (1 + x) - 1 === 0 ? x : x * (_log(1 + x) / ((1 + x) - 1)); | |
}; | |
// taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js | |
// can be replaced with require('is-arguments') if we ever use a build process instead | |
var isStandardArguments = function isArguments(value) { | |
return _toString(value) === '[object Arguments]'; | |
}; | |
var isLegacyArguments = function isArguments(value) { | |
return value !== null && | |
typeof value === 'object' && | |
typeof value.length === 'number' && | |
value.length >= 0 && | |
_toString(value) !== '[object Array]' && | |
_toString(value.callee) === '[object Function]'; | |
}; | |
var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; | |
var Type = { | |
primitive: function (x) { return x === null || (typeof x !== 'function' && typeof x !== 'object'); }, | |
string: function (x) { return _toString(x) === '[object String]'; }, | |
regex: function (x) { return _toString(x) === '[object RegExp]'; }, | |
symbol: function (x) { | |
return typeof globals.Symbol === 'function' && typeof x === 'symbol'; | |
} | |
}; | |
var overrideNative = function overrideNative(object, property, replacement) { | |
var original = object[property]; | |
defineProperty(object, property, replacement, true); | |
Value.preserveToString(object[property], original); | |
}; | |
// eslint-disable-next-line no-restricted-properties | |
var hasSymbols = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' && Type.symbol(Symbol()); | |
// This is a private name in the es6 spec, equal to '[Symbol.iterator]' | |
// we're going to use an arbitrary _-prefixed name to make our shims | |
// work properly with each other, even though we don't have full Iterator | |
// support. That is, `Array.from(map.keys())` will work, but we don't | |
// pretend to export a "real" Iterator interface. | |
var $iterator$ = Type.symbol(Symbol.iterator) ? Symbol.iterator : '_es6-shim iterator_'; | |
// Firefox ships a partial implementation using the name @@iterator. | |
// https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14 | |
// So use that name if we detect it. | |
if (globals.Set && typeof new globals.Set()['@@iterator'] === 'function') { | |
$iterator$ = '@@iterator'; | |
} | |
// Reflect | |
if (!globals.Reflect) { | |
defineProperty(globals, 'Reflect', {}, true); | |
} | |
var Reflect = globals.Reflect; | |
var $String = String; | |
/* global document */ | |
var domAll = (typeof document === 'undefined' || !document) ? null : document.all; | |
var isNullOrUndefined = domAll == null ? function isNullOrUndefined(x) { | |
return x == null; | |
} : function isNullOrUndefinedAndNotDocumentAll(x) { | |
return x == null && x !== domAll; | |
}; | |
var ES = { | |
// http://www.ecma-international.org/ecma-262/6.0/#sec-call | |
Call: function Call(F, V) { | |
var args = arguments.length > 2 ? arguments[2] : []; | |
if (!ES.IsCallable(F)) { | |
throw new TypeError(F + ' is not a function'); | |
} | |
return _apply(F, V, args); | |
}, | |
RequireObjectCoercible: function (x, optMessage) { | |
if (isNullOrUndefined(x)) { | |
throw new TypeError(optMessage || 'Cannot call method on ' + x); | |
} | |
return x; | |
}, | |
// This might miss the "(non-standard exotic and does not implement | |
// [[Call]])" case from | |
// http://www.ecma-international.org/ecma-262/6.0/#sec-typeof-operator-runtime-semantics-evaluation | |
// but we can't find any evidence these objects exist in practice. | |
// If we find some in the future, you could test `Object(x) === x`, | |
// which is reliable according to | |
// http://www.ecma-international.org/ecma-262/6.0/#sec-toobject | |
// but is not well optimized by runtimes and creates an object | |
// whenever it returns false, and thus is very slow. | |
TypeIsObject: function (x) { | |
if (x === void 0 || x === null || x === true || x === false) { | |
return false; | |
} | |
return typeof x === 'function' || typeof x === 'object' || x === domAll; | |
}, | |
ToObject: function (o, optMessage) { | |
return Object(ES.RequireObjectCoercible(o, optMessage)); | |
}, | |
IsCallable: isCallable, | |
IsConstructor: function (x) { | |
// We can't tell callables from constructors in ES5 | |
return ES.IsCallable(x); | |
}, | |
ToInt32: function (x) { | |
return ES.ToNumber(x) >> 0; | |
}, | |
ToUint32: function (x) { | |
return ES.ToNumber(x) >>> 0; | |
}, | |
ToNumber: function (value) { | |
if (hasSymbols && _toString(value) === '[object Symbol]') { | |
throw new TypeError('Cannot convert a Symbol value to a number'); | |
} | |
return +value; | |
}, | |
ToInteger: function (value) { | |
var number = ES.ToNumber(value); | |
if (numberIsNaN(number)) { return 0; } | |
if (number === 0 || !numberIsFinite(number)) { return number; } | |
return (number > 0 ? 1 : -1) * _floor(_abs(number)); | |
}, | |
ToLength: function (value) { | |
var len = ES.ToInteger(value); | |
if (len <= 0) { return 0; } // includes converting -0 to +0 | |
if (len > Number.MAX_SAFE_INTEGER) { return Number.MAX_SAFE_INTEGER; } | |
return len; | |
}, | |
SameValue: function (a, b) { | |
if (a === b) { | |
// 0 === -0, but they are not identical. | |
if (a === 0) { return 1 / a === 1 / b; } | |
return true; | |
} | |
return numberIsNaN(a) && numberIsNaN(b); | |
}, | |
SameValueZero: function (a, b) { | |
// same as SameValue except for SameValueZero(+0, -0) == true | |
return (a === b) || (numberIsNaN(a) && numberIsNaN(b)); | |
}, | |
IsIterable: function (o) { | |
return ES.TypeIsObject(o) && (typeof o[$iterator$] !== 'undefined' || isArguments(o)); | |
}, | |
GetIterator: function (o) { | |
if (isArguments(o)) { | |
// special case support for `arguments` | |
return new ArrayIterator(o, 'value'); | |
} | |
var itFn = ES.GetMethod(o, $iterator$); | |
if (!ES.IsCallable(itFn)) { | |
// Better diagnostics if itFn is null or undefined | |
throw new TypeError('value is not an iterable'); | |
} | |
var it = ES.Call(itFn, o); | |
if (!ES.TypeIsObject(it)) { | |
throw new TypeError('bad iterator'); | |
} | |
return it; | |
}, | |
GetMethod: function (o, p) { | |
var func = ES.ToObject(o)[p]; | |
if (isNullOrUndefined(func)) { | |
return void 0; | |
} | |
if (!ES.IsCallable(func)) { | |
throw new TypeError('Method not callable: ' + p); | |
} | |
return func; | |
}, | |
IteratorComplete: function (iterResult) { | |
return !!iterResult.done; | |
}, | |
IteratorClose: function (iterator, completionIsThrow) { | |
var returnMethod = ES.GetMethod(iterator, 'return'); | |
if (returnMethod === void 0) { | |
return; | |
} | |
var innerResult, innerException; | |
try { | |
innerResult = ES.Call(returnMethod, iterator); | |
} catch (e) { | |
innerException = e; | |
} | |
if (completionIsThrow) { | |
return; | |
} | |
if (innerException) { | |
throw innerException; | |
} | |
if (!ES.TypeIsObject(innerResult)) { | |
throw new TypeError("Iterator's return method returned a non-object."); | |
} | |
}, | |
IteratorNext: function (it) { | |
var result = arguments.length > 1 ? it.next(arguments[1]) : it.next(); | |
if (!ES.TypeIsObject(result)) { | |
throw new TypeError('bad iterator'); | |
} | |
return result; | |
}, | |
IteratorStep: function (it) { | |
var result = ES.IteratorNext(it); | |
var done = ES.IteratorComplete(result); | |
return done ? false : result; | |
}, | |
Construct: function (C, args, newTarget, isES6internal) { | |
var target = typeof newTarget === 'undefined' ? C : newTarget; | |
if (!isES6internal && Reflect.construct) { | |
// Try to use Reflect.construct if available | |
return Reflect.construct(C, args, target); | |
} | |
// OK, we have to fake it. This will only work if the | |
// C.[[ConstructorKind]] == "base" -- but that's the only | |
// kind we can make in ES5 code anyway. | |
// OrdinaryCreateFromConstructor(target, "%ObjectPrototype%") | |
var proto = target.prototype; | |
if (!ES.TypeIsObject(proto)) { | |
proto = Object.prototype; | |
} | |
var obj = create(proto); | |
// Call the constructor. | |
var result = ES.Call(C, obj, args); | |
return ES.TypeIsObject(result) ? result : obj; | |
}, | |
SpeciesConstructor: function (O, defaultConstructor) { | |
var C = O.constructor; | |
if (C === void 0) { | |
return defaultConstructor; | |
} | |
if (!ES.TypeIsObject(C)) { | |
throw new TypeError('Bad constructor'); | |
} | |
var S = C[symbolSpecies]; | |
if (isNullOrUndefined(S)) { | |
return defaultConstructor; | |
} | |
if (!ES.IsConstructor(S)) { | |
throw new TypeError('Bad @@species'); | |
} | |
return S; | |
}, | |
CreateHTML: function (string, tag, attribute, value) { | |
var S = ES.ToString(string); | |
var p1 = '<' + tag; | |
if (attribute !== '') { | |
var V = ES.ToString(value); | |
var escapedV = V.replace(/"/g, '"'); | |
p1 += ' ' + attribute + '="' + escapedV + '"'; | |
} | |
var p2 = p1 + '>'; | |
var p3 = p2 + S; | |
return p3 + '</' + tag + '>'; | |
}, | |
IsRegExp: function IsRegExp(argument) { | |
if (!ES.TypeIsObject(argument)) { | |
return false; | |
} | |
var isRegExp = argument[Symbol.match]; | |
if (typeof isRegExp !== 'undefined') { | |
return !!isRegExp; | |
} | |
return Type.regex(argument); | |
}, | |
ToString: function ToString(string) { | |
if (hasSymbols && _toString(string) === '[object Symbol]') { | |
throw new TypeError('Cannot convert a Symbol value to a number'); | |
} | |
return $String(string); | |
} | |
}; | |
// Well-known Symbol shims | |
if (supportsDescriptors && hasSymbols) { | |
var defineWellKnownSymbol = function defineWellKnownSymbol(name) { | |
if (Type.symbol(Symbol[name])) { | |
return Symbol[name]; | |
} | |
// eslint-disable-next-line no-restricted-properties | |
var sym = Symbol['for']('Symbol.' + name); | |
Object.defineProperty(Symbol, name, { | |
configurable: false, | |
enumerable: false, | |
writable: false, | |
value: sym | |
}); | |
return sym; | |
}; | |
if (!Type.symbol(Symbol.search)) { | |
var symbolSearch = defineWellKnownSymbol('search'); | |
var originalSearch = String.prototype.search; | |
defineProperty(RegExp.prototype, symbolSearch, function search(string) { | |
return ES.Call(originalSearch, string, [this]); | |
}); | |
var searchShim = function search(regexp) { | |
var O = ES.RequireObjectCoercible(this); | |
if (!isNullOrUndefined(regexp)) { | |
var searcher = ES.GetMethod(regexp, symbolSearch); | |
if (typeof searcher !== 'undefined') { | |
return ES.Call(searcher, regexp, [O]); | |
} | |
} | |
return ES.Call(originalSearch, O, [ES.ToString(regexp)]); | |
}; | |
overrideNative(String.prototype, 'search', searchShim); | |
} | |
if (!Type.symbol(Symbol.replace)) { | |
var symbolReplace = defineWellKnownSymbol('replace'); | |
var originalReplace = String.prototype.replace; | |
defineProperty(RegExp.prototype, symbolReplace, function replace(string, replaceValue) { | |
return ES.Call(originalReplace, string, [this, replaceValue]); | |
}); | |
var replaceShim = function replace(searchValue, replaceValue) { | |
var O = ES.RequireObjectCoercible(this); | |
if (!isNullOrUndefined(searchValue)) { | |
var replacer = ES.GetMethod(searchValue, symbolReplace); | |
if (typeof replacer !== 'undefined') { | |
return ES.Call(replacer, searchValue, [O, replaceValue]); | |
} | |
} | |
return ES.Call(originalReplace, O, [ES.ToString(searchValue), replaceValue]); | |
}; | |
overrideNative(String.prototype, 'replace', replaceShim); | |
} | |
if (!Type.symbol(Symbol.split)) { | |
var symbolSplit = defineWellKnownSymbol('split'); | |
var originalSplit = String.prototype.split; | |
defineProperty(RegExp.prototype, symbolSplit, function split(string, limit) { | |
return ES.Call(originalSplit, string, [this, limit]); | |
}); | |
var splitShim = function split(separator, limit) { | |
var O = ES.RequireObjectCoercible(this); | |
if (!isNullOrUndefined(separator)) { | |
var splitter = ES.GetMethod(separator, symbolSplit); | |
if (typeof splitter !== 'undefined') { | |
return ES.Call(splitter, separator, [O, limit]); | |
} | |
} | |
return ES.Call(originalSplit, O, [ES.ToString(separator), limit]); | |
}; | |
overrideNative(String.prototype, 'split', splitShim); | |
} | |
var symbolMatchExists = Type.symbol(Symbol.match); | |
var stringMatchIgnoresSymbolMatch = symbolMatchExists && (function () { | |
// Firefox 41, through Nightly 45 has Symbol.match, but String#match ignores it. | |
// Firefox 40 and below have Symbol.match but String#match works fine. | |
var o = {}; | |
o[Symbol.match] = function () { return 42; }; | |
return 'a'.match(o) !== 42; | |
}()); | |
if (!symbolMatchExists || stringMatchIgnoresSymbolMatch) { | |
var symbolMatch = defineWellKnownSymbol('match'); | |
var originalMatch = String.prototype.match; | |
defineProperty(RegExp.prototype, symbolMatch, function match(string) { | |
return ES.Call(originalMatch, string, [this]); | |
}); | |
var matchShim = function match(regexp) { | |
var O = ES.RequireObjectCoercible(this); | |
if (!isNullOrUndefined(regexp)) { | |
var matcher = ES.GetMethod(regexp, symbolMatch); | |
if (typeof matcher !== 'undefined') { | |
return ES.Call(matcher, regexp, [O]); | |
} | |
} | |
return ES.Call(originalMatch, O, [ES.ToString(regexp)]); | |
}; | |
overrideNative(String.prototype, 'match', matchShim); | |
} | |
} | |
var wrapConstructor = function wrapConstructor(original, replacement, keysToSkip) { | |
Value.preserveToString(replacement, original); | |
if (Object.setPrototypeOf) { | |
// sets up proper prototype chain where possible | |
Object.setPrototypeOf(original, replacement); | |
} | |
if (supportsDescriptors) { | |
_forEach(Object.getOwnPropertyNames(original), function (key) { | |
if (key in noop || keysToSkip[key]) { return; } | |
Value.proxy(original, key, replacement); | |
}); | |
} else { | |
_forEach(Object.keys(original), function (key) { | |
if (key in noop || keysToSkip[key]) { return; } | |
replacement[key] = original[key]; | |
}); | |
} | |
replacement.prototype = original.prototype; | |
Value.redefine(original.prototype, 'constructor', replacement); | |
}; | |
var defaultSpeciesGetter = function () { return this; }; | |
var addDefaultSpecies = function (C) { | |
if (supportsDescriptors && !_hasOwnProperty(C, symbolSpecies)) { | |
Value.getter(C, symbolSpecies, defaultSpeciesGetter); | |
} | |
}; | |
var addIterator = function (prototype, impl) { | |
var implementation = impl || function iterator() { return this; }; | |
defineProperty(prototype, $iterator$, implementation); | |
if (!prototype[$iterator$] && Type.symbol($iterator$)) { | |
// implementations are buggy when $iterator$ is a Symbol | |
prototype[$iterator$] = implementation; | |
} | |
}; | |
var createDataProperty = function createDataProperty(object, name, value) { | |
if (supportsDescriptors) { | |
Object.defineProperty(object, name, { | |
configurable: true, | |
enumerable: true, | |
writable: true, | |
value: value | |
}); | |
} else { | |
object[name] = value; | |
} | |
}; | |
var createDataPropertyOrThrow = function createDataPropertyOrThrow(object, name, value) { | |
createDataProperty(object, name, value); | |
if (!ES.SameValue(object[name], value)) { | |
throw new TypeError('property is nonconfigurable'); | |
} | |
}; | |
var emulateES6construct = function (o, defaultNewTarget, defaultProto, slots) { | |
// This is an es5 approximation to es6 construct semantics. in es6, | |
// 'new Foo' invokes Foo.[[Construct]] which (for almost all objects) | |
// just sets the internal variable NewTarget (in es6 syntax `new.target`) | |
// to Foo and then returns Foo(). | |
// Many ES6 object then have constructors of the form: | |
// 1. If NewTarget is undefined, throw a TypeError exception | |
// 2. Let xxx by OrdinaryCreateFromConstructor(NewTarget, yyy, zzz) | |
// So we're going to emulate those first two steps. | |
if (!ES.TypeIsObject(o)) { | |
throw new TypeError('Constructor requires `new`: ' + defaultNewTarget.name); | |
} | |
var proto = defaultNewTarget.prototype; | |
if (!ES.TypeIsObject(proto)) { | |
proto = defaultProto; | |
} | |
var obj = create(proto); | |
for (var name in slots) { | |
if (_hasOwnProperty(slots, name)) { | |
var value = slots[name]; | |
defineProperty(obj, name, value, true); | |
} | |
} | |
return obj; | |
}; | |
// Firefox 31 reports this function's length as 0 | |
// https://bugzilla.mozilla.org/show_bug.cgi?id=1062484 | |
if (String.fromCodePoint && String.fromCodePoint.length !== 1) { | |
var originalFromCodePoint = String.fromCodePoint; | |
overrideNative(String, 'fromCodePoint', function fromCodePoint(codePoints) { | |
return ES.Call(originalFromCodePoint, this, arguments); | |
}); | |
} | |
var StringShims = { | |
fromCodePoint: function fromCodePoint(codePoints) { | |
var result = []; | |
var next; | |
for (var i = 0, length = arguments.length; i < length; i++) { | |
next = Number(arguments[i]); | |
if (!ES.SameValue(next, ES.ToInteger(next)) || next < 0 || next > 0x10FFFF) { | |
throw new RangeError('Invalid code point ' + next); | |
} | |
if (next < 0x10000) { | |
_push(result, String.fromCharCode(next)); | |
} else { | |
next -= 0x10000; | |
_push(result, String.fromCharCode((next >> 10) + 0xD800)); | |
_push(result, String.fromCharCode((next % 0x400) + 0xDC00)); | |
} | |
} | |
return _join(result, ''); | |
}, | |
raw: function raw(template) { | |
var numberOfSubstitutions = arguments.length - 1; | |
var cooked = ES.ToObject(template, 'bad template'); | |
var raw = ES.ToObject(cooked.raw, 'bad raw value'); | |
var len = raw.length; | |
var literalSegments = ES.ToLength(len); | |
if (literalSegments <= 0) { | |
return ''; | |
} | |
var stringElements = []; | |
var nextIndex = 0; | |
var nextKey, next, nextSeg, nextSub; | |
while (nextIndex < literalSegments) { | |
nextKey = ES.ToString(nextIndex); | |
nextSeg = ES.ToString(raw[nextKey]); | |
_push(stringElements, nextSeg); | |
if (nextIndex + 1 >= literalSegments) { | |
break; | |
} | |
next = nextIndex + 1 < arguments.length ? arguments[nextIndex + 1] : ''; | |
nextSub = ES.ToString(next); | |
_push(stringElements, nextSub); | |
nextIndex += 1; | |
} | |
return _join(stringElements, ''); | |
} | |
}; | |
if (String.raw && String.raw({ raw: { 0: 'x', 1: 'y', length: 2 } }) !== 'xy') { | |
// IE 11 TP has a broken String.raw implementation | |
overrideNative(String, 'raw', StringShims.raw); | |
} | |
defineProperties(String, StringShims); | |
// Fast repeat, uses the `Exponentiation by squaring` algorithm. | |
// Perf: http://jsperf.com/string-repeat2/2 | |
var stringRepeat = function repeat(s, times) { | |
if (times < 1) { return ''; } | |
if (times % 2) { return repeat(s, times - 1) + s; } | |
var half = repeat(s, times / 2); | |
return half + half; | |
}; | |
var stringMaxLength = Infinity; | |
var StringPrototypeShims = { | |
repeat: function repeat(times) { | |
var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); | |
var numTimes = ES.ToInteger(times); | |
if (numTimes < 0 || numTimes >= stringMaxLength) { | |
throw new RangeError('repeat count must be less than infinity and not overflow maximum string size'); | |
} | |
return stringRepeat(thisStr, numTimes); | |
}, | |
startsWith: function startsWith(searchString) { | |
var S = ES.ToString(ES.RequireObjectCoercible(this)); | |
if (ES.IsRegExp(searchString)) { | |
throw new TypeError('Cannot call method "startsWith" with a regex'); | |
} | |
var searchStr = ES.ToString(searchString); | |
var position; | |
if (arguments.length > 1) { | |
position = arguments[1]; | |
} | |
var start = _max(ES.ToInteger(position), 0); | |
return _strSlice(S, start, start + searchStr.length) === searchStr; | |
}, | |
endsWith: function endsWith(searchString) { | |
var S = ES.ToString(ES.RequireObjectCoercible(this)); | |
if (ES.IsRegExp(searchString)) { | |
throw new TypeError('Cannot call method "endsWith" with a regex'); | |
} | |
var searchStr = ES.ToString(searchString); | |
var len = S.length; | |
var endPosition; | |
if (arguments.length > 1) { | |
endPosition = arguments[1]; | |
} | |
var pos = typeof endPosition === 'undefined' ? len : ES.ToInteger(endPosition); | |
var end = _min(_max(pos, 0), len); | |
return _strSlice(S, end - searchStr.length, end) === searchStr; | |
}, | |
includes: function includes(searchString) { | |
if (ES.IsRegExp(searchString)) { | |
throw new TypeError('"includes" does not accept a RegExp'); | |
} | |
var searchStr = ES.ToString(searchString); | |
var position; | |
if (arguments.length > 1) { | |
position = arguments[1]; | |
} | |
// Somehow this trick makes method 100% compat with the spec. | |
return _indexOf(this, searchStr, position) !== -1; | |
}, | |
codePointAt: function codePointAt(pos) { | |
var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); | |
var position = ES.ToInteger(pos); | |
var length = thisStr.length; | |
if (position >= 0 && position < length) { | |
var first = thisStr.charCodeAt(position); | |
var isEnd = position + 1 === length; | |
if (first < 0xD800 || first > 0xDBFF || isEnd) { return first; } | |
var second = thisStr.charCodeAt(position + 1); | |
if (second < 0xDC00 || second > 0xDFFF) { return first; } | |
return ((first - 0xD800) * 1024) + (second - 0xDC00) + 0x10000; | |
} | |
} | |
}; | |
if (String.prototype.includes && 'a'.includes('a', Infinity) !== false) { | |
overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); | |
} | |
if (String.prototype.startsWith && String.prototype.endsWith) { | |
var startsWithRejectsRegex = throwsError(function () { | |
/* throws if spec-compliant */ | |
return '/a/'.startsWith(/a/); | |
}); | |
var startsWithHandlesInfinity = valueOrFalseIfThrows(function () { | |
return 'abc'.startsWith('a', Infinity) === false; | |
}); | |
if (!startsWithRejectsRegex || !startsWithHandlesInfinity) { | |
// Firefox (< 37?) and IE 11 TP have a noncompliant startsWith implementation | |
overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); | |
overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); | |
} | |
} | |
if (hasSymbols) { | |
var startsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { | |
var re = /a/; | |
re[Symbol.match] = false; | |
return '/a/'.startsWith(re); | |
}); | |
if (!startsWithSupportsSymbolMatch) { | |
overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); | |
} | |
var endsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { | |
var re = /a/; | |
re[Symbol.match] = false; | |
return '/a/'.endsWith(re); | |
}); | |
if (!endsWithSupportsSymbolMatch) { | |
overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); | |
} | |
var includesSupportsSymbolMatch = valueOrFalseIfThrows(function () { | |
var re = /a/; | |
re[Symbol.match] = false; | |
return '/a/'.includes(re); | |
}); | |
if (!includesSupportsSymbolMatch) { | |
overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); | |
} | |
} | |
defineProperties(String.prototype, StringPrototypeShims); | |
// whitespace from: http://es5.github.io/#x15.5.4.20 | |
// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 | |
var ws = [ | |
'\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', | |
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', | |
'\u2029\uFEFF' | |
].join(''); | |
var trimRegexp = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); | |
var trimShim = function trim() { | |
return ES.ToString(ES.RequireObjectCoercible(this)).replace(trimRegexp, ''); | |
}; | |
var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); | |
var nonWSregex = new RegExp('[' + nonWS + ']', 'g'); | |
var isBadHexRegex = /^[-+]0x[0-9a-f]+$/i; | |
var hasStringTrimBug = nonWS.trim().length !== nonWS.length; | |
defineProperty(String.prototype, 'trim', trimShim, hasStringTrimBug); | |
// Given an argument x, it will return an IteratorResult object, | |
// with value set to x and done to false. | |
// Given no arguments, it will return an iterator completion object. | |
var iteratorResult = function (x) { | |
return { value: x, done: arguments.length === 0 }; | |
}; | |
// see http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype-@@iterator | |
var StringIterator = function (s) { | |
ES.RequireObjectCoercible(s); | |
defineProperty(this, '_s', ES.ToString(s)); | |
defineProperty(this, '_i', 0); | |
}; | |
StringIterator.prototype.next = function () { | |
var s = this._s; | |
var i = this._i; | |
if (typeof s === 'undefined' || i >= s.length) { | |
this._s = void 0; | |
return iteratorResult(); | |
} | |
var first = s.charCodeAt(i); | |
var second, len; | |
if (first < 0xD800 || first > 0xDBFF || (i + 1) === s.length) { | |
len = 1; | |
} else { | |
second = s.charCodeAt(i + 1); | |
len = (second < 0xDC00 || second > 0xDFFF) ? 1 : 2; | |
} | |
this._i = i + len; | |
return iteratorResult(s.substr(i, len)); | |
}; | |
addIterator(StringIterator.prototype); | |
addIterator(String.prototype, function () { | |
return new StringIterator(this); | |
}); | |
var ArrayShims = { | |
from: function from(items) { | |
var C = this; | |
var mapFn; | |
if (arguments.length > 1) { | |
mapFn = arguments[1]; | |
} | |
var mapping, T; | |
if (typeof mapFn === 'undefined') { | |
mapping = false; | |
} else { | |
if (!ES.IsCallable(mapFn)) { | |
throw new TypeError('Array.from: when provided, the second argument must be a function'); | |
} | |
if (arguments.length > 2) { | |
T = arguments[2]; | |
} | |
mapping = true; | |
} | |
// Note that that Arrays will use ArrayIterator: | |
// https://bugs.ecmascript.org/show_bug.cgi?id=2416 | |
var usingIterator = typeof (isArguments(items) || ES.GetMethod(items, $iterator$)) !== 'undefined'; | |
var length, result, i; | |
if (usingIterator) { | |
result = ES.IsConstructor(C) ? Object(new C()) : []; | |
var iterator = ES.GetIterator(items); | |
var next, nextValue; | |
i = 0; | |
while (true) { | |
next = ES.IteratorStep(iterator); | |
if (next === false) { | |
break; | |
} | |
nextValue = next.value; | |
try { | |
if (mapping) { | |
nextValue = typeof T === 'undefined' ? mapFn(nextValue, i) : _call(mapFn, T, nextValue, i); | |
} | |
result[i] = nextValue; | |
} catch (e) { | |
ES.IteratorClose(iterator, true); | |
throw e; | |
} | |
i += 1; | |
} | |
length = i; | |
} else { | |
var arrayLike = ES.ToObject(items); | |
length = ES.ToLength(arrayLike.length); | |
result = ES.IsConstructor(C) ? Object(new C(length)) : new Array(length); | |
var value; | |
for (i = 0; i < length; ++i) { | |
value = arrayLike[i]; | |
if (mapping) { | |
value = typeof T === 'undefined' ? mapFn(value, i) : _call(mapFn, T, value, i); | |
} | |
createDataPropertyOrThrow(result, i, value); | |
} | |
} | |
result.length = length; | |
return result; | |
}, | |
of: function of() { | |
var len = arguments.length; | |
var C = this; | |
var A = isArray(C) || !ES.IsCallable(C) ? new Array(len) : ES.Construct(C, [len]); | |
for (var k = 0; k < len; ++k) { | |
createDataPropertyOrThrow(A, k, arguments[k]); | |
} | |
A.length = len; | |
return A; | |
} | |
}; | |
defineProperties(Array, ArrayShims); | |
addDefaultSpecies(Array); | |
// Our ArrayIterator is private; see | |
// https://github.com/paulmillr/es6-shim/issues/252 | |
ArrayIterator = function (array, kind) { | |
defineProperty(this, 'i', 0); | |
defineProperty(this, 'array', array); | |
defineProperty(this, 'kind', kind); | |
}; | |
defineProperties(ArrayIterator.prototype, { | |
next: function () { | |
var i = this.i; | |
var array = this.array; | |
if (!(this instanceof ArrayIterator)) { | |
throw new TypeError('Not an ArrayIterator'); | |
} | |
if (typeof array !== 'undefined') { | |
var len = ES.ToLength(array.length); | |
if (i < len) { | |
//for (; i < len; i++) { | |
var kind = this.kind; | |
var retval; | |
if (kind === 'key') { | |
retval = i; | |
} else if (kind === 'value') { | |
retval = array[i]; | |
} else if (kind === 'entry') { | |
retval = [i, array[i]]; | |
} | |
this.i = i + 1; | |
return iteratorResult(retval); | |
} | |
} | |
this.array = void 0; | |
return iteratorResult(); | |
} | |
}); | |
addIterator(ArrayIterator.prototype); | |
/* | |
var orderKeys = function orderKeys(a, b) { | |
var aNumeric = String(ES.ToInteger(a)) === a; | |
var bNumeric = String(ES.ToInteger(b)) === b; | |
if (aNumeric && bNumeric) { | |
return b - a; | |
} else if (aNumeric && !bNumeric) { | |
return -1; | |
} else if (!aNumeric && bNumeric) { | |
return 1; | |
} else { | |
return a.localeCompare(b); | |
} | |
}; | |
var getAllKeys = function getAllKeys(object) { | |
var ownKeys = []; | |
var keys = []; | |
for (var key in object) { | |
_push(_hasOwnProperty(object, key) ? ownKeys : keys, key); | |
} | |
_sort(ownKeys, orderKeys); | |
_sort(keys, orderKeys); | |
return _concat(ownKeys, keys); | |
}; | |
*/ | |
// note: this is positioned here because it depends on ArrayIterator | |
var arrayOfSupportsSubclassing = Array.of === ArrayShims.of || (function () { | |
// Detects a bug in Webkit nightly r181886 | |
var Foo = function Foo(len) { this.length = len; }; | |
Foo.prototype = []; | |
var fooArr = Array.of.apply(Foo, [1, 2]); | |
return fooArr instanceof Foo && fooArr.length === 2; | |
}()); | |
if (!arrayOfSupportsSubclassing) { | |
overrideNative(Array, 'of', ArrayShims.of); | |
} | |
var ArrayPrototypeShims = { | |
copyWithin: function copyWithin(target, start) { | |
var o = ES.ToObject(this); | |
var len = ES.ToLength(o.length); | |
var relativeTarget = ES.ToInteger(target); | |
var relativeStart = ES.ToInteger(start); | |
var to = relativeTarget < 0 ? _max(len + relativeTarget, 0) : _min(relativeTarget, len); | |
var from = relativeStart < 0 ? _max(len + relativeStart, 0) : _min(relativeStart, len); | |
var end; | |
if (arguments.length > 2) { | |
end = arguments[2]; | |
} | |
var relativeEnd = typeof end === 'undefined' ? len : ES.ToInteger(end); | |
var finalItem = relativeEnd < 0 ? _max(len + relativeEnd, 0) : _min(relativeEnd, len); | |
var count = _min(finalItem - from, len - to); | |
var direction = 1; | |
if (from < to && to < (from + count)) { | |
direction = -1; | |
from += count - 1; | |
to += count - 1; | |
} | |
while (count > 0) { | |
if (from in o) { | |
o[to] = o[from]; | |
} else { | |
delete o[to]; | |
} | |
from += direction; | |
to += direction; | |
count -= 1; | |
} | |
return o; | |
}, | |
fill: function fill(value) { | |
var start; | |
if (arguments.length > 1) { | |
start = arguments[1]; | |
} | |
var end; | |
if (arguments.length > 2) { | |
end = arguments[2]; | |
} | |
var O = ES.ToObject(this); | |
var len = ES.ToLength(O.length); | |
start = ES.ToInteger(typeof start === 'undefined' ? 0 : start); | |
end = ES.ToInteger(typeof end === 'undefined' ? len : end); | |
var relativeStart = start < 0 ? _max(len + start, 0) : _min(start, len); | |
var relativeEnd = end < 0 ? len + end : end; | |
for (var i = relativeStart; i < len && i < relativeEnd; ++i) { | |
O[i] = value; | |
} | |
return O; | |
}, | |
find: function find(predicate) { | |
var list = ES.ToObject(this); | |
var length = ES.ToLength(list.length); | |
if (!ES.IsCallable(predicate)) { | |
throw new TypeError('Array#find: predicate must be a function'); | |
} | |
var thisArg = arguments.length > 1 ? arguments[1] : null; | |
for (var i = 0, value; i < length; i++) { | |
value = list[i]; | |
if (thisArg) { | |
if (_call(predicate, thisArg, value, i, list)) { | |
return value; | |
} | |
} else if (predicate(value, i, list)) { | |
return value; | |
} | |
} | |
}, | |
findIndex: function findIndex(predicate) { | |
var list = ES.ToObject(this); | |
var length = ES.ToLength(list.length); | |
if (!ES.IsCallable(predicate)) { | |
throw new TypeError('Array#findIndex: predicate must be a function'); | |
} | |
var thisArg = arguments.length > 1 ? arguments[1] : null; | |
for (var i = 0; i < length; i++) { | |
if (thisArg) { | |
if (_call(predicate, thisArg, list[i], i, list)) { | |
return i; | |
} | |
} else if (predicate(list[i], i, list)) { | |
return i; | |
} | |
} | |
return -1; | |
}, | |
keys: function keys() { | |
return new ArrayIterator(this, 'key'); | |
}, | |
values: function values() { | |
return new ArrayIterator(this, 'value'); | |
}, | |
entries: function entries() { | |
return new ArrayIterator(this, 'entry'); | |
} | |
}; | |
// Safari 7.1 defines Array#keys and Array#entries natively, | |
// but the resulting ArrayIterator objects don't have a "next" method. | |
if (Array.prototype.keys && !ES.IsCallable([1].keys().next)) { | |
delete Array.prototype.keys; | |
} | |
if (Array.prototype.entries && !ES.IsCallable([1].entries().next)) { | |
delete Array.prototype.entries; | |
} | |
// Chrome 38 defines Array#keys and Array#entries, and Array#@@iterator, but not Array#values | |
if (Array.prototype.keys && Array.prototype.entries && !Array.prototype.values && Array.prototype[$iterator$]) { | |
defineProperties(Array.prototype, { | |
values: Array.prototype[$iterator$] | |
}); | |
if (Type.symbol(Symbol.unscopables)) { | |
Array.prototype[Symbol.unscopables].values = true; | |
} | |
} | |
// Chrome 40 defines Array#values with the incorrect name, although Array#{keys,entries} have the correct name | |
if (functionsHaveNames && Array.prototype.values && Array.prototype.values.name !== 'values') { | |
var originalArrayPrototypeValues = Array.prototype.values; | |
overrideNative(Array.prototype, 'values', function values() { return ES.Call(originalArrayPrototypeValues, this, arguments); }); | |
defineProperty(Array.prototype, $iterator$, Array.prototype.values, true); | |
} | |
defineProperties(Array.prototype, ArrayPrototypeShims); | |
if (1 / [true].indexOf(true, -0) < 0) { | |
// indexOf when given a position arg of -0 should return +0. | |
// https://github.com/tc39/ecma262/pull/316 | |
defineProperty(Array.prototype, 'indexOf', function indexOf(searchElement) { | |
var value = _arrayIndexOfApply(this, arguments); | |
if (value === 0 && (1 / value) < 0) { | |
return 0; | |
} | |
return value; | |
}, true); | |
} | |
addIterator(Array.prototype, function () { return this.values(); }); | |
// Chrome defines keys/values/entries on Array, but doesn't give us | |
// any way to identify its iterator. So add our own shimmed field. | |
if (Object.getPrototypeOf) { | |
var ChromeArrayIterator = Object.getPrototypeOf([].values()); | |
if (ChromeArrayIterator) { // in WSH, this is `undefined` | |
addIterator(ChromeArrayIterator); | |
} | |
} | |
// note: this is positioned here because it relies on Array#entries | |
var arrayFromSwallowsNegativeLengths = (function () { | |
// Detects a Firefox bug in v32 | |
// https://bugzilla.mozilla.org/show_bug.cgi?id=1063993 | |
return valueOrFalseIfThrows(function () { | |
return Array.from({ length: -1 }).length === 0; | |
}); | |
}()); | |
var arrayFromHandlesIterables = (function () { | |
// Detects a bug in Webkit nightly r181886 | |
var arr = Array.from([0].entries()); | |
return arr.length === 1 && isArray(arr[0]) && arr[0][0] === 0 && arr[0][1] === 0; | |
}()); | |
if (!arrayFromSwallowsNegativeLengths || !arrayFromHandlesIterables) { | |
overrideNative(Array, 'from', ArrayShims.from); | |
} | |
var arrayFromHandlesUndefinedMapFunction = (function () { | |
// Microsoft Edge v0.11 throws if the mapFn argument is *provided* but undefined, | |
// but the spec doesn't care if it's provided or not - undefined doesn't throw. | |
return valueOrFalseIfThrows(function () { | |
return Array.from([0], void 0); | |
}); | |
}()); | |
if (!arrayFromHandlesUndefinedMapFunction) { | |
var origArrayFrom = Array.from; | |
overrideNative(Array, 'from', function from(items) { | |
if (arguments.length > 1 && typeof arguments[1] !== 'undefined') { | |
return ES.Call(origArrayFrom, this, arguments); | |
} else { | |
return _call(origArrayFrom, this, items); | |
} | |
}); | |
} | |
var int32sAsOne = -(Math.pow(2, 32) - 1); | |
var toLengthsCorrectly = function (method, reversed) { | |
var obj = { length: int32sAsOne }; | |
obj[reversed ? (obj.length >>> 0) - 1 : 0] = true; | |
return valueOrFalseIfThrows(function () { | |
_call(method, obj, function () { | |
// note: in nonconforming browsers, this will be called | |
// -1 >>> 0 times, which is 4294967295, so the throw matters. | |
throw new RangeError('should not reach here'); | |
}, []); | |
return true; | |
}); | |
}; | |
if (!toLengthsCorrectly(Array.prototype.forEach)) { | |
var originalForEach = Array.prototype.forEach; | |
overrideNative(Array.prototype, 'forEach', function forEach(callbackFn) { | |
return ES.Call(originalForEach, this.length >= 0 ? this : [], arguments); | |
}); | |
} | |
if (!toLengthsCorrectly(Array.prototype.map)) { | |
var originalMap = Array.prototype.map; | |
overrideNative(Array.prototype, 'map', function map(callbackFn) { | |
return ES.Call(originalMap, this.length >= 0 ? this : [], arguments); | |
}); | |
} | |
if (!toLengthsCorrectly(Array.prototype.filter)) { | |
var originalFilter = Array.prototype.filter; | |
overrideNative(Array.prototype, 'filter', function filter(callbackFn) { | |
return ES.Call(originalFilter, this.length >= 0 ? this : [], arguments); | |
}); | |
} | |
if (!toLengthsCorrectly(Array.prototype.some)) { | |
var originalSome = Array.prototype.some; | |
overrideNative(Array.prototype, 'some', function some(callbackFn) { | |
return ES.Call(originalSome, this.length >= 0 ? this : [], arguments); | |
}); | |
} | |
if (!toLengthsCorrectly(Array.prototype.every)) { | |
var originalEvery = Array.prototype.every; | |
overrideNative(Array.prototype, 'every', function every(callbackFn) { | |
return ES.Call(originalEvery, this.length >= 0 ? this : [], arguments); | |
}); | |
} | |
if (!toLengthsCorrectly(Array.prototype.reduce)) { | |
var originalReduce = Array.prototype.reduce; | |
overrideNative(Array.prototype, 'reduce', function reduce(callbackFn) { | |
return ES.Call(originalReduce, this.length >= 0 ? this : [], arguments); | |
}); | |
} | |
if (!toLengthsCorrectly(Array.prototype.reduceRight, true)) { | |
var originalReduceRight = Array.prototype.reduceRight; | |
overrideNative(Array.prototype, 'reduceRight', function reduceRight(callbackFn) { | |
return ES.Call(originalReduceRight, this.length >= 0 ? this : [], arguments); | |
}); | |
} | |
var lacksOctalSupport = Number('0o10') !== 8; | |
var lacksBinarySupport = Number('0b10') !== 2; | |
var trimsNonWhitespace = _some(nonWS, function (c) { | |
return Number(c + 0 + c) === 0; | |
}); | |
if (lacksOctalSupport || lacksBinarySupport || trimsNonWhitespace) { | |
var OrigNumber = Number; | |
var binaryRegex = /^0b[01]+$/i; | |
var octalRegex = /^0o[0-7]+$/i; | |
// Note that in IE 8, RegExp.prototype.test doesn't seem to exist: ie, "test" is an own property of regexes. wtf. | |
var isBinary = binaryRegex.test.bind(binaryRegex); | |
var isOctal = octalRegex.test.bind(octalRegex); | |
var toPrimitive = function (O, hint) { // need to replace this with `es-to-primitive/es6` | |
var result; | |
if (typeof O.valueOf === 'function') { | |
result = O.valueOf(); | |
if (Type.primitive(result)) { | |
return result; | |
} | |
} | |
if (typeof O.toString === 'function') { | |
result = O.toString(); | |
if (Type.primitive(result)) { | |
return result; | |
} | |
} | |
throw new TypeError('No default value'); | |
}; | |
var hasNonWS = nonWSregex.test.bind(nonWSregex); | |
var isBadHex = isBadHexRegex.test.bind(isBadHexRegex); | |
var NumberShim = (function () { | |
// this is wrapped in an IIFE because of IE 6-8's wacky scoping issues with named function expressions. | |
var NumberShim = function Number(value) { | |
var primValue; | |
if (arguments.length > 0) { | |
primValue = Type.primitive(value) ? value : toPrimitive(value, 'number'); | |
} else { | |
primValue = 0; | |
} | |
if (typeof primValue === 'string') { | |
primValue = ES.Call(trimShim, primValue); | |
if (isBinary(primValue)) { | |
primValue = parseInt(_strSlice(primValue, 2), 2); | |
} else if (isOctal(primValue)) { | |
primValue = parseInt(_strSlice(primValue, 2), 8); | |
} else if (hasNonWS(primValue) || isBadHex(primValue)) { | |
primValue = NaN; | |
} | |
} | |
var receiver = this; | |
var valueOfSucceeds = valueOrFalseIfThrows(function () { | |
OrigNumber.prototype.valueOf.call(receiver); | |
return true; | |
}); | |
if (receiver instanceof NumberShim && !valueOfSucceeds) { | |
return new OrigNumber(primValue); | |
} | |
return OrigNumber(primValue); | |
}; | |
return NumberShim; | |
}()); | |
wrapConstructor(OrigNumber, NumberShim, {}); | |
// this is necessary for ES3 browsers, where these properties are non-enumerable. | |
defineProperties(NumberShim, { | |
NaN: OrigNumber.NaN, | |
MAX_VALUE: OrigNumber.MAX_VALUE, | |
MIN_VALUE: OrigNumber.MIN_VALUE, | |
NEGATIVE_INFINITY: OrigNumber.NEGATIVE_INFINITY, | |
POSITIVE_INFINITY: OrigNumber.POSITIVE_INFINITY | |
}); | |
/* eslint-disable no-undef, no-global-assign */ | |
Number = NumberShim; | |
Value.redefine(globals, 'Number', NumberShim); | |
/* eslint-enable no-undef, no-global-assign */ | |
} | |
var maxSafeInteger = Math.pow(2, 53) - 1; | |
defineProperties(Number, { | |
MAX_SAFE_INTEGER: maxSafeInteger, | |
MIN_SAFE_INTEGER: -maxSafeInteger, | |
EPSILON: 2.220446049250313e-16, | |
parseInt: globals.parseInt, | |
parseFloat: globals.parseFloat, | |
isFinite: numberIsFinite, | |
isInteger: function isInteger(value) { | |
return numberIsFinite(value) && ES.ToInteger(value) === value; | |
}, | |
isSafeInteger: function isSafeInteger(value) { | |
return Number.isInteger(value) && _abs(value) <= Number.MAX_SAFE_INTEGER; | |
}, | |
isNaN: numberIsNaN | |
}); | |
// Firefox 37 has a conforming Number.parseInt, but it's not === to the global parseInt (fixed in v40) | |
defineProperty(Number, 'parseInt', globals.parseInt, Number.parseInt !== globals.parseInt); | |
// Work around bugs in Array#find and Array#findIndex -- early | |
// implementations skipped holes in sparse arrays. (Note that the | |
// implementations of find/findIndex indirectly use shimmed | |
// methods of Number, so this test has to happen down here.) | |
/* eslint-disable no-sparse-arrays */ | |
if ([, 1].find(function () { return true; }) === 1) { | |
overrideNative(Array.prototype, 'find', ArrayPrototypeShims.find); | |
} | |
if ([, 1].findIndex(function () { return true; }) !== 0) { | |
overrideNative(Array.prototype, 'findIndex', ArrayPrototypeShims.findIndex); | |
} | |
/* eslint-enable no-sparse-arrays */ | |
var isEnumerableOn = Function.bind.call(Function.bind, Object.prototype.propertyIsEnumerable); | |
var ensureEnumerable = function ensureEnumerable(obj, prop) { | |
if (supportsDescriptors && isEnumerableOn(obj, prop)) { | |
Object.defineProperty(obj, prop, { enumerable: false }); | |
} | |
}; | |
var sliceArgs = function sliceArgs() { | |
// per https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments | |
// and https://gist.github.com/WebReflection/4327762cb87a8c634a29 | |
var initial = Number(this); | |
var len = arguments.length; | |
var desiredArgCount = len - initial; | |
var args = new Array(desiredArgCount < 0 ? 0 : desiredArgCount); | |
for (var i = initial; i < len; ++i) { | |
args[i - initial] = arguments[i]; | |
} | |
return args; | |
}; | |
var assignTo = function assignTo(source) { | |
return function assignToSource(target, key) { | |
target[key] = source[key]; | |
return target; | |
}; | |
}; | |
var assignReducer = function (target, source) { | |
var sourceKeys = keys(Object(source)); | |
var symbols; | |
if (ES.IsCallable(Object.getOwnPropertySymbols)) { | |
symbols = _filter(Object.getOwnPropertySymbols(Object(source)), isEnumerableOn(source)); | |
} | |
return _reduce(_concat(sourceKeys, symbols || []), assignTo(source), target); | |
}; | |
var ObjectShims = { | |
// 19.1.3.1 | |
assign: function (target, source) { | |
var to = ES.ToObject(target, 'Cannot convert undefined or null to object'); | |
return _reduce(ES.Call(sliceArgs, 1, arguments), assignReducer, to); | |
}, | |
// Added in WebKit in https://bugs.webkit.org/show_bug.cgi?id=143865 | |
is: function is(a, b) { | |
return ES.SameValue(a, b); | |
} | |
}; | |
var assignHasPendingExceptions = Object.assign && Object.preventExtensions && (function () { | |
// Firefox 37 still has "pending exception" logic in its Object.assign implementation, | |
// which is 72% slower than our shim, and Firefox 40's native implementation. | |
var thrower = Object.preventExtensions({ 1: 2 }); | |
try { | |
Object.assign(thrower, 'xy'); | |
} catch (e) { | |
return thrower[1] === 'y'; | |
} | |
}()); | |
if (assignHasPendingExceptions) { | |
overrideNative(Object, 'assign', ObjectShims.assign); | |
} | |
defineProperties(Object, ObjectShims); | |
if (supportsDescriptors) { | |
var ES5ObjectShims = { | |
// 19.1.3.9 | |
// shim from https://gist.github.com/WebReflection/5593554 | |
setPrototypeOf: (function (Object, magic) { | |
var set; | |
var checkArgs = function (O, proto) { | |
if (!ES.TypeIsObject(O)) { | |
throw new TypeError('cannot set prototype on a non-object'); | |
} | |
if (!(proto === null || ES.TypeIsObject(proto))) { | |
throw new TypeError('can only set prototype to an object or null' + proto); | |
} | |
}; | |
var setPrototypeOf = function (O, proto) { | |
checkArgs(O, proto); | |
_call(set, O, proto); | |
return O; | |
}; | |
try { | |
// this works already in Firefox and Safari | |
set = Object.getOwnPropertyDescriptor(Object.prototype, magic).set; | |
_call(set, {}, null); | |
} catch (e) { | |
if (Object.prototype !== {}[magic]) { | |
// IE < 11 cannot be shimmed | |
return; | |
} | |
// probably Chrome or some old Mobile stock browser | |
set = function (proto) { | |
this[magic] = proto; | |
}; | |
// please note that this will **not** work | |
// in those browsers that do not inherit | |
// __proto__ by mistake from Object.prototype | |
// in these cases we should probably throw an error | |
// or at least be informed about the issue | |
setPrototypeOf.polyfill = setPrototypeOf( | |
setPrototypeOf({}, null), | |
Object.prototype | |
) instanceof Object; | |
// setPrototypeOf.polyfill === true means it works as meant | |
// setPrototypeOf.polyfill === false means it's not 100% reliable | |
// setPrototypeOf.polyfill === undefined | |
// or | |
// setPrototypeOf.polyfill == null means it's not a polyfill | |
// which means it works as expected | |
// we can even delete Object.prototype.__proto__; | |
} | |
return setPrototypeOf; | |
}(Object, '__proto__')) | |
}; | |
defineProperties(Object, ES5ObjectShims); | |
} | |
// Workaround bug in Opera 12 where setPrototypeOf(x, null) doesn't work, | |
// but Object.create(null) does. | |
if (Object.setPrototypeOf && Object.getPrototypeOf && | |
Object.getPrototypeOf(Object.setPrototypeOf({}, null)) !== null && | |
Object.getPrototypeOf(Object.create(null)) === null) { | |
(function () { | |
var FAKENULL = Object.create(null); | |
var gpo = Object.getPrototypeOf; | |
var spo = Object.setPrototypeOf; | |
Object.getPrototypeOf = function (o) { | |
var result = gpo(o); | |
return result === FAKENULL ? null : result; | |
}; | |
Object.setPrototypeOf = function (o, p) { | |
var proto = p === null ? FAKENULL : p; | |
return spo(o, proto); | |
}; | |
Object.setPrototypeOf.polyfill = false; | |
}()); | |
} | |
var objectKeysAcceptsPrimitives = !throwsError(function () { return Object.keys('foo'); }); | |
if (!objectKeysAcceptsPrimitives) { | |
var originalObjectKeys = Object.keys; | |
overrideNative(Object, 'keys', function keys(value) { | |
return originalObjectKeys(ES.ToObject(value)); | |
}); | |
keys = Object.keys; | |
} | |
var objectKeysRejectsRegex = throwsError(function () { return Object.keys(/a/g); }); | |
if (objectKeysRejectsRegex) { | |
var regexRejectingObjectKeys = Object.keys; | |
overrideNative(Object, 'keys', function keys(value) { | |
if (Type.regex(value)) { | |
var regexKeys = []; | |
for (var k in value) { | |
if (_hasOwnProperty(value, k)) { | |
_push(regexKeys, k); | |
} | |
} | |
return regexKeys; | |
} | |
return regexRejectingObjectKeys(value); | |
}); | |
keys = Object.keys; | |
} | |
if (Object.getOwnPropertyNames) { | |
var objectGOPNAcceptsPrimitives = !throwsError(function () { return Object.getOwnPropertyNames('foo'); }); | |
if (!objectGOPNAcceptsPrimitives) { | |
var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : []; | |
var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; | |
overrideNative(Object, 'getOwnPropertyNames', function getOwnPropertyNames(value) { | |
var val = ES.ToObject(value); | |
if (_toString(val) === '[object Window]') { | |
try { | |
return originalObjectGetOwnPropertyNames(val); | |
} catch (e) { | |
// IE bug where layout engine calls userland gOPN for cross-domain `window` objects | |
return _concat([], cachedWindowNames); | |
} | |
} | |
return originalObjectGetOwnPropertyNames(val); | |
}); | |
} | |
} | |
if (Object.getOwnPropertyDescriptor) { | |
var objectGOPDAcceptsPrimitives = !throwsError(function () { return Object.getOwnPropertyDescriptor('foo', 'bar'); }); | |
if (!objectGOPDAcceptsPrimitives) { | |
var originalObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; | |
overrideNative(Object, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(value, property) { | |
return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value), property); | |
}); | |
} | |
} | |
if (Object.seal) { | |
var objectSealAcceptsPrimitives = !throwsError(function () { return Object.seal('foo'); }); | |
if (!objectSealAcceptsPrimitives) { | |
var originalObjectSeal = Object.seal; | |
overrideNative(Object, 'seal', function seal(value) { | |
if (!ES.TypeIsObject(value)) { return value; } | |
return originalObjectSeal(value); | |
}); | |
} | |
} | |
if (Object.isSealed) { | |
var objectIsSealedAcceptsPrimitives = !throwsError(function () { return Object.isSealed('foo'); }); | |
if (!objectIsSealedAcceptsPrimitives) { | |
var originalObjectIsSealed = Object.isSealed; | |
overrideNative(Object, 'isSealed', function isSealed(value) { | |
if (!ES.TypeIsObject(value)) { return true; } | |
return originalObjectIsSealed(value); | |
}); | |
} | |
} | |
if (Object.freeze) { | |
var objectFreezeAcceptsPrimitives = !throwsError(function () { return Object.freeze('foo'); }); | |
if (!objectFreezeAcceptsPrimitives) { | |
var originalObjectFreeze = Object.freeze; | |
overrideNative(Object, 'freeze', function freeze(value) { | |
if (!ES.TypeIsObject(value)) { return value; } | |
return originalObjectFreeze(value); | |
}); | |
} | |
} | |
if (Object.isFrozen) { | |
var objectIsFrozenAcceptsPrimitives = !throwsError(function () { return Object.isFrozen('foo'); }); | |
if (!objectIsFrozenAcceptsPrimitives) { | |
var originalObjectIsFrozen = Object.isFrozen; | |
overrideNative(Object, 'isFrozen', function isFrozen(value) { | |
if (!ES.TypeIsObject(value)) { return true; } | |
return originalObjectIsFrozen(value); | |
}); | |
} | |
} | |
if (Object.preventExtensions) { | |
var objectPreventExtensionsAcceptsPrimitives = !throwsError(function () { return Object.preventExtensions('foo'); }); | |
if (!objectPreventExtensionsAcceptsPrimitives) { | |
var originalObjectPreventExtensions = Object.preventExtensions; | |
overrideNative(Object, 'preventExtensions', function preventExtensions(value) { | |
if (!ES.TypeIsObject(value)) { return value; } | |
return originalObjectPreventExtensions(value); | |
}); | |
} | |
} | |
if (Object.isExtensible) { | |
var objectIsExtensibleAcceptsPrimitives = !throwsError(function () { return Object.isExtensible('foo'); }); | |
if (!objectIsExtensibleAcceptsPrimitives) { | |
var originalObjectIsExtensible = Object.isExtensible; | |
overrideNative(Object, 'isExtensible', function isExtensible(value) { | |
if (!ES.TypeIsObject(value)) { return false; } | |
return originalObjectIsExtensible(value); | |
}); | |
} | |
} | |
if (Object.getPrototypeOf) { | |
var objectGetProtoAcceptsPrimitives = !throwsError(function () { return Object.getPrototypeOf('foo'); }); | |
if (!objectGetProtoAcceptsPrimitives) { | |
var originalGetProto = Object.getPrototypeOf; | |
overrideNative(Object, 'getPrototypeOf', function getPrototypeOf(value) { | |
return originalGetProto(ES.ToObject(value)); | |
}); | |
} | |
} | |
var hasFlags = supportsDescriptors && (function () { | |
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags'); | |
return desc && ES.IsCallable(desc.get); | |
}()); | |
if (supportsDescriptors && !hasFlags) { | |
var regExpFlagsGetter = function flags() { | |
if (!ES.TypeIsObject(this)) { | |
throw new TypeError('Method called on incompatible type: must be an object.'); | |
} | |
var result = ''; | |
if (this.global) { | |
result += 'g'; | |
} | |
if (this.ignoreCase) { | |
result += 'i'; | |
} | |
if (this.multiline) { | |
result += 'm'; | |
} | |
if (this.unicode) { | |
result += 'u'; | |
} | |
if (this.sticky) { | |
result += 'y'; | |
} | |
return result; | |
}; | |
Value.getter(RegExp.prototype, 'flags', regExpFlagsGetter); | |
} | |
var regExpSupportsFlagsWithRegex = supportsDescriptors && valueOrFalseIfThrows(function () { | |
return String(new RegExp(/a/g, 'i')) === '/a/i'; | |
}); | |
var regExpNeedsToSupportSymbolMatch = hasSymbols && supportsDescriptors && (function () { | |
// Edge 0.12 supports flags fully, but does not support Symbol.match | |
var regex = /./; | |
regex[Symbol.match] = false; | |
return RegExp(regex) === regex; | |
}()); | |
var regexToStringIsGeneric = valueOrFalseIfThrows(function () { | |
return RegExp.prototype.toString.call({ source: 'abc' }) === '/abc/'; | |
}); | |
var regexToStringSupportsGenericFlags = regexToStringIsGeneric && valueOrFalseIfThrows(function () { | |
return RegExp.prototype.toString.call({ source: 'a', flags: 'b' }) === '/a/b'; | |
}); | |
if (!regexToStringIsGeneric || !regexToStringSupportsGenericFlags) { | |
var origRegExpToString = RegExp.prototype.toString; | |
defineProperty(RegExp.prototype, 'toString', function toString() { | |
var R = ES.RequireObjectCoercible(this); | |
if (Type.regex(R)) { | |
return _call(origRegExpToString, R); | |
} | |
var pattern = $String(R.source); | |
var flags = $String(R.flags); | |
return '/' + pattern + '/' + flags; | |
}, true); | |
Value.preserveToString(RegExp.prototype.toString, origRegExpToString); | |
} | |
if (supportsDescriptors && (!regExpSupportsFlagsWithRegex || regExpNeedsToSupportSymbolMatch)) { | |
var flagsGetter = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get; | |
var sourceDesc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source') || {}; | |
var legacySourceGetter = function () { | |
// prior to it being a getter, it's own + nonconfigurable | |
return this.source; | |
}; | |
var sourceGetter = ES.IsCallable(sourceDesc.get) ? sourceDesc.get : legacySourceGetter; | |
var OrigRegExp = RegExp; | |
var RegExpShim = (function () { | |
return function RegExp(pattern, flags) { | |
var patternIsRegExp = ES.IsRegExp(pattern); | |
var calledWithNew = this instanceof RegExp; | |
if (!calledWithNew && patternIsRegExp && typeof flags === 'undefined' && pattern.constructor === RegExp) { | |
return pattern; | |
} | |
var P = pattern; | |
var F = flags; | |
if (Type.regex(pattern)) { | |
P = ES.Call(sourceGetter, pattern); | |
F = typeof flags === 'undefined' ? ES.Call(flagsGetter, pattern) : flags; | |
return new RegExp(P, F); | |
} else if (patternIsRegExp) { | |
P = pattern.source; | |
F = typeof flags === 'undefined' ? pattern.flags : flags; | |
} | |
return new OrigRegExp(pattern, flags); | |
}; | |
}()); | |
wrapConstructor(OrigRegExp, RegExpShim, { | |
$input: true // Chrome < v39 & Opera < 26 have a nonstandard "$input" property | |
}); | |
/* eslint-disable no-undef, no-global-assign */ | |
RegExp = RegExpShim; | |
Value.redefine(globals, 'RegExp', RegExpShim); | |
/* eslint-enable no-undef, no-global-assign */ | |
} | |
if (supportsDescriptors) { | |
var regexGlobals = { | |
input: '$_', | |
lastMatch: '$&', | |
lastParen: '$+', | |
leftContext: '$`', | |
rightContext: '$\'' | |
}; | |
_forEach(keys(regexGlobals), function (prop) { | |
if (prop in RegExp && !(regexGlobals[prop] in RegExp)) { | |
Value.getter(RegExp, regexGlobals[prop], function get() { | |
return RegExp[prop]; | |
}); | |
} | |
}); | |
} | |
addDefaultSpecies(RegExp); | |
var inverseEpsilon = 1 / Number.EPSILON; | |
var roundTiesToEven = function roundTiesToEven(n) { | |
// Even though this reduces down to `return n`, it takes advantage of built-in rounding. | |
return (n + inverseEpsilon) - inverseEpsilon; | |
}; | |
var BINARY_32_EPSILON = Math.pow(2, -23); | |
var BINARY_32_MAX_VALUE = Math.pow(2, 127) * (2 - BINARY_32_EPSILON); | |
var BINARY_32_MIN_VALUE = Math.pow(2, -126); | |
var E = Math.E; | |
var LOG2E = Math.LOG2E; | |
var LOG10E = Math.LOG10E; | |
var numberCLZ = Number.prototype.clz; | |
delete Number.prototype.clz; // Safari 8 has Number#clz | |
var MathShims = { | |
acosh: function acosh(value) { | |
var x = Number(value); | |
if (numberIsNaN(x) || value < 1) { return NaN; } | |
if (x === 1) { return 0; } | |
if (x === Infinity) { return x; } | |
var xInvSquared = 1 / (x * x); | |
if (x < 2) { | |
return _log1p(x - 1 + (_sqrt(1 - xInvSquared) * x)); | |
} | |
var halfX = x / 2; | |
return _log1p(halfX + (_sqrt(1 - xInvSquared) * halfX) - 1) + (1 / LOG2E); | |
}, | |
asinh: function asinh(value) { | |
var x = Number(value); | |
if (x === 0 || !globalIsFinite(x)) { | |
return x; | |
} | |
var a = _abs(x); | |
var aSquared = a * a; | |
var s = _sign(x); | |
if (a < 1) { | |
return s * _log1p(a + (aSquared / (_sqrt(aSquared + 1) + 1))); | |
} | |
return s * (_log1p((a / 2) + (_sqrt(1 + (1 / aSquared)) * a / 2) - 1) + (1 / LOG2E)); | |
}, | |
atanh: function atanh(value) { | |
var x = Number(value); | |
if (x === 0) { return x; } | |
if (x === -1) { return -Infinity; } | |
if (x === 1) { return Infinity; } | |
if (numberIsNaN(x) || x < -1 || x > 1) { | |
return NaN; | |
} | |
var a = _abs(x); | |
return _sign(x) * _log1p(2 * a / (1 - a)) / 2; | |
}, | |
cbrt: function cbrt(value) { | |
var x = Number(value); | |
if (x === 0) { return x; } | |
var negate = x < 0; | |
var result; | |
if (negate) { x = -x; } | |
if (x === Infinity) { | |
result = Infinity; | |
} else { | |
result = _exp(_log(x) / 3); | |
// from http://en.wikipedia.org/wiki/Cube_root#Numerical_methods | |
result = ((x / (result * result)) + (2 * result)) / 3; | |
} | |
return negate ? -result : result; | |
}, | |
clz32: function clz32(value) { | |
// See https://bugs.ecmascript.org/show_bug.cgi?id=2465 | |
var x = Number(value); | |
var number = ES.ToUint32(x); | |
if (number === 0) { | |
return 32; | |
} | |
return numberCLZ ? ES.Call(numberCLZ, number) : 31 - _floor(_log(number + 0.5) * LOG2E); | |
}, | |
cosh: function cosh(value) { | |
var x = Number(value); | |
if (x === 0) { return 1; } // +0 or -0 | |
if (numberIsNaN(x)) { return NaN; } | |
if (!globalIsFinite(x)) { return Infinity; } | |
var t = _exp(_abs(x) - 1); | |
return (t + (1 / (t * E * E))) * (E / 2); | |
}, | |
expm1: function expm1(value) { | |
var x = Number(value); | |
if (x === -Infinity) { return -1; } | |
if (!globalIsFinite(x) || x === 0) { return x; } | |
if (_abs(x) > 0.5) { | |
return _exp(x) - 1; | |
} | |
// A more precise approximation using Taylor series expansion | |
// from https://github.com/paulmillr/es6-shim/issues/314#issuecomment-70293986 | |
var t = x; | |
var sum = 0; | |
var n = 1; | |
while (sum + t !== sum) { | |
sum += t; | |
n += 1; | |
t *= x / n; | |
} | |
return sum; | |
}, | |
hypot: function hypot(x, y) { | |
var result = 0; | |
var largest = 0; | |
for (var i = 0; i < arguments.length; ++i) { | |
var value = _abs(Number(arguments[i])); | |
if (largest < value) { | |
result *= (largest / value) * (largest / value); | |
result += 1; | |
largest = value; | |
} else { | |
result += value > 0 ? (value / largest) * (value / largest) : value; | |
} | |
} | |
return largest === Infinity ? Infinity : largest * _sqrt(result); | |
}, | |
log2: function log2(value) { | |
return _log(value) * LOG2E; | |
}, | |
log10: function log10(value) { | |
return _log(value) * LOG10E; | |
}, | |
log1p: _log1p, | |
sign: _sign, | |
sinh: function sinh(value) { | |
var x = Number(value); | |
if (!globalIsFinite(x) || x === 0) { return x; } | |
var a = _abs(x); | |
if (a < 1) { | |
var u = Math.expm1(a); | |
return _sign(x) * u * (1 + (1 / (u + 1))) / 2; | |
} | |
var t = _exp(a - 1); | |
return _sign(x) * (t - (1 / (t * E * E))) * (E / 2); | |
}, | |
tanh: function tanh(value) { | |
var x = Number(value); | |
if (numberIsNaN(x) || x === 0) { return x; } | |
// can exit early at +-20 as JS loses precision for true value at this integer | |
if (x >= 20) { return 1; } | |
if (x <= -20) { return -1; } | |
return (Math.expm1(x) - Math.expm1(-x)) / (_exp(x) + _exp(-x)); | |
}, | |
trunc: function trunc(value) { | |
var x = Number(value); | |
return x < 0 ? -_floor(-x) : _floor(x); | |
}, | |
imul: function imul(x, y) { | |
// taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul | |
var a = ES.ToUint32(x); | |
var b = ES.ToUint32(y); | |
var ah = (a >>> 16) & 0xffff; | |
var al = a & 0xffff; | |
var bh = (b >>> 16) & 0xffff; | |
var bl = b & 0xffff; | |
// the shift by 0 fixes the sign on the high part | |
// the final |0 converts the unsigned value into a signed value | |
return (al * bl) + ((((ah * bl) + (al * bh)) << 16) >>> 0) | 0; | |
}, | |
fround: function fround(x) { | |
var v = Number(x); | |
if (v === 0 || v === Infinity || v === -Infinity || numberIsNaN(v)) { | |
return v; | |
} | |
var sign = _sign(v); | |
var abs = _abs(v); | |
if (abs < BINARY_32_MIN_VALUE) { | |
return sign * roundTiesToEven(abs / BINARY_32_MIN_VALUE / BINARY_32_EPSILON) * BINARY_32_MIN_VALUE * BINARY_32_EPSILON; | |
} | |
// Veltkamp's splitting (?) | |
var a = (1 + (BINARY_32_EPSILON / Number.EPSILON)) * abs; | |
var result = a - (a - abs); | |
if (result > BINARY_32_MAX_VALUE || numberIsNaN(result)) { | |
return sign * Infinity; | |
} | |
return sign * result; | |
} | |
}; | |
var withinULPDistance = function withinULPDistance(result, expected, distance) { | |
return _abs(1 - (result / expected)) / Number.EPSILON < (distance || 8); | |
}; | |
defineProperties(Math, MathShims); | |
// Chrome < 40 sinh returns ∞ for large numbers | |
defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(710) === Infinity); | |
// Chrome < 40 cosh returns ∞ for large numbers | |
defineProperty(Math, 'cosh', MathShims.cosh, Math.cosh(710) === Infinity); | |
// IE 11 TP has an imprecise log1p: reports Math.log1p(-1e-17) as 0 | |
defineProperty(Math, 'log1p', MathShims.log1p, Math.log1p(-1e-17) !== -1e-17); | |
// IE 11 TP has an imprecise asinh: reports Math.asinh(-1e7) as not exactly equal to -Math.asinh(1e7) | |
defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(-1e7) !== -Math.asinh(1e7)); | |
// Chrome < 54 asinh returns ∞ for large numbers and should not | |
defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(1e+300) === Infinity); | |
// Chrome < 54 atanh incorrectly returns 0 for large numbers | |
defineProperty(Math, 'atanh', MathShims.atanh, Math.atanh(1e-300) === 0); | |
// Chrome 40 has an imprecise Math.tanh with very small numbers | |
defineProperty(Math, 'tanh', MathShims.tanh, Math.tanh(-2e-17) !== -2e-17); | |
// Chrome 40 loses Math.acosh precision with high numbers | |
defineProperty(Math, 'acosh', MathShims.acosh, Math.acosh(Number.MAX_VALUE) === Infinity); | |
// Chrome < 54 has an inaccurate acosh for EPSILON deltas | |
defineProperty(Math, 'acosh', MathShims.acosh, !withinULPDistance(Math.acosh(1 + Number.EPSILON), Math.sqrt(2 * Number.EPSILON))); | |
// Firefox 38 on Windows | |
defineProperty(Math, 'cbrt', MathShims.cbrt, !withinULPDistance(Math.cbrt(1e-300), 1e-100)); | |
// node 0.11 has an imprecise Math.sinh with very small numbers | |
defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(-2e-17) !== -2e-17); | |
// FF 35 on Linux reports 22025.465794806725 for Math.expm1(10) | |
var expm1OfTen = Math.expm1(10); | |
defineProperty(Math, 'expm1', MathShims.expm1, expm1OfTen > 22025.465794806719 || expm1OfTen < 22025.4657948067165168); | |
// node v12.11 - v12.15 report NaN | |
defineProperty(Math, 'hypot', MathShims.hypot, Math.hypot(Infinity, NaN) !== Infinity); | |
var origMathRound = Math.round; | |
// breaks in e.g. Safari 8, Internet Explorer 11, Opera 12 | |
var roundHandlesBoundaryConditions = Math.round(0.5 - (Number.EPSILON / 4)) === 0 && | |
Math.round(-0.5 + (Number.EPSILON / 3.99)) === 1; | |
// When engines use Math.floor(x + 0.5) internally, Math.round can be buggy for large integers. | |
// This behavior should be governed by "round to nearest, ties to even mode" | |
// see http://www.ecma-international.org/ecma-262/6.0/#sec-terms-and-definitions-number-type | |
// These are the boundary cases where it breaks. | |
var smallestPositiveNumberWhereRoundBreaks = inverseEpsilon + 1; | |
var largestPositiveNumberWhereRoundBreaks = (2 * inverseEpsilon) - 1; | |
var roundDoesNotIncreaseIntegers = [ | |
smallestPositiveNumberWhereRoundBreaks, | |
largestPositiveNumberWhereRoundBreaks | |
].every(function (num) { | |
return Math.round(num) === num; | |
}); | |
defineProperty(Math, 'round', function round(x) { | |
var floor = _floor(x); | |
var ceil = floor === -1 ? -0 : floor + 1; | |
return x - floor < 0.5 ? floor : ceil; | |
}, !roundHandlesBoundaryConditions || !roundDoesNotIncreaseIntegers); | |
Value.preserveToString(Math.round, origMathRound); | |
var origImul = Math.imul; | |
if (Math.imul(0xffffffff, 5) !== -5) { | |
// Safari 6.1, at least, reports "0" for this value | |
Math.imul = MathShims.imul; | |
Value.preserveToString(Math.imul, origImul); | |
} | |
if (Math.imul.length !== 2) { | |
// Safari 8.0.4 has a length of 1 | |
// fixed in https://bugs.webkit.org/show_bug.cgi?id=143658 | |
overrideNative(Math, 'imul', function imul(x, y) { | |
return ES.Call(origImul, Math, arguments); | |
}); | |
} | |
// Promises | |
// Simplest possible implementation; use a 3rd-party library if you | |
// want the best possible speed and/or long stack traces. | |
var PromiseShim = (function () { | |
var setTimeout = globals.setTimeout; | |
// some environments don't have setTimeout - no way to shim here. | |
if (typeof setTimeout !== 'function' && typeof setTimeout !== 'object') { return; } | |
ES.IsPromise = function (promise) { | |
if (!ES.TypeIsObject(promise)) { | |
return false; | |
} | |
if (typeof promise._promise === 'undefined') { | |
return false; // uninitialized, or missing our hidden field. | |
} | |
return true; | |
}; | |
// "PromiseCapability" in the spec is what most promise implementations | |
// call a "deferred". | |
var PromiseCapability = function (C) { | |
if (!ES.IsConstructor(C)) { | |
throw new TypeError('Bad promise constructor'); | |
} | |
var capability = this; | |
var resolver = function (resolve, reject) { | |
if (capability.resolve !== void 0 || capability.reject !== void 0) { | |
throw new TypeError('Bad Promise implementation!'); | |
} | |
capability.resolve = resolve; | |
capability.reject = reject; | |
}; | |
// Initialize fields to inform optimizers about the object shape. | |
capability.resolve = void 0; | |
capability.reject = void 0; | |
capability.promise = new C(resolver); | |
if (!(ES.IsCallable(capability.resolve) && ES.IsCallable(capability.reject))) { | |
throw new TypeError('Bad promise constructor'); | |
} | |
}; | |
// find an appropriate setImmediate-alike | |
var makeZeroTimeout; | |
if (typeof window !== 'undefined' && ES.IsCallable(window.postMessage)) { | |
makeZeroTimeout = function () { | |
// from http://dbaron.org/log/20100309-faster-timeouts | |
var timeouts = []; | |
var messageName = 'zero-timeout-message'; | |
var setZeroTimeout = function (fn) { | |
_push(timeouts, fn); | |
window.postMessage(messageName, '*'); | |
}; | |
var handleMessage = function (event) { | |
if (event.source === window && event.data === messageName) { | |
event.stopPropagation(); | |
if (timeouts.length === 0) { return; } | |
var fn = _shift(timeouts); | |
fn(); | |
} | |
}; | |
window.addEventListener('message', handleMessage, true); | |
return setZeroTimeout; | |
}; | |
} | |
var makePromiseAsap = function () { | |
// An efficient task-scheduler based on a pre-existing Promise | |
// implementation, which we can use even if we override the | |
// global Promise below (in order to workaround bugs) | |
// https://github.com/Raynos/observ-hash/issues/2#issuecomment-35857671 | |
var P = globals.Promise; | |
var pr = P && P.resolve && P.resolve(); | |
return pr && function (task) { | |
return pr.then(task); | |
}; | |
}; | |
var enqueue = ES.IsCallable(globals.setImmediate) ? | |
globals.setImmediate : | |
typeof process === 'object' && process.nextTick ? process.nextTick : makePromiseAsap() || | |
(ES.IsCallable(makeZeroTimeout) ? makeZeroTimeout() : function (task) { setTimeout(task, 0); }); // fallback | |
// Constants for Promise implementation | |
var PROMISE_IDENTITY = function (x) { return x; }; | |
var PROMISE_THROWER = function (e) { throw e; }; | |
var PROMISE_PENDING = 0; | |
var PROMISE_FULFILLED = 1; | |
var PROMISE_REJECTED = 2; | |
// We store fulfill/reject handlers and capabilities in a single array. | |
var PROMISE_FULFILL_OFFSET = 0; | |
var PROMISE_REJECT_OFFSET = 1; | |
var PROMISE_CAPABILITY_OFFSET = 2; | |
// This is used in an optimization for chaining promises via then. | |
var PROMISE_FAKE_CAPABILITY = {}; | |
var enqueuePromiseReactionJob = function (handler, capability, argument) { | |
enqueue(function () { | |
promiseReactionJob(handler, capability, argument); | |
}); | |
}; | |
var promiseReactionJob = function (handler, promiseCapability, argument) { | |
var handlerResult, f; | |
if (promiseCapability === PROMISE_FAKE_CAPABILITY) { | |
// Fast case, when we don't actually need to chain through to a | |
// (real) promiseCapability. | |
return handler(argument); | |
} | |
try { | |
handlerResult = handler(argument); | |
f = promiseCapability.resolve; | |
} catch (e) { | |
handlerResult = e; | |
f = promiseCapability.reject; | |
} | |
f(handlerResult); | |
}; | |
var fulfillPromise = function (promise, value) { | |
var _promise = promise._promise; | |
var length = _promise.reactionLength; | |
if (length > 0) { | |
enqueuePromiseReactionJob( | |
_promise.fulfillReactionHandler0, | |
_promise.reactionCapability0, | |
value | |
); | |
_promise.fulfillReactionHandler0 = void 0; | |
_promise.rejectReactions0 = void 0; | |
_promise.reactionCapability0 = void 0; | |
if (length > 1) { | |
for (var i = 1, idx = 0; i < length; i++, idx += 3) { | |
enqueuePromiseReactionJob( | |
_promise[idx + PROMISE_FULFILL_OFFSET], | |
_promise[idx + PROMISE_CAPABILITY_OFFSET], | |
value | |
); | |
promise[idx + PROMISE_FULFILL_OFFSET] = void 0; | |
promise[idx + PROMISE_REJECT_OFFSET] = void 0; | |
promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; | |
} | |
} | |
} | |
_promise.result = value; | |
_promise.state = PROMISE_FULFILLED; | |
_promise.reactionLength = 0; | |
}; | |
var rejectPromise = function (promise, reason) { | |
var _promise = promise._promise; | |
var length = _promise.reactionLength; | |
if (length > 0) { | |
enqueuePromiseReactionJob( | |
_promise.rejectReactionHandler0, | |
_promise.reactionCapability0, | |
reason | |
); | |
_promise.fulfillReactionHandler0 = void 0; | |
_promise.rejectReactions0 = void 0; | |
_promise.reactionCapability0 = void 0; | |
if (length > 1) { | |
for (var i = 1, idx = 0; i < length; i++, idx += 3) { | |
enqueuePromiseReactionJob( | |
_promise[idx + PROMISE_REJECT_OFFSET], | |
_promise[idx + PROMISE_CAPABILITY_OFFSET], | |
reason | |
); | |
promise[idx + PROMISE_FULFILL_OFFSET] = void 0; | |
promise[idx + PROMISE_REJECT_OFFSET] = void 0; | |
promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; | |
} | |
} | |
} | |
_promise.result = reason; | |
_promise.state = PROMISE_REJECTED; | |
_promise.reactionLength = 0; | |
}; | |
var createResolvingFunctions = function (promise) { | |
var alreadyResolved = false; | |
var resolve = function (resolution) { | |
var then; | |
if (alreadyResolved) { return; } | |
alreadyResolved = true; | |
if (resolution === promise) { | |
return rejectPromise(promise, new TypeError('Self resolution')); | |
} | |
if (!ES.TypeIsObject(resolution)) { | |
return fulfillPromise(promise, resolution); | |
} | |
try { | |
then = resolution.then; | |
} catch (e) { | |
return rejectPromise(promise, e); | |
} | |
if (!ES.IsCallable(then)) { | |
return fulfillPromise(promise, resolution); | |
} | |
enqueue(function () { | |
promiseResolveThenableJob(promise, resolution, then); | |
}); | |
}; | |
var reject = function (reason) { | |
if (alreadyResolved) { return; } | |
alreadyResolved = true; | |
return rejectPromise(promise, reason); | |
}; | |
return { resolve: resolve, reject: reject }; | |
}; | |
var optimizedThen = function (then, thenable, resolve, reject) { | |
// Optimization: since we discard the result, we can pass our | |
// own then implementation a special hint to let it know it | |
// doesn't have to create it. (The PROMISE_FAKE_CAPABILITY | |
// object is local to this implementation and unforgeable outside.) | |
if (then === Promise$prototype$then) { | |
_call(then, thenable, resolve, reject, PROMISE_FAKE_CAPABILITY); | |
} else { | |
_call(then, thenable, resolve, reject); | |
} | |
}; | |
var promiseResolveThenableJob = function (promise, thenable, then) { | |
var resolvingFunctions = createResolvingFunctions(promise); | |
var resolve = resolvingFunctions.resolve; | |
var reject = resolvingFunctions.reject; | |
try { | |
optimizedThen(then, thenable, resolve, reject); | |
} catch (e) { | |
reject(e); | |
} | |
}; | |
var Promise$prototype, Promise$prototype$then; | |
var Promise = (function () { | |
var PromiseShim = function Promise(resolver) { | |
if (!(this instanceof PromiseShim)) { | |
throw new TypeError('Constructor Promise requires "new"'); | |
} | |
if (this && this._promise) { | |
throw new TypeError('Bad construction'); | |
} | |
// see https://bugs.ecmascript.org/show_bug.cgi?id=2482 | |
if (!ES.IsCallable(resolver)) { | |
throw new TypeError('not a valid resolver'); | |
} | |
var promise = emulateES6construct(this, PromiseShim, Promise$prototype, { | |
_promise: { | |
result: void 0, | |
state: PROMISE_PENDING, | |
// The first member of the "reactions" array is inlined here, | |
// since most promises only have one reaction. | |
// We've also exploded the 'reaction' object to inline the | |
// "handler" and "capability" fields, since both fulfill and | |
// reject reactions share the same capability. | |
reactionLength: 0, | |
fulfillReactionHandler0: void 0, | |
rejectReactionHandler0: void 0, | |
reactionCapability0: void 0 | |
} | |
}); | |
var resolvingFunctions = createResolvingFunctions(promise); | |
var reject = resolvingFunctions.reject; | |
try { | |
resolver(resolvingFunctions.resolve, reject); | |
} catch (e) { | |
reject(e); | |
} | |
return promise; | |
}; | |
return PromiseShim; | |
}()); | |
Promise$prototype = Promise.prototype; | |
var _promiseAllResolver = function (index, values, capability, remaining) { | |
var alreadyCalled = false; | |
return function (x) { | |
if (alreadyCalled) { return; } | |
alreadyCalled = true; | |
values[index] = x; | |
if ((--remaining.count) === 0) { | |
var resolve = capability.resolve; | |
resolve(values); // call w/ this===undefined | |
} | |
}; | |
}; | |
var performPromiseAll = function (iteratorRecord, C, resultCapability) { | |
var it = iteratorRecord.iterator; | |
var values = []; | |
var remaining = { count: 1 }; | |
var next, nextValue; | |
var index = 0; | |
while (true) { | |
try { | |
next = ES.IteratorStep(it); | |
if (next === false) { | |
iteratorRecord.done = true; | |
break; | |
} | |
nextValue = next.value; | |
} catch (e) { | |
iteratorRecord.done = true; | |
throw e; | |
} | |
values[index] = void 0; | |
var nextPromise = C.resolve(nextValue); | |
var resolveElement = _promiseAllResolver( | |
index, | |
values, | |
resultCapability, | |
remaining | |
); | |
remaining.count += 1; | |
optimizedThen(nextPromise.then, nextPromise, resolveElement, resultCapability.reject); | |
index += 1; | |
} | |
if ((--remaining.count) === 0) { | |
var resolve = resultCapability.resolve; | |
resolve(values); // call w/ this===undefined | |
} | |
return resultCapability.promise; | |
}; | |
var performPromiseRace = function (iteratorRecord, C, resultCapability) { | |
var it = iteratorRecord.iterator; | |
var next, nextValue, nextPromise; | |
while (true) { | |
try { | |
next = ES.IteratorStep(it); | |
if (next === false) { | |
// NOTE: If iterable has no items, resulting promise will never | |
// resolve; see: | |
// https://github.com/domenic/promises-unwrapping/issues/75 | |
// https://bugs.ecmascript.org/show_bug.cgi?id=2515 | |
iteratorRecord.done = true; | |
break; | |
} | |
nextValue = next.value; | |
} catch (e) { | |
iteratorRecord.done = true; | |
throw e; | |
} | |
nextPromise = C.resolve(nextValue); | |
optimizedThen(nextPromise.then, nextPromise, resultCapability.resolve, resultCapability.reject); | |
} | |
return resultCapability.promise; | |
}; | |
defineProperties(Promise, { | |
all: function all(iterable) { | |
var C = this; | |
if (!ES.TypeIsObject(C)) { | |
throw new TypeError('Promise is not object'); | |
} | |
var capability = new PromiseCapability(C); | |
var iterator, iteratorRecord; | |
try { | |
iterator = ES.GetIterator(iterable); | |
iteratorRecord = { iterator: iterator, done: false }; | |
return performPromiseAll(iteratorRecord, C, capability); | |
} catch (e) { | |
var exception = e; | |
if (iteratorRecord && !iteratorRecord.done) { | |
try { | |
ES.IteratorClose(iterator, true); | |
} catch (ee) { | |
exception = ee; | |
} | |
} | |
var reject = capability.reject; | |
reject(exception); | |
return capability.promise; | |
} | |
}, | |
race: function race(iterable) { | |
var C = this; | |
if (!ES.TypeIsObject(C)) { | |
throw new TypeError('Promise is not object'); | |
} | |
var capability = new PromiseCapability(C); | |
var iterator, iteratorRecord; | |
try { | |
iterator = ES.GetIterator(iterable); | |
iteratorRecord = { iterator: iterator, done: false }; | |
return performPromiseRace(iteratorRecord, C, capability); | |
} catch (e) { | |
var exception = e; | |
if (iteratorRecord && !iteratorRecord.done) { | |
try { | |
ES.IteratorClose(iterator, true); | |
} catch (ee) { | |
exception = ee; | |
} | |
} | |
var reject = capability.reject; | |
reject(exception); | |
return capability.promise; | |
} | |
}, | |
reject: function reject(reason) { | |
var C = this; | |
if (!ES.TypeIsObject(C)) { | |
throw new TypeError('Bad promise constructor'); | |
} | |
var capability = new PromiseCapability(C); | |
var rejectFunc = capability.reject; | |
rejectFunc(reason); // call with this===undefined | |
return capability.promise; | |
}, | |
resolve: function resolve(v) { | |
// See https://esdiscuss.org/topic/fixing-promise-resolve for spec | |
var C = this; | |
if (!ES.TypeIsObject(C)) { | |
throw new TypeError('Bad promise constructor'); | |
} | |
if (ES.IsPromise(v)) { | |
var constructor = v.constructor; | |
if (constructor === C) { | |
return v; | |
} | |
} | |
var capability = new PromiseCapability(C); | |
var resolveFunc = capability.resolve; | |
resolveFunc(v); // call with this===undefined | |
return capability.promise; | |
} | |
}); | |
defineProperties(Promise$prototype, { | |
'catch': function (onRejected) { | |
return this.then(null, onRejected); | |
}, | |
then: function then(onFulfilled, onRejected) { | |
var promise = this; | |
if (!ES.IsPromise(promise)) { throw new TypeError('not a promise'); } | |
var C = ES.SpeciesConstructor(promise, Promise); | |
var resultCapability; | |
var returnValueIsIgnored = arguments.length > 2 && arguments[2] === PROMISE_FAKE_CAPABILITY; | |
if (returnValueIsIgnored && C === Promise) { | |
resultCapability = PROMISE_FAKE_CAPABILITY; | |
} else { | |
resultCapability = new PromiseCapability(C); | |
} | |
// PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability) | |
// Note that we've split the 'reaction' object into its two | |
// components, "capabilities" and "handler" | |
// "capabilities" is always equal to `resultCapability` | |
var fulfillReactionHandler = ES.IsCallable(onFulfilled) ? onFulfilled : PROMISE_IDENTITY; | |
var rejectReactionHandler = ES.IsCallable(onRejected) ? onRejected : PROMISE_THROWER; | |
var _promise = promise._promise; | |
var value; | |
if (_promise.state === PROMISE_PENDING) { | |
if (_promise.reactionLength === 0) { | |
_promise.fulfillReactionHandler0 = fulfillReactionHandler; | |
_promise.rejectReactionHandler0 = rejectReactionHandler; | |
_promise.reactionCapability0 = resultCapability; | |
} else { | |
var idx = 3 * (_promise.reactionLength - 1); | |
_promise[idx + PROMISE_FULFILL_OFFSET] = fulfillReactionHandler; | |
_promise[idx + PROMISE_REJECT_OFFSET] = rejectReactionHandler; | |
_promise[idx + PROMISE_CAPABILITY_OFFSET] = resultCapability; | |
} | |
_promise.reactionLength += 1; | |
} else if (_promise.state === PROMISE_FULFILLED) { | |
value = _promise.result; | |
enqueuePromiseReactionJob( | |
fulfillReactionHandler, | |
resultCapability, | |
value | |
); | |
} else if (_promise.state === PROMISE_REJECTED) { | |
value = _promise.result; | |
enqueuePromiseReactionJob( | |
rejectReactionHandler, | |
resultCapability, | |
value | |
); | |
} else { | |
throw new TypeError('unexpected Promise state'); | |
} | |
return resultCapability.promise; | |
} | |
}); | |
// This helps the optimizer by ensuring that methods which take | |
// capabilities aren't polymorphic. | |
PROMISE_FAKE_CAPABILITY = new PromiseCapability(Promise); | |
Promise$prototype$then = Promise$prototype.then; | |
return Promise; | |
}()); | |
// Chrome's native Promise has extra methods that it shouldn't have. Let's remove them. | |
if (globals.Promise) { | |
delete globals.Promise.accept; | |
delete globals.Promise.defer; | |
delete globals.Promise.prototype.chain; | |
} | |
if (typeof PromiseShim === 'function') { | |
// export the Promise constructor. | |
defineProperties(globals, { Promise: PromiseShim }); | |
// In Chrome 33 (and thereabouts) Promise is defined, but the | |
// implementation is buggy in a number of ways. Let's check subclassing | |
// support to see if we have a buggy implementation. | |
var promiseSupportsSubclassing = supportsSubclassing(globals.Promise, function (S) { | |
return S.resolve(42).then(function () {}) instanceof S; | |
}); | |
var promiseIgnoresNonFunctionThenCallbacks = !throwsError(function () { | |
return globals.Promise.reject(42).then(null, 5).then(null, noop); | |
}); | |
var promiseRequiresObjectContext = throwsError(function () { return globals.Promise.call(3, noop); }); | |
// Promise.resolve() was errata'ed late in the ES6 process. | |
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1170742 | |
// https://code.google.com/p/v8/issues/detail?id=4161 | |
// It serves as a proxy for a number of other bugs in early Promise | |
// implementations. | |
var promiseResolveBroken = (function (Promise) { | |
var p = Promise.resolve(5); | |
p.constructor = {}; | |
var p2 = Promise.resolve(p); | |
try { | |
p2.then(null, noop).then(null, noop); // avoid "uncaught rejection" warnings in console | |
} catch (e) { | |
return true; // v8 native Promises break here https://code.google.com/p/chromium/issues/detail?id=575314 | |
} | |
return p === p2; // This *should* be false! | |
}(globals.Promise)); | |
// Chrome 46 (probably older too) does not retrieve a thenable's .then synchronously | |
var getsThenSynchronously = supportsDescriptors && (function () { | |
var count = 0; | |
// eslint-disable-next-line getter-return | |
var thenable = Object.defineProperty({}, 'then', { get: function () { count += 1; } }); | |
Promise.resolve(thenable); | |
return count === 1; | |
}()); | |
var BadResolverPromise = function BadResolverPromise(executor) { | |
var p = new Promise(executor); | |
executor(3, function () {}); | |
this.then = p.then; | |
this.constructor = BadResolverPromise; | |
}; | |
BadResolverPromise.prototype = Promise.prototype; | |
BadResolverPromise.all = Promise.all; | |
// Chrome Canary 49 (probably older too) has some implementation bugs | |
var hasBadResolverPromise = valueOrFalseIfThrows(function () { | |
return !!BadResolverPromise.all([1, 2]); | |
}); | |
if (!promiseSupportsSubclassing || !promiseIgnoresNonFunctionThenCallbacks || | |
!promiseRequiresObjectContext || promiseResolveBroken || | |
!getsThenSynchronously || hasBadResolverPromise) { | |
/* globals Promise: true */ | |
/* eslint-disable no-undef, no-global-assign */ | |
Promise = PromiseShim; | |
/* eslint-enable no-undef, no-global-assign */ | |
overrideNative(globals, 'Promise', PromiseShim); | |
} | |
if (Promise.all.length !== 1) { | |
var origAll = Promise.all; | |
overrideNative(Promise, 'all', function all(iterable) { | |
return ES.Call(origAll, this, arguments); | |
}); | |
} | |
if (Promise.race.length !== 1) { | |
var origRace = Promise.race; | |
overrideNative(Promise, 'race', function race(iterable) { | |
return ES.Call(origRace, this, arguments); | |
}); | |
} | |
if (Promise.resolve.length !== 1) { | |
var origResolve = Promise.resolve; | |
overrideNative(Promise, 'resolve', function resolve(x) { | |
return ES.Call(origResolve, this, arguments); | |
}); | |
} | |
if (Promise.reject.length !== 1) { | |
var origReject = Promise.reject; | |
overrideNative(Promise, 'reject', function reject(r) { | |
return ES.Call(origReject, this, arguments); | |
}); | |
} | |
ensureEnumerable(Promise, 'all'); | |
ensureEnumerable(Promise, 'race'); | |
ensureEnumerable(Promise, 'resolve'); | |
ensureEnumerable(Promise, 'reject'); | |
addDefaultSpecies(Promise); | |
} | |
// Map and Set require a true ES5 environment | |
// Their fast path also requires that the environment preserve | |
// property insertion order, which is not guaranteed by the spec. | |
var testOrder = function (a) { | |
var b = keys(_reduce(a, function (o, k) { | |
o[k] = true; | |
return o; | |
}, {})); | |
return a.join(':') === b.join(':'); | |
}; | |
var preservesInsertionOrder = testOrder(['z', 'a', 'bb']); | |
// some engines (eg, Chrome) only preserve insertion order for string keys | |
var preservesNumericInsertionOrder = testOrder(['z', 1, 'a', '3', 2]); | |
if (supportsDescriptors) { | |
var fastkey = function fastkey(key, skipInsertionOrderCheck) { | |
if (!skipInsertionOrderCheck && !preservesInsertionOrder) { | |
return null; | |
} | |
if (isNullOrUndefined(key)) { | |
return '^' + ES.ToString(key); | |
} else if (typeof key === 'string') { | |
return '$' + key; | |
} else if (typeof key === 'number') { | |
// note that -0 will get coerced to "0" when used as a property key | |
if (!preservesNumericInsertionOrder) { | |
return 'n' + key; | |
} | |
return key; | |
} else if (typeof key === 'boolean') { | |
return 'b' + key; | |
} | |
return null; | |
}; | |
var emptyObject = function emptyObject() { | |
// accomodate some older not-quite-ES5 browsers | |
return Object.create ? Object.create(null) : {}; | |
}; | |
var addIterableToMap = function addIterableToMap(MapConstructor, map, iterable) { | |
if (isArray(iterable) || Type.string(iterable)) { | |
_forEach(iterable, function (entry) { | |
if (!ES.TypeIsObject(entry)) { | |
throw new TypeError('Iterator value ' + entry + ' is not an entry object'); | |
} | |
map.set(entry[0], entry[1]); | |
}); | |
} else if (iterable instanceof MapConstructor) { | |
_call(MapConstructor.prototype.forEach, iterable, function (value, key) { | |
map.set(key, value); | |
}); | |
} else { | |
var iter, adder; | |
if (!isNullOrUndefined(iterable)) { | |
adder = map.set; | |
if (!ES.IsCallable(adder)) { throw new TypeError('bad map'); } | |
iter = ES.GetIterator(iterable); | |
} | |
if (typeof iter !== 'undefined') { | |
while (true) { | |
var next = ES.IteratorStep(iter); | |
if (next === false) { break; } | |
var nextItem = next.value; | |
try { | |
if (!ES.TypeIsObject(nextItem)) { | |
throw new TypeError('Iterator value ' + nextItem + ' is not an entry object'); | |
} | |
_call(adder, map, nextItem[0], nextItem[1]); | |
} catch (e) { | |
ES.IteratorClose(iter, true); | |
throw e; | |
} | |
} | |
} | |
} | |
}; | |
var addIterableToSet = function addIterableToSet(SetConstructor, set, iterable) { | |
if (isArray(iterable) || Type.string(iterable)) { | |
_forEach(iterable, function (value) { | |
set.add(value); | |
}); | |
} else if (iterable instanceof SetConstructor) { | |
_call(SetConstructor.prototype.forEach, iterable, function (value) { | |
set.add(value); | |
}); | |
} else { | |
var iter, adder; | |
if (!isNullOrUndefined(iterable)) { | |
adder = set.add; | |
if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); } | |
iter = ES.GetIterator(iterable); | |
} | |
if (typeof iter !== 'undefined') { | |
while (true) { | |
var next = ES.IteratorStep(iter); | |
if (next === false) { break; } | |
var nextValue = next.value; | |
try { | |
_call(adder, set, nextValue); | |
} catch (e) { | |
ES.IteratorClose(iter, true); | |
throw e; | |
} | |
} | |
} | |
} | |
}; | |
var collectionShims = { | |
Map: (function () { | |
var empty = {}; | |
var MapEntry = function MapEntry(key, value) { | |
this.key = key; | |
this.value = value; | |
this.next = null; | |
this.prev = null; | |
}; | |
MapEntry.prototype.isRemoved = function isRemoved() { | |
return this.key === empty; | |
}; | |
var isMap = function isMap(map) { | |
return !!map._es6map; | |
}; | |
var requireMapSlot = function requireMapSlot(map, method) { | |
if (!ES.TypeIsObject(map) || !isMap(map)) { | |
throw new TypeError('Method Map.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(map)); | |
} | |
}; | |
var MapIterator = function MapIterator(map, kind) { | |
requireMapSlot(map, '[[MapIterator]]'); | |
defineProperty(this, 'head', map._head); | |
defineProperty(this, 'i', this.head); | |
defineProperty(this, 'kind', kind); | |
}; | |
MapIterator.prototype = { | |
isMapIterator: true, | |
next: function next() { | |
if (!this.isMapIterator) { | |
throw new TypeError('Not a MapIterator'); | |
} | |
var i = this.i; | |
var kind = this.kind; | |
var head = this.head; | |
if (typeof this.i === 'undefined') { | |
return iteratorResult(); | |
} | |
while (i.isRemoved() && i !== head) { | |
// back up off of removed entries | |
i = i.prev; | |
} | |
// advance to next unreturned element. | |
var result; | |
while (i.next !== head) { | |
i = i.next; | |
if (!i.isRemoved()) { | |
if (kind === 'key') { | |
result = i.key; | |
} else if (kind === 'value') { | |
result = i.value; | |
} else { | |
result = [i.key, i.value]; | |
} | |
this.i = i; | |
return iteratorResult(result); | |
} | |
} | |
// once the iterator is done, it is done forever. | |
this.i = void 0; | |
return iteratorResult(); | |
} | |
}; | |
addIterator(MapIterator.prototype); | |
var Map$prototype; | |
var MapShim = function Map() { | |
if (!(this instanceof Map)) { | |
throw new TypeError('Constructor Map requires "new"'); | |
} | |
if (this && this._es6map) { | |
throw new TypeError('Bad construction'); | |
} | |
var map = emulateES6construct(this, Map, Map$prototype, { | |
_es6map: true, | |
_head: null, | |
_map: OrigMap ? new OrigMap() : null, | |
_size: 0, | |
_storage: emptyObject() | |
}); | |
var head = new MapEntry(null, null); | |
// circular doubly-linked list. | |
/* eslint no-multi-assign: 1 */ | |
head.next = head.prev = head; | |
map._head = head; | |
// Optionally initialize map from iterable | |
if (arguments.length > 0) { | |
addIterableToMap(Map, map, arguments[0]); | |
} | |
return map; | |
}; | |
Map$prototype = MapShim.prototype; | |
Value.getter(Map$prototype, 'size', function () { | |
if (typeof this._size === 'undefined') { | |
throw new TypeError('size method called on incompatible Map'); | |
} | |
return this._size; | |
}); | |
defineProperties(Map$prototype, { | |
get: function get(key) { | |
requireMapSlot(this, 'get'); | |
var entry; | |
var fkey = fastkey(key, true); | |
if (fkey !== null) { | |
// fast O(1) path | |
entry = this._storage[fkey]; | |
if (entry) { | |
return entry.value; | |
} else { | |
return; | |
} | |
} | |
if (this._map) { | |
// fast object key path | |
entry = origMapGet.call(this._map, key); | |
if (entry) { | |
return entry.value; | |
} else { | |
return; | |
} | |
} | |
var head = this._head; | |
var i = head; | |
while ((i = i.next) !== head) { | |
if (ES.SameValueZero(i.key, key)) { | |
return i.value; | |
} | |
} | |
}, | |
has: function has(key) { | |
requireMapSlot(this, 'has'); | |
var fkey = fastkey(key, true); | |
if (fkey !== null) { | |
// fast O(1) path | |
return typeof this._storage[fkey] !== 'undefined'; | |
} | |
if (this._map) { | |
// fast object key path | |
return origMapHas.call(this._map, key); | |
} | |
var head = this._head; | |
var i = head; | |
while ((i = i.next) !== head) { | |
if (ES.SameValueZero(i.key, key)) { | |
return true; | |
} | |
} | |
return false; | |
}, | |
set: function set(key, value) { | |
requireMapSlot(this, 'set'); | |
var head = this._head; | |
var i = head; | |
var entry; | |
var fkey = fastkey(key, true); | |
if (fkey !== null) { | |
// fast O(1) path | |
if (typeof this._storage[fkey] !== 'undefined') { | |
this._storage[fkey].value = value; | |
return this; | |
} else { | |
entry = this._storage[fkey] = new MapEntry(key, value); /* eslint no-multi-assign: 1 */ | |
i = head.prev; | |
// fall through | |
} | |
} else if (this._map) { | |
// fast object key path | |
if (origMapHas.call(this._map, key)) { | |
origMapGet.call(this._map, key).value = value; | |
} else { | |
entry = new MapEntry(key, value); | |
origMapSet.call(this._map, key, entry); | |
i = head.prev; | |
// fall through | |
} | |
} | |
while ((i = i.next) !== head) { | |
if (ES.SameValueZero(i.key, key)) { | |
i.value = value; | |
return this; | |
} | |
} | |
entry = entry || new MapEntry(key, value); | |
if (ES.SameValue(-0, key)) { | |
entry.key = +0; // coerce -0 to +0 in entry | |
} | |
entry.next = this._head; | |
entry.prev = this._head.prev; | |
entry.prev.next = entry; | |
entry.next.prev = entry; | |
this._size += 1; | |
return this; | |
}, | |
'delete': function (key) { | |
requireMapSlot(this, 'delete'); | |
var head = this._head; | |
var i = head; | |
var fkey = fastkey(key, true); | |
if (fkey !== null) { | |
// fast O(1) path | |
if (typeof this._storage[fkey] === 'undefined') { | |
return false; | |
} | |
i = this._storage[fkey].prev; | |
delete this._storage[fkey]; | |
// fall through | |
} else if (this._map) { | |
// fast object key path | |
if (!origMapHas.call(this._map, key)) { | |
return false; | |
} | |
i = origMapGet.call(this._map, key).prev; | |
origMapDelete.call(this._map, key); | |
// fall through | |
} | |
while ((i = i.next) !== head) { | |
if (ES.SameValueZero(i.key, key)) { | |
i.key = empty; | |
i.value = empty; | |
i.prev.next = i.next; | |
i.next.prev = i.prev; | |
this._size -= 1; | |
return true; | |
} | |
} | |
return false; | |
}, | |
clear: function clear() { | |
/* eslint no-multi-assign: 1 */ | |
requireMapSlot(this, 'clear'); | |
this._map = OrigMap ? new OrigMap() : null; | |
this._size = 0; | |
this._storage = emptyObject(); | |
var head = this._head; | |
var i = head; | |
var p = i.next; | |
while ((i = p) !== head) { | |
i.key = empty; | |
i.value = empty; | |
p = i.next; | |
i.next = i.prev = head; | |
} | |
head.next = head.prev = head; | |
}, | |
keys: function keys() { | |
requireMapSlot(this, 'keys'); | |
return new MapIterator(this, 'key'); | |
}, | |
values: function values() { | |
requireMapSlot(this, 'values'); | |
return new MapIterator(this, 'value'); | |
}, | |
entries: function entries() { | |
requireMapSlot(this, 'entries'); | |
return new MapIterator(this, 'key+value'); | |
}, | |
forEach: function forEach(callback) { | |
requireMapSlot(this, 'forEach'); | |
var context = arguments.length > 1 ? arguments[1] : null; | |
var it = this.entries(); | |
for (var entry = it.next(); !entry.done; entry = it.next()) { | |
if (context) { | |
_call(callback, context, entry.value[1], entry.value[0], this); | |
} else { | |
callback(entry.value[1], entry.value[0], this); | |
} | |
} | |
} | |
}); | |
addIterator(Map$prototype, Map$prototype.entries); | |
return MapShim; | |
}()), | |
Set: (function () { | |
var isSet = function isSet(set) { | |
return set._es6set && typeof set._storage !== 'undefined'; | |
}; | |
var requireSetSlot = function requireSetSlot(set, method) { | |
if (!ES.TypeIsObject(set) || !isSet(set)) { | |
// https://github.com/paulmillr/es6-shim/issues/176 | |
throw new TypeError('Set.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(set)); | |
} | |
}; | |
// Creating a Map is expensive. To speed up the common case of | |
// Sets containing only string or numeric keys, we use an object | |
// as backing storage and lazily create a full Map only when | |
// required. | |
var Set$prototype; | |
var SetShim = function Set() { | |
if (!(this instanceof Set)) { | |
throw new TypeError('Constructor Set requires "new"'); | |
} | |
if (this && this._es6set) { | |
throw new TypeError('Bad construction'); | |
} | |
var set = emulateES6construct(this, Set, Set$prototype, { | |
_es6set: true, | |
'[[SetData]]': null, | |
_storage: emptyObject() | |
}); | |
if (!set._es6set) { | |
throw new TypeError('bad set'); | |
} | |
// Optionally initialize Set from iterable | |
if (arguments.length > 0) { | |
addIterableToSet(Set, set, arguments[0]); | |
} | |
return set; | |
}; | |
Set$prototype = SetShim.prototype; | |
var decodeKey = function (key) { | |
var k = key; | |
if (k === '^null') { | |
return null; | |
} else if (k === '^undefined') { | |
return void 0; | |
} else { | |
var first = k.charAt(0); | |
if (first === '$') { | |
return _strSlice(k, 1); | |
} else if (first === 'n') { | |
return +_strSlice(k, 1); | |
} else if (first === 'b') { | |
return k === 'btrue'; | |
} | |
} | |
return +k; | |
}; | |
// Switch from the object backing storage to a full Map. | |
var ensureMap = function ensureMap(set) { | |
if (!set['[[SetData]]']) { | |
var m = new collectionShims.Map(); | |
set['[[SetData]]'] = m; | |
_forEach(keys(set._storage), function (key) { | |
var k = decodeKey(key); | |
m.set(k, k); | |
}); | |
set['[[SetData]]'] = m; | |
} | |
set._storage = null; // free old backing storage | |
}; | |
Value.getter(SetShim.prototype, 'size', function () { | |
requireSetSlot(this, 'size'); | |
if (this._storage) { | |
return keys(this._storage).length; | |
} | |
ensureMap(this); | |
return this['[[SetData]]'].size; | |
}); | |
defineProperties(SetShim.prototype, { | |
has: function has(key) { | |
requireSetSlot(this, 'has'); | |
var fkey; | |
if (this._storage && (fkey = fastkey(key)) !== null) { | |
return !!this._storage[fkey]; | |
} | |
ensureMap(this); | |
return this['[[SetData]]'].has(key); | |
}, | |
add: function add(key) { | |
requireSetSlot(this, 'add'); | |
var fkey; | |
if (this._storage && (fkey = fastkey(key)) !== null) { | |
this._storage[fkey] = true; | |
return this; | |
} | |
ensureMap(this); | |
this['[[SetData]]'].set(key, key); | |
return this; | |
}, | |
'delete': function (key) { | |
requireSetSlot(this, 'delete'); | |
var fkey; | |
if (this._storage && (fkey = fastkey(key)) !== null) { | |
var hasFKey = _hasOwnProperty(this._storage, fkey); | |
return (delete this._storage[fkey]) && hasFKey; | |
} | |
ensureMap(this); | |
return this['[[SetData]]']['delete'](key); | |
}, | |
clear: function clear() { | |
requireSetSlot(this, 'clear'); | |
if (this._storage) { | |
this._storage = emptyObject(); | |
} | |
if (this['[[SetData]]']) { | |
this['[[SetData]]'].clear(); | |
} | |
}, | |
values: function values() { | |
requireSetSlot(this, 'values'); | |
ensureMap(this); | |
return new SetIterator(this['[[SetData]]'].values()); | |
}, | |
entries: function entries() { | |
requireSetSlot(this, 'entries'); | |
ensureMap(this); | |
return new SetIterator(this['[[SetData]]'].entries()); | |
}, | |
forEach: function forEach(callback) { | |
requireSetSlot(this, 'forEach'); | |
var context = arguments.length > 1 ? arguments[1] : null; | |
var entireSet = this; | |
ensureMap(entireSet); | |
this['[[SetData]]'].forEach(function (value, key) { | |
if (context) { | |
_call(callback, context, key, key, entireSet); | |
} else { | |
callback(key, key, entireSet); | |
} | |
}); | |
} | |
}); | |
defineProperty(SetShim.prototype, 'keys', SetShim.prototype.values, true); | |
addIterator(SetShim.prototype, SetShim.prototype.values); | |
var SetIterator = function SetIterator(it) { | |
defineProperty(this, 'it', it); | |
}; | |
SetIterator.prototype = { | |
isSetIterator: true, | |
next: function next() { | |
if (!this.isSetIterator) { | |
throw new TypeError('Not a SetIterator'); | |
} | |
return this.it.next(); | |
} | |
}; | |
addIterator(SetIterator.prototype); | |
return SetShim; | |
}()) | |
}; | |
var isGoogleTranslate = globals.Set && !Set.prototype['delete'] && Set.prototype.remove && Set.prototype.items && Set.prototype.map && Array.isArray(new Set().keys); | |
if (isGoogleTranslate) { | |
// special-case force removal of wildly invalid Set implementation in Google Translate iframes | |
// see https://github.com/paulmillr/es6-shim/issues/438 / https://twitter.com/ljharb/status/849335573114363904 | |
globals.Set = collectionShims.Set; | |
} | |
if (globals.Map || globals.Set) { | |
// Safari 8, for example, doesn't accept an iterable. | |
var mapAcceptsArguments = valueOrFalseIfThrows(function () { return new Map([[1, 2]]).get(1) === 2; }); | |
if (!mapAcceptsArguments) { | |
globals.Map = function Map() { | |
if (!(this instanceof Map)) { | |
throw new TypeError('Constructor Map requires "new"'); | |
} | |
var m = new OrigMap(); | |
if (arguments.length > 0) { | |
addIterableToMap(Map, m, arguments[0]); | |
} | |
delete m.constructor; | |
Object.setPrototypeOf(m, globals.Map.prototype); | |
return m; | |
}; | |
globals.Map.prototype = create(OrigMap.prototype); | |
defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); | |
Value.preserveToString(globals.Map, OrigMap); | |
} | |
var testMap = new Map(); | |
var mapUsesSameValueZero = (function () { | |
// Chrome 38-42, node 0.11/0.12, iojs 1/2 also have a bug when the Map has a size > 4 | |
var m = new Map([[1, 0], [2, 0], [3, 0], [4, 0]]); | |
m.set(-0, m); | |
return m.get(0) === m && m.get(-0) === m && m.has(0) && m.has(-0); | |
}()); | |
var mapSupportsChaining = testMap.set(1, 2) === testMap; | |
if (!mapUsesSameValueZero || !mapSupportsChaining) { | |
overrideNative(Map.prototype, 'set', function set(k, v) { | |
_call(origMapSet, this, k === 0 ? 0 : k, v); | |
return this; | |
}); | |
} | |
if (!mapUsesSameValueZero) { | |
defineProperties(Map.prototype, { | |
get: function get(k) { | |
return _call(origMapGet, this, k === 0 ? 0 : k); | |
}, | |
has: function has(k) { | |
return _call(origMapHas, this, k === 0 ? 0 : k); | |
} | |
}, true); | |
Value.preserveToString(Map.prototype.get, origMapGet); | |
Value.preserveToString(Map.prototype.has, origMapHas); | |
} | |
var testSet = new Set(); | |
var setUsesSameValueZero = Set.prototype['delete'] && Set.prototype.add && Set.prototype.has && (function (s) { | |
s['delete'](0); | |
s.add(-0); | |
return !s.has(0); | |
}(testSet)); | |
var setSupportsChaining = testSet.add(1) === testSet; | |
if (!setUsesSameValueZero || !setSupportsChaining) { | |
var origSetAdd = Set.prototype.add; | |
Set.prototype.add = function add(v) { | |
_call(origSetAdd, this, v === 0 ? 0 : v); | |
return this; | |
}; | |
Value.preserveToString(Set.prototype.add, origSetAdd); | |
} | |
if (!setUsesSameValueZero) { | |
var origSetHas = Set.prototype.has; | |
Set.prototype.has = function has(v) { | |
return _call(origSetHas, this, v === 0 ? 0 : v); | |
}; | |
Value.preserveToString(Set.prototype.has, origSetHas); | |
var origSetDel = Set.prototype['delete']; | |
Set.prototype['delete'] = function SetDelete(v) { | |
return _call(origSetDel, this, v === 0 ? 0 : v); | |
}; | |
Value.preserveToString(Set.prototype['delete'], origSetDel); | |
} | |
var mapSupportsSubclassing = supportsSubclassing(globals.Map, function (M) { | |
var m = new M([]); | |
// Firefox 32 is ok with the instantiating the subclass but will | |
// throw when the map is used. | |
m.set(42, 42); | |
return m instanceof M; | |
}); | |
// without Object.setPrototypeOf, subclassing is not possible | |
var mapFailsToSupportSubclassing = Object.setPrototypeOf && !mapSupportsSubclassing; | |
var mapRequiresNew = (function () { | |
try { | |
return !(globals.Map() instanceof globals.Map); | |
} catch (e) { | |
return e instanceof TypeError; | |
} | |
}()); | |
if (globals.Map.length !== 0 || mapFailsToSupportSubclassing || !mapRequiresNew) { | |
globals.Map = function Map() { | |
if (!(this instanceof Map)) { | |
throw new TypeError('Constructor Map requires "new"'); | |
} | |
var m = new OrigMap(); | |
if (arguments.length > 0) { | |
addIterableToMap(Map, m, arguments[0]); | |
} | |
delete m.constructor; | |
Object.setPrototypeOf(m, Map.prototype); | |
return m; | |
}; | |
globals.Map.prototype = OrigMap.prototype; | |
defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); | |
Value.preserveToString(globals.Map, OrigMap); | |
} | |
var setSupportsSubclassing = supportsSubclassing(globals.Set, function (S) { | |
var s = new S([]); | |
s.add(42, 42); | |
return s instanceof S; | |
}); | |
// without Object.setPrototypeOf, subclassing is not possible | |
var setFailsToSupportSubclassing = Object.setPrototypeOf && !setSupportsSubclassing; | |
var setRequiresNew = (function () { | |
try { | |
return !(globals.Set() instanceof globals.Set); | |
} catch (e) { | |
return e instanceof TypeError; | |
} | |
}()); | |
if (globals.Set.length !== 0 || setFailsToSupportSubclassing || !setRequiresNew) { | |
var OrigSet = globals.Set; | |
globals.Set = function Set() { | |
if (!(this instanceof Set)) { | |
throw new TypeError('Constructor Set requires "new"'); | |
} | |
var s = new OrigSet(); | |
if (arguments.length > 0) { | |
addIterableToSet(Set, s, arguments[0]); | |
} | |
delete s.constructor; | |
Object.setPrototypeOf(s, Set.prototype); | |
return s; | |
}; | |
globals.Set.prototype = OrigSet.prototype; | |
defineProperty(globals.Set.prototype, 'constructor', globals.Set, true); | |
Value.preserveToString(globals.Set, OrigSet); | |
} | |
var newMap = new globals.Map(); | |
var mapIterationThrowsStopIterator = !valueOrFalseIfThrows(function () { | |
return newMap.keys().next().done; | |
}); | |
/* | |
- In Firefox < 23, Map#size is a function. | |
- In all current Firefox, Set#entries/keys/values & Map#clear do not exist | |
- https://bugzilla.mozilla.org/show_bug.cgi?id=869996 | |
- In Firefox 24, Map and Set do not implement forEach | |
- In Firefox 25 at least, Map and Set are callable without "new" | |
*/ | |
if ( | |
typeof globals.Map.prototype.clear !== 'function' || | |
new globals.Set().size !== 0 || | |
newMap.size !== 0 || | |
typeof globals.Map.prototype.keys !== 'function' || | |
typeof globals.Set.prototype.keys !== 'function' || | |
typeof globals.Map.prototype.forEach !== 'function' || | |
typeof globals.Set.prototype.forEach !== 'function' || | |
isCallableWithoutNew(globals.Map) || | |
isCallableWithoutNew(globals.Set) || | |
typeof newMap.keys().next !== 'function' || // Safari 8 | |
mapIterationThrowsStopIterator || // Firefox 25 | |
!mapSupportsSubclassing | |
) { | |
defineProperties(globals, { | |
Map: collectionShims.Map, | |
Set: collectionShims.Set | |
}, true); | |
} | |
if (globals.Set.prototype.keys !== globals.Set.prototype.values) { | |
// Fixed in WebKit with https://bugs.webkit.org/show_bug.cgi?id=144190 | |
defineProperty(globals.Set.prototype, 'keys', globals.Set.prototype.values, true); | |
} | |
// Shim incomplete iterator implementations. | |
addIterator(Object.getPrototypeOf((new globals.Map()).keys())); | |
addIterator(Object.getPrototypeOf((new globals.Set()).keys())); | |
if (functionsHaveNames && globals.Set.prototype.has.name !== 'has') { | |
// Microsoft Edge v0.11.10074.0 is missing a name on Set#has | |
var anonymousSetHas = globals.Set.prototype.has; | |
overrideNative(globals.Set.prototype, 'has', function has(key) { | |
return _call(anonymousSetHas, this, key); | |
}); | |
} | |
} | |
defineProperties(globals, collectionShims); | |
addDefaultSpecies(globals.Map); | |
addDefaultSpecies(globals.Set); | |
} | |
var throwUnlessTargetIsObject = function throwUnlessTargetIsObject(target) { | |
if (!ES.TypeIsObject(target)) { | |
throw new TypeError('target must be an object'); | |
} | |
}; | |
// Some Reflect methods are basically the same as | |
// those on the Object global, except that a TypeError is thrown if | |
// target isn't an object. As well as returning a boolean indicating | |
// the success of the operation. | |
var ReflectShims = { | |
// Apply method in a functional form. | |
apply: function apply() { | |
return ES.Call(ES.Call, null, arguments); | |
}, | |
// New operator in a functional form. | |
construct: function construct(constructor, args) { | |
if (!ES.IsConstructor(constructor)) { | |
throw new TypeError('First argument must be a constructor.'); | |
} | |
var newTarget = arguments.length > 2 ? arguments[2] : constructor; | |
if (!ES.IsConstructor(newTarget)) { | |
throw new TypeError('new.target must be a constructor.'); | |
} | |
return ES.Construct(constructor, args, newTarget, 'internal'); | |
}, | |
// When deleting a non-existent or configurable property, | |
// true is returned. | |
// When attempting to delete a non-configurable property, | |
// it will return false. | |
deleteProperty: function deleteProperty(target, key) { | |
throwUnlessTargetIsObject(target); | |
if (supportsDescriptors) { | |
var desc = Object.getOwnPropertyDescriptor(target, key); | |
if (desc && !desc.configurable) { | |
return false; | |
} | |
} | |
// Will return true. | |
return delete target[key]; | |
}, | |
has: function has(target, key) { | |
throwUnlessTargetIsObject(target); | |
return key in target; | |
} | |
}; | |
if (Object.getOwnPropertyNames) { | |
Object.assign(ReflectShims, { | |
// Basically the result of calling the internal [[OwnPropertyKeys]]. | |
// Concatenating propertyNames and propertySymbols should do the trick. | |
// This should continue to work together with a Symbol shim | |
// which overrides Object.getOwnPropertyNames and implements | |
// Object.getOwnPropertySymbols. | |
ownKeys: function ownKeys(target) { | |
throwUnlessTargetIsObject(target); | |
var keys = Object.getOwnPropertyNames(target); | |
if (ES.IsCallable(Object.getOwnPropertySymbols)) { | |
_pushApply(keys, Object.getOwnPropertySymbols(target)); | |
} | |
return keys; | |
} | |
}); | |
} | |
var callAndCatchException = function ConvertExceptionToBoolean(func) { | |
return !throwsError(func); | |
}; | |
if (Object.preventExtensions) { | |
Object.assign(ReflectShims, { | |
isExtensible: function isExtensible(target) { | |
throwUnlessTargetIsObject(target); | |
return Object.isExtensible(target); | |
}, | |
preventExtensions: function preventExtensions(target) { | |
throwUnlessTargetIsObject(target); | |
return callAndCatchException(function () { | |
return Object.preventExtensions(target); | |
}); | |
} | |
}); | |
} | |
if (supportsDescriptors) { | |
var internalGet = function get(target, key, receiver) { | |
var desc = Object.getOwnPropertyDescriptor(target, key); | |
if (!desc) { | |
var parent = Object.getPrototypeOf(target); | |
if (parent === null) { | |
return void 0; | |
} | |
return internalGet(parent, key, receiver); | |
} | |
if ('value' in desc) { | |
return desc.value; | |
} | |
if (desc.get) { | |
return ES.Call(desc.get, receiver); | |
} | |
return void 0; | |
}; | |
var internalSet = function set(target, key, value, receiver) { | |
var desc = Object.getOwnPropertyDescriptor(target, key); | |
if (!desc) { | |
var parent = Object.getPrototypeOf(target); | |
if (parent !== null) { | |
return internalSet(parent, key, value, receiver); | |
} | |
desc = { | |
value: void 0, | |
writable: true, | |
enumerable: true, | |
configurable: true | |
}; | |
} | |
if ('value' in desc) { | |
if (!desc.writable) { | |
return false; | |
} | |
if (!ES.TypeIsObject(receiver)) { | |
return false; | |
} | |
var existingDesc = Object.getOwnPropertyDescriptor(receiver, key); | |
if (existingDesc) { | |
return Reflect.defineProperty(receiver, key, { | |
value: value | |
}); | |
} else { | |
return Reflect.defineProperty(receiver, key, { | |
value: value, | |
writable: true, | |
enumerable: true, | |
configurable: true | |
}); | |
} | |
} | |
if (desc.set) { | |
_call(desc.set, receiver, value); | |
return true; | |
} | |
return false; | |
}; | |
Object.assign(ReflectShims, { | |
defineProperty: function defineProperty(target, propertyKey, attributes) { | |
throwUnlessTargetIsObject(target); | |
return callAndCatchException(function () { | |
return Object.defineProperty(target, propertyKey, attributes); | |
}); | |
}, | |
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { | |
throwUnlessTargetIsObject(target); | |
return Object.getOwnPropertyDescriptor(target, propertyKey); | |
}, | |
// Syntax in a functional form. | |
get: function get(target, key) { | |
throwUnlessTargetIsObject(target); | |
var receiver = arguments.length > 2 ? arguments[2] : target; | |
return internalGet(target, key, receiver); | |
}, | |
set: function set(target, key, value) { | |
throwUnlessTargetIsObject(target); | |
var receiver = arguments.length > 3 ? arguments[3] : target; | |
return internalSet(target, key, value, receiver); | |
} | |
}); | |
} | |
if (Object.getPrototypeOf) { | |
var objectDotGetPrototypeOf = Object.getPrototypeOf; | |
ReflectShims.getPrototypeOf = function getPrototypeOf(target) { | |
throwUnlessTargetIsObject(target); | |
return objectDotGetPrototypeOf(target); | |
}; | |
} | |
if (Object.setPrototypeOf && ReflectShims.getPrototypeOf) { | |
var willCreateCircularPrototype = function (object, lastProto) { | |
var proto = lastProto; | |
while (proto) { | |
if (object === proto) { | |
return true; | |
} | |
proto = ReflectShims.getPrototypeOf(proto); | |
} | |
return false; | |
}; | |
Object.assign(ReflectShims, { | |
// Sets the prototype of the given object. | |
// Returns true on success, otherwise false. | |
setPrototypeOf: function setPrototypeOf(object, proto) { | |
throwUnlessTargetIsObject(object); | |
if (proto !== null && !ES.TypeIsObject(proto)) { | |
throw new TypeError('proto must be an object or null'); | |
} | |
// If they already are the same, we're done. | |
if (proto === Reflect.getPrototypeOf(object)) { | |
return true; | |
} | |
// Cannot alter prototype if object not extensible. | |
if (Reflect.isExtensible && !Reflect.isExtensible(object)) { | |
return false; | |
} | |
// Ensure that we do not create a circular prototype chain. | |
if (willCreateCircularPrototype(object, proto)) { | |
return false; | |
} | |
Object.setPrototypeOf(object, proto); | |
return true; | |
} | |
}); | |
} | |
var defineOrOverrideReflectProperty = function (key, shim) { | |
if (!ES.IsCallable(globals.Reflect[key])) { | |
defineProperty(globals.Reflect, key, shim); | |
} else { | |
var acceptsPrimitives = valueOrFalseIfThrows(function () { | |
globals.Reflect[key](1); | |
globals.Reflect[key](NaN); | |
globals.Reflect[key](true); | |
return true; | |
}); | |
if (acceptsPrimitives) { | |
overrideNative(globals.Reflect, key, shim); | |
} | |
} | |
}; | |
Object.keys(ReflectShims).forEach(function (key) { | |
defineOrOverrideReflectProperty(key, ReflectShims[key]); | |
}); | |
var originalReflectGetProto = globals.Reflect.getPrototypeOf; | |
if (functionsHaveNames && originalReflectGetProto && originalReflectGetProto.name !== 'getPrototypeOf') { | |
overrideNative(globals.Reflect, 'getPrototypeOf', function getPrototypeOf(target) { | |
return _call(originalReflectGetProto, globals.Reflect, target); | |
}); | |
} | |
if (globals.Reflect.setPrototypeOf) { | |
if (valueOrFalseIfThrows(function () { | |
globals.Reflect.setPrototypeOf(1, {}); | |
return true; | |
})) { | |
overrideNative(globals.Reflect, 'setPrototypeOf', ReflectShims.setPrototypeOf); | |
} | |
} | |
if (globals.Reflect.defineProperty) { | |
if (!valueOrFalseIfThrows(function () { | |
var basic = !globals.Reflect.defineProperty(1, 'test', { value: 1 }); | |
// "extensible" fails on Edge 0.12 | |
var extensible = typeof Object.preventExtensions !== 'function' || !globals.Reflect.defineProperty(Object.preventExtensions({}), 'test', {}); | |
return basic && extensible; | |
})) { | |
overrideNative(globals.Reflect, 'defineProperty', ReflectShims.defineProperty); | |
} | |
} | |
if (globals.Reflect.construct) { | |
if (!valueOrFalseIfThrows(function () { | |
var F = function F() {}; | |
return globals.Reflect.construct(function () {}, [], F) instanceof F; | |
})) { | |
overrideNative(globals.Reflect, 'construct', ReflectShims.construct); | |
} | |
} | |
if (String(new Date(NaN)) !== 'Invalid Date') { | |
var dateToString = Date.prototype.toString; | |
var shimmedDateToString = function toString() { | |
var valueOf = +this; | |
if (valueOf !== valueOf) { | |
return 'Invalid Date'; | |
} | |
return ES.Call(dateToString, this); | |
}; | |
overrideNative(Date.prototype, 'toString', shimmedDateToString); | |
} | |
// Annex B HTML methods | |
// http://www.ecma-international.org/ecma-262/6.0/#sec-additional-properties-of-the-string.prototype-object | |
var stringHTMLshims = { | |
anchor: function anchor(name) { return ES.CreateHTML(this, 'a', 'name', name); }, | |
big: function big() { return ES.CreateHTML(this, 'big', '', ''); }, | |
blink: function blink() { return ES.CreateHTML(this, 'blink', '', ''); }, | |
bold: function bold() { return ES.CreateHTML(this, 'b', '', ''); }, | |
fixed: function fixed() { return ES.CreateHTML(this, 'tt', '', ''); }, | |
fontcolor: function fontcolor(color) { return ES.CreateHTML(this, 'font', 'color', color); }, | |
fontsize: function fontsize(size) { return ES.CreateHTML(this, 'font', 'size', size); }, | |
italics: function italics() { return ES.CreateHTML(this, 'i', '', ''); }, | |
link: function link(url) { return ES.CreateHTML(this, 'a', 'href', url); }, | |
small: function small() { return ES.CreateHTML(this, 'small', '', ''); }, | |
strike: function strike() { return ES.CreateHTML(this, 'strike', '', ''); }, | |
sub: function sub() { return ES.CreateHTML(this, 'sub', '', ''); }, | |
sup: function sub() { return ES.CreateHTML(this, 'sup', '', ''); } | |
}; | |
_forEach(Object.keys(stringHTMLshims), function (key) { | |
var method = String.prototype[key]; | |
var shouldOverwrite = false; | |
if (ES.IsCallable(method)) { | |
var output = _call(method, '', ' " '); | |
var quotesCount = _concat([], output.match(/"/g)).length; | |
shouldOverwrite = output !== output.toLowerCase() || quotesCount > 2; | |
} else { | |
shouldOverwrite = true; | |
} | |
if (shouldOverwrite) { | |
overrideNative(String.prototype, key, stringHTMLshims[key]); | |
} | |
}); | |
var JSONstringifiesSymbols = (function () { | |
// Microsoft Edge v0.12 stringifies Symbols incorrectly | |
if (!hasSymbols) { return false; } // Symbols are not supported | |
var stringify = typeof JSON === 'object' && typeof JSON.stringify === 'function' ? JSON.stringify : null; | |
if (!stringify) { return false; } // JSON.stringify is not supported | |
if (typeof stringify(Symbol()) !== 'undefined') { return true; } // Symbols should become `undefined` | |
if (stringify([Symbol()]) !== '[null]') { return true; } // Symbols in arrays should become `null` | |
var obj = { a: Symbol() }; | |
obj[Symbol()] = true; | |
if (stringify(obj) !== '{}') { return true; } // Symbol-valued keys *and* Symbol-valued properties should be omitted | |
return false; | |
}()); | |
var JSONstringifyAcceptsObjectSymbol = valueOrFalseIfThrows(function () { | |
// Chrome 45 throws on stringifying object symbols | |
if (!hasSymbols) { return true; } // Symbols are not supported | |
return JSON.stringify(Object(Symbol())) === '{}' && JSON.stringify([Object(Symbol())]) === '[{}]'; | |
}); | |
if (JSONstringifiesSymbols || !JSONstringifyAcceptsObjectSymbol) { | |
var origStringify = JSON.stringify; | |
overrideNative(JSON, 'stringify', function stringify(value) { | |
if (typeof value === 'symbol') { return; } | |
var replacer; | |
if (arguments.length > 1) { | |
replacer = arguments[1]; | |
} | |
var args = [value]; | |
if (!isArray(replacer)) { | |
var replaceFn = ES.IsCallable(replacer) ? replacer : null; | |
var wrappedReplacer = function (key, val) { | |
var parsedValue = replaceFn ? _call(replaceFn, this, key, val) : val; | |
if (typeof parsedValue !== 'symbol') { | |
if (Type.symbol(parsedValue)) { | |
return assignTo({})(parsedValue); | |
} else { | |
return parsedValue; | |
} | |
} | |
}; | |
args.push(wrappedReplacer); | |
} else { | |
// create wrapped replacer that handles an array replacer? | |
args.push(replacer); | |
} | |
if (arguments.length > 2) { | |
args.push(arguments[2]); | |
} | |
return origStringify.apply(this, args); | |
}); | |
} | |
return globals; | |
})); | |
})(this); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment