Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

es5-shim

Package Overview
Dependencies
Maintainers
3
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es5-shim - npm Package Compare versions

Comparing version 4.4.1 to 4.5.0

4

.jscs.json

@@ -150,4 +150,6 @@ {

"requireObjectDestructuring": false
"requireObjectDestructuring": false,
"requireEarlyReturn": false
}

@@ -5,3 +5,3 @@ {

"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"version": "v4.4.1",
"version": "v4.5.0",
"keywords": [

@@ -8,0 +8,0 @@ "shim",

/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.4.1/LICENSE
* see https://github.com/es-shims/es5-shim/blob/v4.5.0/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__)}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}}}var u=function doesGetOwnPropertyDescriptorWork(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};if(Object.defineProperty){var p=u({});var s=typeof document==="undefined"||u(document.createElement("div"));if(!s||!p){var b=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||b){var O="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(e,o){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(O+e)}if(b){try{return b.call(Object,e,o)}catch(i){}}var c;if(!r(e,o)){return c}c={enumerable:n(e,o),configurable:true};if(l){var u=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var s=f(e,o);var y=a(e,o);if(p){e.__proto__=u}if(s||y){if(s){c.get=s}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 d=!({__proto__:null}instanceof Object);var j=function shouldUseActiveX(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var v=function getEmptyViaActiveX(){var e;var t;t=new ActiveXObject("htmlfile");t.write("<script></script>");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var _=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(d||typeof document==="undefined"){y=function(){return{__proto__:null}}}else{y=function(){var e=j()?v():_();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(typeof e!=="object"&&typeof e!=="function"){throw new TypeError("Object prototype may only be an Object or null")}n.prototype=e;r=new n;r.__proto__=e}if(t!==void 0){Object.defineProperties(r,t)}return r}}var w=function doesDefinePropertyWork(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var m=w({});var P=typeof document==="undefined"||w(document.createElement("div"));if(!m||!P){var E=Object.defineProperty,h=Object.defineProperties}}if(!Object.defineProperty||E){var g="Property description must be an object: ";var z="Object.defineProperty called on non-object: ";var T="getters & setters can not be defined on this javascript engine";Object.defineProperty=function defineProperty(e,r,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(z+e)}if(typeof n!=="object"&&typeof n!=="function"||n===null){throw new TypeError(g+n)}if(E){try{return E.call(Object,e,r,n)}catch(o){}}if("value"in n){if(l&&(f(e,r)||a(e,r))){var u=e.__proto__;e.__proto__=t;delete e[r];e[r]=n.value;e.__proto__=u}else{e[r]=n.value}}else{if(!l&&("get"in n||"set"in n)){throw new TypeError(T)}if("get"in n){i(e,r,n.get)}if("set"in n){c(e,r,n.set)}}return e}}if(!Object.defineProperties||h){Object.defineProperties=function defineProperties(e,t){if(h){try{return h.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(x){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
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.4.1/LICENSE
* see https://github.com/es-shims/es5-shim/blob/v4.5.0/LICENSE
*/
(function(r,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{r.returnExports=t()}})(this,function(){var r=Array;var t=r.prototype;var e=Object;var n=e.prototype;var i=Function.prototype;var a=String;var o=a.prototype;var u=Number;var f=u.prototype;var l=t.slice;var s=t.splice;var c=t.push;var v=t.unshift;var p=t.concat;var h=i.call;var g=i.apply;var y=Math.max;var d=Math.min;var m=n.toString;var w=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var b;var T=Function.prototype.toString,x=function tryFunctionObject(r){try{T.call(r);return true}catch(t){return false}},O="[object Function]",S="[object GeneratorFunction]";b=function isCallable(r){if(typeof r!=="function"){return false}if(w){return x(r)}var t=m.call(r);return t===O||t===S};var E;var j=RegExp.prototype.exec,I=function tryRegexExec(r){try{j.call(r);return true}catch(t){return false}},D="[object RegExp]";E=function isRegex(r){if(typeof r!=="object"){return false}return w?I(r):m.call(r)===D};var N;var k=String.prototype.valueOf,M=function tryStringObject(r){try{k.call(r);return true}catch(t){return false}},U="[object String]";N=function isString(r){if(typeof r==="string"){return true}if(typeof r!=="object"){return false}return w?M(r):m.call(r)===U};var R=e.defineProperty&&function(){try{var r={};e.defineProperty(r,"x",{enumerable:false,value:r});for(var t in r){return false}return r.x===r}catch(n){return false}}();var F=function(r){var t;if(R){t=function(r,t,n,i){if(!i&&t in r){return}e.defineProperty(r,t,{configurable:true,enumerable:false,writable:true,value:n})}}else{t=function(r,t,e,n){if(!n&&t in r){return}r[t]=e}}return function defineProperties(e,n,i){for(var a in n){if(r.call(n,a)){t(e,a,n[a],i)}}}}(n.hasOwnProperty);var A=function isPrimitive(r){var t=typeof r;return r===null||t!=="object"&&t!=="function"};var P=u.isNaN||function(r){return r!==r};var $={ToInteger:function ToInteger(r){var t=+r;if(P(t)){t=0}else if(t!==0&&t!==1/0&&t!==-(1/0)){t=(t>0||-1)*Math.floor(Math.abs(t))}return t},ToPrimitive:function ToPrimitive(r){var t,e,n;if(A(r)){return r}e=r.valueOf;if(b(e)){t=e.call(r);if(A(t)){return t}}n=r.toString;if(b(n)){t=n.call(r);if(A(t)){return t}}throw new TypeError},ToObject:function(r){if(r==null){throw new TypeError("can't convert "+r+" to object")}return e(r)},ToUint32:function ToUint32(r){return r>>>0}};var C=function Empty(){};F(i,{bind:function bind(r){var t=this;if(!b(t)){throw new TypeError("Function.prototype.bind called on incompatible "+t)}var n=l.call(arguments,1);var i;var a=function(){if(this instanceof i){var a=t.apply(this,p.call(n,l.call(arguments)));if(e(a)===a){return a}return this}else{return t.apply(r,p.call(n,l.call(arguments)))}};var o=y(0,t.length-n.length);var u=[];for(var f=0;f<o;f++){c.call(u,"$"+f)}i=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this, arguments); }")(a);if(t.prototype){C.prototype=t.prototype;i.prototype=new C;C.prototype=null}return i}});var Z=h.bind(n.hasOwnProperty);var J=h.bind(n.toString);var z=h.bind(l);var B=g.bind(l);var G=h.bind(o.slice);var H=h.bind(o.split);var L=h.bind(o.indexOf);var X=h.bind(c);var Y=h.bind(n.propertyIsEnumerable);var q=h.bind(t.sort);var K=r.isArray||function isArray(r){return J(r)==="[object Array]"};var Q=[].unshift(0)!==1;F(t,{unshift:function(){v.apply(this,arguments);return this.length}},Q);F(r,{isArray:K});var V=e("a");var W=V[0]!=="a"||!(0 in V);var _=function properlyBoxed(r){var t=true;var e=true;if(r){r.call("foo",function(r,e,n){if(typeof n!=="object"){t=false}});r.call([1],function(){"use strict";e=typeof this==="string"},"x")}return!!r&&t&&e};F(t,{forEach:function forEach(r){var t=$.ToObject(this);var e=W&&N(this)?H(this,""):t;var n=-1;var i=$.ToUint32(e.length);var a;if(arguments.length>1){a=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<i){if(n in e){if(typeof a==="undefined"){r(e[n],n,t)}else{r.call(a,e[n],n,t)}}}}},!_(t.forEach));F(t,{map:function map(t){var e=$.ToObject(this);var n=W&&N(this)?H(this,""):e;var i=$.ToUint32(n.length);var a=r(i);var o;if(arguments.length>1){o=arguments[1]}if(!b(t)){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]=t(n[u],u,e)}else{a[u]=t.call(o,n[u],u,e)}}}return a}},!_(t.map));F(t,{filter:function filter(r){var t=$.ToObject(this);var e=W&&N(this)?H(this,""):t;var n=$.ToUint32(e.length);var i=[];var a;var o;if(arguments.length>1){o=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var u=0;u<n;u++){if(u in e){a=e[u];if(typeof o==="undefined"?r(a,u,t):r.call(o,a,u,t)){X(i,a)}}}return i}},!_(t.filter));F(t,{every:function every(r){var t=$.ToObject(this);var e=W&&N(this)?H(this,""):t;var n=$.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.every callback must be a function")}for(var a=0;a<n;a++){if(a in e&&!(typeof i==="undefined"?r(e[a],a,t):r.call(i,e[a],a,t))){return false}}return true}},!_(t.every));F(t,{some:function some(r){var t=$.ToObject(this);var e=W&&N(this)?H(this,""):t;var n=$.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!b(r)){throw new TypeError("Array.prototype.some callback must be a function")}for(var a=0;a<n;a++){if(a in e&&(typeof i==="undefined"?r(e[a],a,t):r.call(i,e[a],a,t))){return true}}return false}},!_(t.some));var rr=false;if(t.reduce){rr=typeof t.reduce.call("es5",function(r,t,e,n){return n})==="object"}F(t,{reduce:function reduce(r){var t=$.ToObject(this);var e=W&&N(this)?H(this,""):t;var n=$.ToUint32(e.length);if(!b(r)){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 e){a=e[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 e){a=r(a,e[i],i,t)}}return a}},!rr);var tr=false;if(t.reduceRight){tr=typeof t.reduceRight.call("es5",function(r,t,e,n){return n})==="object"}F(t,{reduceRight:function reduceRight(r){var t=$.ToObject(this);var e=W&&N(this)?H(this,""):t;var n=$.ToUint32(e.length);if(!b(r)){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 e){i=e[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 e){i=r(i,e[a],a,t)}}while(a--);return i}},!tr);var er=t.indexOf&&[0,1].indexOf(1,2)!==-1;F(t,{indexOf:function indexOf(r){var t=W&&N(this)?H(this,""):$.ToObject(this);var e=$.ToUint32(t.length);if(e===0){return-1}var n=0;if(arguments.length>1){n=$.ToInteger(arguments[1])}n=n>=0?n:y(0,e+n);for(;n<e;n++){if(n in t&&t[n]===r){return n}}return-1}},er);var nr=t.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;F(t,{lastIndexOf:function lastIndexOf(r){var t=W&&N(this)?H(this,""):$.ToObject(this);var e=$.ToUint32(t.length);if(e===0){return-1}var n=e-1;if(arguments.length>1){n=d(n,$.ToInteger(arguments[1]))}n=n>=0?n:e-Math.abs(n);for(;n>=0;n--){if(n in t&&r===t[n]){return n}}return-1}},nr);var ir=function(){var r=[1,2];var t=r.splice();return r.length===2&&K(t)&&t.length===0}();F(t,{splice:function splice(r,t){if(arguments.length===0){return[]}else{return s.apply(this,arguments)}}},!ir);var ar=function(){var r={};t.splice.call(r,0,0,1);return r.length===1}();F(t,{splice:function splice(r,t){if(arguments.length===0){return[]}var e=arguments;this.length=y($.ToInteger(this.length),0);if(arguments.length>0&&typeof t!=="number"){e=z(arguments);if(e.length<2){X(e,this.length-r)}else{e[1]=$.ToInteger(t)}}return s.apply(this,e)}},!ar);var or=function(){var t=new r(1e5);t[8]="x";t.splice(1,1);return t.indexOf("x")===7}();var ur=function(){var r=256;var t=[];t[r]="a";t.splice(r+1,0,"b");return t[r]==="a"}();F(t,{splice:function splice(r,t){var e=$.ToObject(this);var n=[];var i=$.ToUint32(e.length);var o=$.ToInteger(r);var u=o<0?y(i+o,0):d(o,i);var f=d(y($.ToInteger(t),0),i-u);var l=0;var s;while(l<f){s=a(u+l);if(Z(e,s)){n[l]=e[s]}l+=1}var c=z(arguments,2);var v=c.length;var p;if(v<f){l=u;while(l<i-f){s=a(l+f);p=a(l+v);if(Z(e,s)){e[p]=e[s]}else{delete e[p]}l+=1}l=i;while(l>i-f+v){delete e[l-1];l-=1}}else if(v>f){l=i-f;while(l>u){s=a(l+f-1);p=a(l+v-1);if(Z(e,s)){e[p]=e[s]}else{delete e[p]}l-=1}}l=u;for(var h=0;h<c.length;++h){e[l]=c[h];l+=1}e.length=i-f+v;return n}},!or||!ur);var fr=t.join;var lr;try{lr=Array.prototype.join.call("123",",")!=="1,2,3"}catch(sr){lr=true}if(lr){F(t,{join:function join(r){var t=typeof r==="undefined"?",":r;return fr.call(N(this)?H(this,""):this,t)}},lr)}var cr=[1,2].join(undefined)!=="1,2";if(cr){F(t,{join:function join(r){var t=typeof r==="undefined"?",":r;return fr.call(this,t)}},cr)}var vr=function push(r){var t=$.ToObject(this);var e=$.ToUint32(t.length);var n=0;while(n<arguments.length){t[e+n]=arguments[n];n+=1}t.length=e+n;return e+n};var pr=function(){var r={};var t=Array.prototype.push.call(r,undefined);return t!==1||r.length!==1||typeof r[0]!=="undefined"||!Z(r,0)}();F(t,{push:function push(r){if(K(this)){return c.apply(this,arguments)}return vr.apply(this,arguments)}},pr);var hr=function(){var r=[];var t=r.push(undefined);return t!==1||r.length!==1||typeof r[0]!=="undefined"||!Z(r,0)}();F(t,{push:vr},hr);F(t,{slice:function(r,t){var e=N(this)?H(this,""):this;return B(e,arguments)}},W);var gr=function(){try{[1,2].sort(null);[1,2].sort({});return true}catch(r){}return false}();var yr=function(){try{[1,2].sort(/a/);return false}catch(r){}return true}();var dr=function(){try{[1,2].sort(undefined);return true}catch(r){}return false}();F(t,{sort:function sort(r){if(typeof r==="undefined"){return q(this)}if(!b(r)){throw new TypeError("Array.prototype.sort callback must be a function")}return q(this,r)}},gr||!dr||!yr);var mr=!{toString:null}.propertyIsEnumerable("toString");var wr=function(){}.propertyIsEnumerable("prototype");var br=!Z("x","0");var Tr=function(r){var t=r.constructor;return t&&t.prototype===r};var xr={$window:true,$console:true,$parent:true,$self:true,$frame:true,$frames:true,$frameElement:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$external:true};var Or=function(){if(typeof window==="undefined"){return false}for(var r in window){try{if(!xr["$"+r]&&Z(window,r)&&window[r]!==null&&typeof window[r]==="object"){Tr(window[r])}}catch(t){return true}}return false}();var Sr=function(r){if(typeof window==="undefined"||!Or){return Tr(r)}try{return Tr(r)}catch(t){return false}};var Er=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var jr=Er.length;var Ir=function isArguments(r){return J(r)==="[object Arguments]"};var Dr=function isArguments(r){return r!==null&&typeof r==="object"&&typeof r.length==="number"&&r.length>=0&&!K(r)&&b(r.callee)};var Nr=Ir(arguments)?Ir:Dr;F(e,{keys:function keys(r){var t=b(r);var e=Nr(r);var n=r!==null&&typeof r==="object";var i=n&&N(r);if(!n&&!t&&!e){throw new TypeError("Object.keys called on a non-object")}var o=[];var u=wr&&t;if(i&&br||e){for(var f=0;f<r.length;++f){X(o,a(f))}}if(!e){for(var l in r){if(!(u&&l==="prototype")&&Z(r,l)){X(o,a(l))}}}if(mr){var s=Sr(r);for(var c=0;c<jr;c++){var v=Er[c];if(!(s&&v==="constructor")&&Z(r,v)){X(o,v)}}}return o}});var kr=e.keys&&function(){return e.keys(arguments).length===2}(1,2);var Mr=e.keys&&function(){var r=e.keys(arguments);return arguments.length!==1||r.length!==1||r[0]!==1}(1);var Ur=e.keys;F(e,{keys:function keys(r){if(Nr(r)){return Ur(z(r))}else{return Ur(r)}}},!kr||Mr);var Rr=-621987552e5;var Fr="-000001";var Ar=Date.prototype.toISOString&&new Date(Rr).toISOString().indexOf(Fr)===-1;var Pr=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z";F(Date.prototype,{toISOString:function toISOString(){var r,t,e,n,i;if(!isFinite(this)){throw new RangeError("Date.prototype.toISOString called on non-finite value.")}n=this.getUTCFullYear();i=this.getUTCMonth();n+=Math.floor(i/12);i=(i%12+12)%12;r=[i+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()];n=(n<0?"-":n>9999?"+":"")+G("00000"+Math.abs(n),0<=n&&n<=9999?-4:-6);t=r.length;while(t--){e=r[t];if(e<10){r[t]="0"+e}}return n+"-"+z(r,0,2).join("-")+"T"+z(r,2).join(":")+"."+G("000"+this.getUTCMilliseconds(),-3)+"Z"}},Ar||Pr);var $r=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(Rr).toJSON().indexOf(Fr)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(r){return false}}();if(!$r){Date.prototype.toJSON=function toJSON(r){var t=e(this);var n=$.ToPrimitive(t);if(typeof n==="number"&&!isFinite(n)){return null}var i=t.toISOString;if(!b(i)){throw new TypeError("toISOString property is not callable")}return i.call(t)}}var Cr=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var Zr=!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 Jr=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(Jr||Zr||!Cr){var zr=Math.pow(2,31)-1;var Br=P(new Date(1970,0,1,0,0,0,zr+1).getTime());Date=function(r){var t=function Date(e,n,i,o,u,f,l){var s=arguments.length;var c;if(this instanceof r){var v=f;var p=l;if(Br&&s>=7&&l>zr){var h=Math.floor(l/zr)*zr;var g=Math.floor(h/1e3);v+=g;p-=g*1e3}c=s===1&&a(e)===e?new r(t.parse(e)):s>=7?new r(e,n,i,o,u,v,p):s>=6?new r(e,n,i,o,u,v):s>=5?new r(e,n,i,o,u):s>=4?new r(e,n,i,o):s>=3?new r(e,n,i):s>=2?new r(e,n):s>=1?new r(e):new r}else{c=r.apply(this,arguments)}if(!A(c)){F(c,{constructor:t},true)}return c};var e=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(r,t){var e=t>1?1:0;return n[t]+Math.floor((r-1969+e)/4)-Math.floor((r-1901+e)/100)+Math.floor((r-1601+e)/400)+365*(r-1970)};var o=function toUTC(t){var e=0;var n=t;if(Br&&n>zr){var i=Math.floor(n/zr)*zr;var a=Math.floor(i/1e3);e+=a;n-=a*1e3}return u(new r(1970,0,1,0,0,e,n))};for(var f in r){if(Z(r,f)){t[f]=r[f]}}F(t,{now:r.now,UTC:r.UTC},true);t.prototype=r.prototype;F(t.prototype,{constructor:t},true);var l=function parse(t){var n=e.exec(t);if(n){var a=u(n[1]),f=u(n[2]||1)-1,l=u(n[3]||1)-1,s=u(n[4]||0),c=u(n[5]||0),v=u(n[6]||0),p=Math.floor(u(n[7]||0)*1e3),h=Boolean(n[4]&&!n[8]),g=n[9]==="-"?1:-1,y=u(n[10]||0),d=u(n[11]||0),m;var w=c>0||v>0||p>0;if(s<(w?24:25)&&c<60&&v<60&&p<1e3&&f>-1&&f<12&&y<24&&d<60&&l>-1&&l<i(a,f+1)-i(a,f)){m=((i(a,f)+l)*24+s+y*g)*60;m=((m+c+d*g)*60+v)*1e3+p;if(h){m=o(m)}if(-864e13<=m&&m<=864e13){return m}}return NaN}return r.parse.apply(this,arguments)};F(t,{parse:l});return t}(Date)}if(!Date.now){Date.now=function now(){return(new Date).getTime()}}var Gr=f.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var Hr={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function multiply(r,t){var e=-1;var n=t;while(++e<Hr.size){n+=r*Hr.data[e];Hr.data[e]=n%Hr.base;n=Math.floor(n/Hr.base)}},divide:function divide(r){var t=Hr.size,e=0;while(--t>=0){e+=Hr.data[t];Hr.data[t]=Math.floor(e/r);e=e%r*Hr.base}},numToString:function numToString(){var r=Hr.size;var t="";while(--r>=0){if(t!==""||r===0||Hr.data[r]!==0){var e=a(Hr.data[r]);if(t===""){t=e}else{t+=G("0000000",0,7-e.length)+e}}}return t},pow:function pow(r,t,e){return t===0?e:t%2===1?pow(r,t-1,e*r):pow(r*r,t/2,e)},log:function log(r){var t=0;var e=r;while(e>=4096){t+=12;e/=4096}while(e>=2){t+=1;e/=2}return t}};var Lr=function toFixed(r){var t,e,n,i,o,f,l,s;t=u(r);t=P(t)?0:Math.floor(t);if(t<0||t>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}e=u(this);if(P(e)){return"NaN"}if(e<=-1e21||e>=1e21){return a(e)}n="";if(e<0){n="-";e=-e}i="0";if(e>1e-21){o=Hr.log(e*Hr.pow(2,69,1))-69;f=o<0?e*Hr.pow(2,-o,1):e/Hr.pow(2,o,1);f*=4503599627370496;o=52-o;if(o>0){Hr.multiply(0,f);l=t;while(l>=7){Hr.multiply(1e7,0);l-=7}Hr.multiply(Hr.pow(10,l,1),0);l=o-1;while(l>=23){Hr.divide(1<<23);l-=23}Hr.divide(1<<l);Hr.multiply(1,1);Hr.divide(2);i=Hr.numToString()}else{Hr.multiply(0,f);Hr.multiply(1<<-o,0);i=Hr.numToString()+G("0.00000000000000000000",2,2+t)}}if(t>0){s=i.length;if(s<=t){i=n+G("0.0000000000000000000",0,t-s+2)+i}else{i=n+G(i,0,s-t)+"."+G(i,s-t)}}else{i=n+i}return i};F(f,{toFixed:Lr},Gr);var Xr=function(){try{return 1..toPrecision(undefined)==="1"}catch(r){return true}}();var Yr=f.toPrecision;F(f,{toPrecision:function toPrecision(r){return typeof r==="undefined"?Yr.call(this):Yr.call(this,r)}},Xr);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 r=typeof/()??/.exec("")[1]==="undefined";var t=Math.pow(2,32)-1;o.split=function(e,n){var i=String(this);if(typeof e==="undefined"&&n===0){return[]}if(!E(e)){return H(this,e,n)}var a=[];var o=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,f,l,s,v;var p=new RegExp(e.source,o+"g");if(!r){f=new RegExp("^"+p.source+"$(?!\\s)",o)}var h=typeof n==="undefined"?t:$.ToUint32(n);l=p.exec(i);while(l){s=l.index+l[0].length;if(s>u){X(a,G(i,u,l.index));if(!r&&l.length>1){l[0].replace(f,function(){for(var r=1;r<arguments.length-2;r++){if(typeof arguments[r]==="undefined"){l[r]=void 0}}})}if(l.length>1&&l.index<i.length){c.apply(a,z(l,1))}v=l[0].length;u=s;if(a.length>=h){break}}if(p.lastIndex===l.index){p.lastIndex++}l=p.exec(i)}if(u===i.length){if(v||!p.test("")){X(a,"")}}else{X(a,G(i,u))}return a.length>h?G(a,0,h):a}})()}else if("0".split(void 0,0).length){o.split=function split(r,t){if(typeof r==="undefined"&&t===0){return[]}return H(this,r,t)}}var qr=o.replace;var Kr=function(){var r=[];"x".replace(/x(.)?/g,function(t,e){X(r,e)});return r.length===1&&typeof r[0]==="undefined"}();if(!Kr){o.replace=function replace(r,t){var e=b(t);var n=E(r)&&/\)[*?]/.test(r.source);if(!e||!n){return qr.call(this,r,t)}else{var i=function(e){var n=arguments.length;var i=r.lastIndex;r.lastIndex=0;var a=r.exec(e)||[];r.lastIndex=i;X(a,arguments[n-2],arguments[n-1]);return t.apply(this,a)};return qr.call(this,r,i)}}}var Qr=o.substr;var Vr="".substr&&"0b".substr(-1)!=="b";F(o,{substr:function substr(r,t){var e=r;if(r<0){e=y(this.length+r,0)}return Qr.call(this,e,t)}},Vr);var Wr=" \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 _r="\u200b";var rt="["+Wr+"]";var tt=new RegExp("^"+rt+rt+"*");var et=new RegExp(rt+rt+"*$");var nt=o.trim&&(Wr.trim()||!_r.trim());F(o,{trim:function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return a(this).replace(tt,"").replace(et,"")}},nt);var it=o.lastIndexOf&&"abc\u3042\u3044".lastIndexOf("\u3042\u3044",2)!==-1;F(o,{lastIndexOf:function lastIndexOf(r){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var t=a(this);var e=a(r);var n=arguments.length>1?u(arguments[1]):NaN;var i=P(n)?Infinity:$.ToInteger(n);var o=d(y(i,0),t.length);var f=e.length;var l=o+f;while(l>0){l=y(0,l-f);var s=L(G(t,l,o+f),e);if(s!==-1){return l+s}}return-1}},it);var at=o.lastIndexOf;F(o,{lastIndexOf:function lastIndexOf(r){return at.apply(this,arguments)}},o.lastIndexOf.length!==1);if(parseInt(Wr+"08")!==8||parseInt(Wr+"0x16")!==22){parseInt=function(r){var t=/^[\-+]?0[xX]/;return function parseInt(e,n){var i=a(e).trim();var o=u(n)||(t.test(i)?16:10);return r(i,o)}}(parseInt)}if(String(new RangeError("test"))!=="RangeError: test"){var ot=function toString(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var r=this.name;if(typeof r==="undefined"){r="Error"}else if(typeof r!=="string"){r=a(r)}var t=this.message;if(typeof t==="undefined"){t=""}else if(typeof t!=="string"){t=a(t)}if(!r){return t}if(!t){return r}return r+": "+t};Error.prototype.toString=ot}if(R){var ut=function(r,t){if(Y(r,t)){var e=Object.getOwnPropertyDescriptor(r,t);e.enumerable=false;Object.defineProperty(r,t,e)}};ut(Error.prototype,"message");if(Error.prototype.message!==""){Error.prototype.message=""}ut(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var ft=function toString(){var r="/"+this.source+"/";if(this.global){r+="g"}if(this.ignoreCase){r+="i"}if(this.multiline){r+="m"}return r};RegExp.prototype.toString=ft}});
(function(t,r){"use strict";if(typeof define==="function"&&define.amd){define(r)}else if(typeof exports==="object"){module.exports=r()}else{t.returnExports=r()}})(this,function(){var t=Array;var r=t.prototype;var e=Object;var n=e.prototype;var i=Function.prototype;var a=String;var o=a.prototype;var u=Number;var f=u.prototype;var s=r.slice;var l=r.splice;var v=r.push;var c=r.unshift;var h=r.concat;var p=i.call;var g=i.apply;var y=Math.max;var d=Math.min;var w=n.toString;var b=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var m;var T=Function.prototype.toString,D=function tryFunctionObject(t){try{T.call(t);return true}catch(r){return false}},x="[object Function]",S="[object GeneratorFunction]";m=function isCallable(t){if(typeof t!=="function"){return false}if(b){return D(t)}var r=w.call(t);return r===x||r===S};var O;var E=RegExp.prototype.exec,j=function tryRegexExec(t){try{E.call(t);return true}catch(r){return false}},I="[object RegExp]";O=function isRegex(t){if(typeof t!=="object"){return false}return b?j(t):w.call(t)===I};var M;var U=String.prototype.valueOf,F=function tryStringObject(t){try{U.call(t);return true}catch(r){return false}},N="[object String]";M=function isString(t){if(typeof t==="string"){return true}if(typeof t!=="object"){return false}return b?F(t):w.call(t)===N};var k=e.defineProperty&&function(){try{var t={};e.defineProperty(t,"x",{enumerable:false,value:t});for(var r in t){return false}return t.x===t}catch(n){return false}}();var C=function(t){var r;if(k){r=function(t,r,n,i){if(!i&&r in t){return}e.defineProperty(t,r,{configurable:true,enumerable:false,writable:true,value:n})}}else{r=function(t,r,e,n){if(!n&&r in t){return}t[r]=e}}return function defineProperties(e,n,i){for(var a in n){if(t.call(n,a)){r(e,a,n[a],i)}}}}(n.hasOwnProperty);var R=function isPrimitive(t){var r=typeof t;return t===null||r!=="object"&&r!=="function"};var A=u.isNaN||function(t){return t!==t};var P={ToInteger:function ToInteger(t){var r=+t;if(A(r)){r=0}else if(r!==0&&r!==1/0&&r!==-(1/0)){r=(r>0||-1)*Math.floor(Math.abs(r))}return r},ToPrimitive:function ToPrimitive(t){var r,e,n;if(R(t)){return t}e=t.valueOf;if(m(e)){r=e.call(t);if(R(r)){return r}}n=t.toString;if(m(n)){r=n.call(t);if(R(r)){return r}}throw new TypeError},ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return e(t)},ToUint32:function ToUint32(t){return t>>>0}};var $=function Empty(){};C(i,{bind:function bind(t){var r=this;if(!m(r)){throw new TypeError("Function.prototype.bind called on incompatible "+r)}var n=s.call(arguments,1);var i;var a=function(){if(this instanceof i){var a=r.apply(this,h.call(n,s.call(arguments)));if(e(a)===a){return a}return this}else{return r.apply(t,h.call(n,s.call(arguments)))}};var o=y(0,r.length-n.length);var u=[];for(var f=0;f<o;f++){v.call(u,"$"+f)}i=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this, arguments); }")(a);if(r.prototype){$.prototype=r.prototype;i.prototype=new $;$.prototype=null}return i}});var J=p.bind(n.hasOwnProperty);var Y=p.bind(n.toString);var Z=p.bind(s);var z=g.bind(s);var G=p.bind(o.slice);var B=p.bind(o.split);var H=p.bind(o.indexOf);var W=p.bind(v);var L=p.bind(n.propertyIsEnumerable);var X=p.bind(r.sort);var q=t.isArray||function isArray(t){return Y(t)==="[object Array]"};var K=[].unshift(0)!==1;C(r,{unshift:function(){c.apply(this,arguments);return this.length}},K);C(t,{isArray:q});var Q=e("a");var V=Q[0]!=="a"||!(0 in Q);var _=function properlyBoxed(t){var r=true;var e=true;if(t){t.call("foo",function(t,e,n){if(typeof n!=="object"){r=false}});t.call([1],function(){"use strict";e=typeof this==="string"},"x")}return!!t&&r&&e};C(r,{forEach:function forEach(t){var r=P.ToObject(this);var e=V&&M(this)?B(this,""):r;var n=-1;var i=P.ToUint32(e.length);var a;if(arguments.length>1){a=arguments[1]}if(!m(t)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<i){if(n in e){if(typeof a==="undefined"){t(e[n],n,r)}else{t.call(a,e[n],n,r)}}}}},!_(r.forEach));C(r,{map:function map(r){var e=P.ToObject(this);var n=V&&M(this)?B(this,""):e;var i=P.ToUint32(n.length);var a=t(i);var o;if(arguments.length>1){o=arguments[1]}if(!m(r)){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]=r(n[u],u,e)}else{a[u]=r.call(o,n[u],u,e)}}}return a}},!_(r.map));C(r,{filter:function filter(t){var r=P.ToObject(this);var e=V&&M(this)?B(this,""):r;var n=P.ToUint32(e.length);var i=[];var a;var o;if(arguments.length>1){o=arguments[1]}if(!m(t)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var u=0;u<n;u++){if(u in e){a=e[u];if(typeof o==="undefined"?t(a,u,r):t.call(o,a,u,r)){W(i,a)}}}return i}},!_(r.filter));C(r,{every:function every(t){var r=P.ToObject(this);var e=V&&M(this)?B(this,""):r;var n=P.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!m(t)){throw new TypeError("Array.prototype.every callback must be a function")}for(var a=0;a<n;a++){if(a in e&&!(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return false}}return true}},!_(r.every));C(r,{some:function some(t){var r=P.ToObject(this);var e=V&&M(this)?B(this,""):r;var n=P.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!m(t)){throw new TypeError("Array.prototype.some callback must be a function")}for(var a=0;a<n;a++){if(a in e&&(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return true}}return false}},!_(r.some));var tt=false;if(r.reduce){tt=typeof r.reduce.call("es5",function(t,r,e,n){return n})==="object"}C(r,{reduce:function reduce(t){var r=P.ToObject(this);var e=V&&M(this)?B(this,""):r;var n=P.ToUint32(e.length);if(!m(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 e){a=e[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 e){a=t(a,e[i],i,r)}}return a}},!tt);var rt=false;if(r.reduceRight){rt=typeof r.reduceRight.call("es5",function(t,r,e,n){return n})==="object"}C(r,{reduceRight:function reduceRight(t){var r=P.ToObject(this);var e=V&&M(this)?B(this,""):r;var n=P.ToUint32(e.length);if(!m(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 e){i=e[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 e){i=t(i,e[a],a,r)}}while(a--);return i}},!rt);var et=r.indexOf&&[0,1].indexOf(1,2)!==-1;C(r,{indexOf:function indexOf(t){var r=V&&M(this)?B(this,""):P.ToObject(this);var e=P.ToUint32(r.length);if(e===0){return-1}var n=0;if(arguments.length>1){n=P.ToInteger(arguments[1])}n=n>=0?n:y(0,e+n);for(;n<e;n++){if(n in r&&r[n]===t){return n}}return-1}},et);var nt=r.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;C(r,{lastIndexOf:function lastIndexOf(t){var r=V&&M(this)?B(this,""):P.ToObject(this);var e=P.ToUint32(r.length);if(e===0){return-1}var n=e-1;if(arguments.length>1){n=d(n,P.ToInteger(arguments[1]))}n=n>=0?n:e-Math.abs(n);for(;n>=0;n--){if(n in r&&t===r[n]){return n}}return-1}},nt);var it=function(){var t=[1,2];var r=t.splice();return t.length===2&&q(r)&&r.length===0}();C(r,{splice:function splice(t,r){if(arguments.length===0){return[]}else{return l.apply(this,arguments)}}},!it);var at=function(){var t={};r.splice.call(t,0,0,1);return t.length===1}();C(r,{splice:function splice(t,r){if(arguments.length===0){return[]}var e=arguments;this.length=y(P.ToInteger(this.length),0);if(arguments.length>0&&typeof r!=="number"){e=Z(arguments);if(e.length<2){W(e,this.length-t)}else{e[1]=P.ToInteger(r)}}return l.apply(this,e)}},!at);var ot=function(){var r=new t(1e5);r[8]="x";r.splice(1,1);return r.indexOf("x")===7}();var ut=function(){var t=256;var r=[];r[t]="a";r.splice(t+1,0,"b");return r[t]==="a"}();C(r,{splice:function splice(t,r){var e=P.ToObject(this);var n=[];var i=P.ToUint32(e.length);var o=P.ToInteger(t);var u=o<0?y(i+o,0):d(o,i);var f=d(y(P.ToInteger(r),0),i-u);var s=0;var l;while(s<f){l=a(u+s);if(J(e,l)){n[s]=e[l]}s+=1}var v=Z(arguments,2);var c=v.length;var h;if(c<f){s=u;while(s<i-f){l=a(s+f);h=a(s+c);if(J(e,l)){e[h]=e[l]}else{delete e[h]}s+=1}s=i;while(s>i-f+c){delete e[s-1];s-=1}}else if(c>f){s=i-f;while(s>u){l=a(s+f-1);h=a(s+c-1);if(J(e,l)){e[h]=e[l]}else{delete e[h]}s-=1}}s=u;for(var p=0;p<v.length;++p){e[s]=v[p];s+=1}e.length=i-f+c;return n}},!ot||!ut);var ft=r.join;var st;try{st=Array.prototype.join.call("123",",")!=="1,2,3"}catch(lt){st=true}if(st){C(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return ft.call(M(this)?B(this,""):this,r)}},st)}var vt=[1,2].join(undefined)!=="1,2";if(vt){C(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return ft.call(this,r)}},vt)}var ct=function push(t){var r=P.ToObject(this);var e=P.ToUint32(r.length);var n=0;while(n<arguments.length){r[e+n]=arguments[n];n+=1}r.length=e+n;return e+n};var ht=function(){var t={};var r=Array.prototype.push.call(t,undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!J(t,0)}();C(r,{push:function push(t){if(q(this)){return v.apply(this,arguments)}return ct.apply(this,arguments)}},ht);var pt=function(){var t=[];var r=t.push(undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!J(t,0)}();C(r,{push:ct},pt);C(r,{slice:function(t,r){var e=M(this)?B(this,""):this;return z(e,arguments)}},V);var gt=function(){try{[1,2].sort(null);[1,2].sort({});return true}catch(t){}return false}();var yt=function(){try{[1,2].sort(/a/);return false}catch(t){}return true}();var dt=function(){try{[1,2].sort(undefined);return true}catch(t){}return false}();C(r,{sort:function sort(t){if(typeof t==="undefined"){return X(this)}if(!m(t)){throw new TypeError("Array.prototype.sort callback must be a function")}return X(this,t)}},gt||!dt||!yt);var wt=!{toString:null}.propertyIsEnumerable("toString");var bt=function(){}.propertyIsEnumerable("prototype");var mt=!J("x","0");var Tt=function(t){var r=t.constructor;return r&&r.prototype===t};var Dt={$window:true,$console:true,$parent:true,$self:true,$frame:true,$frames:true,$frameElement:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$external:true};var xt=function(){if(typeof window==="undefined"){return false}for(var t in window){try{if(!Dt["$"+t]&&J(window,t)&&window[t]!==null&&typeof window[t]==="object"){Tt(window[t])}}catch(r){return true}}return false}();var St=function(t){if(typeof window==="undefined"||!xt){return Tt(t)}try{return Tt(t)}catch(r){return false}};var Ot=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var Et=Ot.length;var jt=function isArguments(t){return Y(t)==="[object Arguments]"};var It=function isArguments(t){return t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&!q(t)&&m(t.callee)};var Mt=jt(arguments)?jt:It;C(e,{keys:function keys(t){var r=m(t);var e=Mt(t);var n=t!==null&&typeof t==="object";var i=n&&M(t);if(!n&&!r&&!e){throw new TypeError("Object.keys called on a non-object")}var o=[];var u=bt&&r;if(i&&mt||e){for(var f=0;f<t.length;++f){W(o,a(f))}}if(!e){for(var s in t){if(!(u&&s==="prototype")&&J(t,s)){W(o,a(s))}}}if(wt){var l=St(t);for(var v=0;v<Et;v++){var c=Ot[v];if(!(l&&c==="constructor")&&J(t,c)){W(o,c)}}}return o}});var Ut=e.keys&&function(){return e.keys(arguments).length===2}(1,2);var Ft=e.keys&&function(){var t=e.keys(arguments);return arguments.length!==1||t.length!==1||t[0]!==1}(1);var Nt=e.keys;C(e,{keys:function keys(t){if(Mt(t)){return Nt(Z(t))}else{return Nt(t)}}},!Ut||Ft);var kt=new Date(-0xc782b5b342b24).getUTCMonth()!==0;var Ct=new Date(-0x55d318d56a724);var Rt=new Date(14496624e5);var At=Ct.toUTCString()!=="Mon, 01 Jan -45875 11:59:59 GMT";var Pt;var $t;var Jt=Ct.getTimezoneOffset();if(Jt<-720){Pt=Ct.toDateString()!=="Tue Jan 02 -45875";$t=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Rt.toString())}else{Pt=Ct.toDateString()!=="Mon Jan 01 -45875";$t=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Rt.toString())}var Yt=p.bind(Date.prototype.getFullYear);var Zt=p.bind(Date.prototype.getMonth);var zt=p.bind(Date.prototype.getDate);var Gt=p.bind(Date.prototype.getUTCFullYear);var Bt=p.bind(Date.prototype.getUTCMonth);var Ht=p.bind(Date.prototype.getUTCDate);var Wt=p.bind(Date.prototype.getUTCDay);var Lt=p.bind(Date.prototype.getUTCHours);var Xt=p.bind(Date.prototype.getUTCMinutes);var qt=p.bind(Date.prototype.getUTCSeconds);var Kt=p.bind(Date.prototype.getUTCMilliseconds);var Qt=["Sun","Mon","Tue","Wed","Thu","Fri"];var Vt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var _t=function daysInMonth(t,r){return zt(new Date(r,t,0))};C(Date.prototype,{getFullYear:function getFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Yt(this);if(t<0&&Zt(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=Yt(this);var r=Zt(this);if(t<0&&r>11){return 0}return r},getDate:function getDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Yt(this);var r=Zt(this);var e=zt(this);if(t<0&&r>11){if(r===12){return e}var n=_t(0,t+1);return n-e+1}return e},getUTCFullYear:function getUTCFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Gt(this);if(t<0&&Bt(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=Gt(this);var r=Bt(this);if(t<0&&r>11){return 0}return r},getUTCDate:function getUTCDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Gt(this);var r=Bt(this);var e=Ht(this);if(t<0&&r>11){if(r===12){return e}var n=_t(0,t+1);return n-e+1}return e}},kt);C(Date.prototype,{toUTCString:function toUTCString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Wt(this);var r=Ht(this);var e=Bt(this);var n=Gt(this);var i=Lt(this);var a=Xt(this);var o=qt(this);return Qt[t]+", "+(r<10?"0"+r:r)+" "+Vt[e]+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"}},kt||At);C(Date.prototype,{toDateString:function toDateString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();return Qt[t]+" "+Vt[e]+" "+(r<10?"0"+r:r)+" "+n}},kt||Pt);if(kt||$t){Date.prototype.toString=function toString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();var i=this.getHours();var a=this.getMinutes();var o=this.getSeconds();var u=this.getTimezoneOffset();var f=Math.floor(Math.abs(u)/60);var s=Math.floor(Math.abs(u)%60);return Qt[t]+" "+Vt[e]+" "+(r<10?"0"+r:r)+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"+(u>0?"-":"+")+(f<10?"0"+f:f)+(s<10?"0"+s:s)};if(k){e.defineProperty(Date.prototype,"toString",{configurable:true,enumerable:false,writable:true})}}var tr=-621987552e5;var rr="-000001";var er=Date.prototype.toISOString&&new Date(tr).toISOString().indexOf(rr)===-1;var nr=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z";C(Date.prototype,{toISOString:function toISOString(){if(!isFinite(this)){throw new RangeError("Date.prototype.toISOString called on non-finite value.")}var t=Gt(this);var r=Bt(this);t+=Math.floor(r/12);r=(r%12+12)%12;var e=[r+1,Ht(this),Lt(this),Xt(this),qt(this)];t=(t<0?"-":t>9999?"+":"")+G("00000"+Math.abs(t),0<=t&&t<=9999?-4:-6);for(var n=0;n<e.length;++n){e[n]=G("00"+e[n],-2)}return t+"-"+Z(e,0,2).join("-")+"T"+Z(e,2).join(":")+"."+G("000"+Kt(this),-3)+"Z"}},er||nr);var ir=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(tr).toJSON().indexOf(rr)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(t){return false}}();if(!ir){Date.prototype.toJSON=function toJSON(t){var r=e(this);var n=P.ToPrimitive(r);if(typeof n==="number"&&!isFinite(n)){return null}var i=r.toISOString;if(!m(i)){throw new TypeError("toISOString property is not callable")}return i.call(r)}}var ar=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var or=!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 ur=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(ur||or||!ar){var fr=Math.pow(2,31)-1;var sr=A(new Date(1970,0,1,0,0,0,fr+1).getTime());Date=function(t){var r=function Date(e,n,i,o,u,f,s){var l=arguments.length;var v;if(this instanceof t){var c=f;var h=s;if(sr&&l>=7&&s>fr){var p=Math.floor(s/fr)*fr;var g=Math.floor(p/1e3);c+=g;h-=g*1e3}v=l===1&&a(e)===e?new t(r.parse(e)):l>=7?new t(e,n,i,o,u,c,h):l>=6?new t(e,n,i,o,u,c):l>=5?new t(e,n,i,o,u):l>=4?new t(e,n,i,o):l>=3?new t(e,n,i):l>=2?new t(e,n):l>=1?new t(e):new t}else{v=t.apply(this,arguments)}if(!R(v)){C(v,{constructor:r},true)}return v};var e=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,r){var e=r>1?1:0;return n[r]+Math.floor((t-1969+e)/4)-Math.floor((t-1901+e)/100)+Math.floor((t-1601+e)/400)+365*(t-1970)};var o=function toUTC(r){var e=0;var n=r;if(sr&&n>fr){var i=Math.floor(n/fr)*fr;var a=Math.floor(i/1e3);e+=a;n-=a*1e3}return u(new t(1970,0,1,0,0,e,n))};for(var f in t){if(J(t,f)){r[f]=t[f]}}C(r,{now:t.now,UTC:t.UTC},true);r.prototype=t.prototype;C(r.prototype,{constructor:r},true);var s=function parse(r){var n=e.exec(r);if(n){var a=u(n[1]),f=u(n[2]||1)-1,s=u(n[3]||1)-1,l=u(n[4]||0),v=u(n[5]||0),c=u(n[6]||0),h=Math.floor(u(n[7]||0)*1e3),p=Boolean(n[4]&&!n[8]),g=n[9]==="-"?1:-1,y=u(n[10]||0),d=u(n[11]||0),w;var b=v>0||c>0||h>0;if(l<(b?24:25)&&v<60&&c<60&&h<1e3&&f>-1&&f<12&&y<24&&d<60&&s>-1&&s<i(a,f+1)-i(a,f)){w=((i(a,f)+s)*24+l+y*g)*60;w=((w+v+d*g)*60+c)*1e3+h;if(p){w=o(w)}if(-864e13<=w&&w<=864e13){return w}}return NaN}return t.parse.apply(this,arguments)};C(r,{parse:s});return r}(Date)}if(!Date.now){Date.now=function now(){return(new Date).getTime()}}var lr=f.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var vr={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function multiply(t,r){var e=-1;var n=r;while(++e<vr.size){n+=t*vr.data[e];vr.data[e]=n%vr.base;n=Math.floor(n/vr.base)}},divide:function divide(t){var r=vr.size,e=0;while(--r>=0){e+=vr.data[r];vr.data[r]=Math.floor(e/t);e=e%t*vr.base}},numToString:function numToString(){var t=vr.size;var r="";while(--t>=0){if(r!==""||t===0||vr.data[t]!==0){var e=a(vr.data[t]);if(r===""){r=e}else{r+=G("0000000",0,7-e.length)+e}}}return r},pow:function pow(t,r,e){return r===0?e:r%2===1?pow(t,r-1,e*t):pow(t*t,r/2,e)},log:function log(t){var r=0;var e=t;while(e>=4096){r+=12;e/=4096}while(e>=2){r+=1;e/=2}return r}};var cr=function toFixed(t){var r,e,n,i,o,f,s,l;r=u(t);r=A(r)?0:Math.floor(r);if(r<0||r>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}e=u(this);if(A(e)){return"NaN"}if(e<=-1e21||e>=1e21){return a(e)}n="";if(e<0){n="-";e=-e}i="0";if(e>1e-21){o=vr.log(e*vr.pow(2,69,1))-69;f=o<0?e*vr.pow(2,-o,1):e/vr.pow(2,o,1);f*=4503599627370496;o=52-o;if(o>0){vr.multiply(0,f);s=r;while(s>=7){vr.multiply(1e7,0);s-=7}vr.multiply(vr.pow(10,s,1),0);s=o-1;while(s>=23){vr.divide(1<<23);s-=23}vr.divide(1<<s);vr.multiply(1,1);vr.divide(2);i=vr.numToString()}else{vr.multiply(0,f);vr.multiply(1<<-o,0);i=vr.numToString()+G("0.00000000000000000000",2,2+r)}}if(r>0){l=i.length;if(l<=r){i=n+G("0.0000000000000000000",0,r-l+2)+i}else{i=n+G(i,0,l-r)+"."+G(i,l-r)}}else{i=n+i}return i};C(f,{toFixed:cr},lr);var hr=function(){try{return 1..toPrecision(undefined)==="1"}catch(t){return true}}();var pr=f.toPrecision;C(f,{toPrecision:function toPrecision(t){return typeof t==="undefined"?pr.call(this):pr.call(this,t)}},hr);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 r=Math.pow(2,32)-1;o.split=function(e,n){var i=String(this);if(typeof e==="undefined"&&n===0){return[]}if(!O(e)){return B(this,e,n)}var a=[];var o=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,f,s,l,c;var h=new RegExp(e.source,o+"g");if(!t){f=new RegExp("^"+h.source+"$(?!\\s)",o)}var p=typeof n==="undefined"?r:P.ToUint32(n);s=h.exec(i);while(s){l=s.index+s[0].length;if(l>u){W(a,G(i,u,s.index));if(!t&&s.length>1){s[0].replace(f,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){s[t]=void 0}}})}if(s.length>1&&s.index<i.length){v.apply(a,Z(s,1))}c=s[0].length;u=l;if(a.length>=p){break}}if(h.lastIndex===s.index){h.lastIndex++}s=h.exec(i)}if(u===i.length){if(c||!h.test("")){W(a,"")}}else{W(a,G(i,u))}return a.length>p?G(a,0,p):a}})()}else if("0".split(void 0,0).length){o.split=function split(t,r){if(typeof t==="undefined"&&r===0){return[]}return B(this,t,r)}}var gr=o.replace;var yr=function(){var t=[];"x".replace(/x(.)?/g,function(r,e){W(t,e)});return t.length===1&&typeof t[0]==="undefined"}();if(!yr){o.replace=function replace(t,r){var e=m(r);var n=O(t)&&/\)[*?]/.test(t.source);if(!e||!n){return gr.call(this,t,r)}else{var i=function(e){var n=arguments.length;var i=t.lastIndex;t.lastIndex=0;var a=t.exec(e)||[];t.lastIndex=i;W(a,arguments[n-2],arguments[n-1]);return r.apply(this,a)};return gr.call(this,t,i)}}}var dr=o.substr;var wr="".substr&&"0b".substr(-1)!=="b";C(o,{substr:function substr(t,r){var e=t;if(t<0){e=y(this.length+t,0)}return dr.call(this,e,r)}},wr);var br=" \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 mr="\u200b";var Tr="["+br+"]";var Dr=new RegExp("^"+Tr+Tr+"*");var xr=new RegExp(Tr+Tr+"*$");var Sr=o.trim&&(br.trim()||!mr.trim());C(o,{trim:function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return a(this).replace(Dr,"").replace(xr,"")}},Sr);var Or=p.bind(String.prototype.trim);var Er=o.lastIndexOf&&"abc\u3042\u3044".lastIndexOf("\u3042\u3044",2)!==-1;C(o,{lastIndexOf:function lastIndexOf(t){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var r=a(this);var e=a(t);var n=arguments.length>1?u(arguments[1]):NaN;var i=A(n)?Infinity:P.ToInteger(n);var o=d(y(i,0),r.length);var f=e.length;var s=o+f;while(s>0){s=y(0,s-f);var l=H(G(r,s,o+f),e);if(l!==-1){return s+l}}return-1}},Er);var jr=o.lastIndexOf;C(o,{lastIndexOf:function lastIndexOf(t){return jr.apply(this,arguments)}},o.lastIndexOf.length!==1);if(parseInt(br+"08")!==8||parseInt(br+"0x16")!==22){parseInt=function(t){var r=/^[\-+]?0[xX]/;return function parseInt(e,n){var i=Or(e);var a=u(n)||(r.test(i)?16:10);return t(i,a)}}(parseInt)}if(1/parseFloat("-0")!==-Infinity){parseFloat=function(t){return function parseFloat(r){var e=Or(r);var n=t(e);return n===0&&G(e,0,1)==="-"?-0:n}}(parseFloat)}if(String(new RangeError("test"))!=="RangeError: test"){var Ir=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=a(t)}var r=this.message;if(typeof r==="undefined"){r=""}else if(typeof r!=="string"){r=a(r)}if(!t){return r}if(!r){return t}return t+": "+r};Error.prototype.toString=Ir}if(k){var Mr=function(t,r){if(L(t,r)){var e=Object.getOwnPropertyDescriptor(t,r);e.enumerable=false;Object.defineProperty(t,r,e)}};Mr(Error.prototype,"message");if(Error.prototype.message!==""){Error.prototype.message=""}Mr(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var Ur=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=Ur}});
//# sourceMappingURL=es5-shim.map
{
"name": "es5-shim",
"version": "4.4.1",
"version": "4.5.0",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",

@@ -25,3 +25,3 @@ "homepage": "http://github.com/es-shims/es5-shim/",

"scripts": {
"minify": "npm run minify-shim && npm run minify-sham",
"minify": "parallelshell 'npm run minify-shim' 'npm run minify-sham'",
"minify-shim": "uglifyjs es5-shim.js --keep-fnames --comments --source-map=es5-shim.map -m -b ascii_only=true,beautify=false > es5-shim.min.js",

@@ -32,3 +32,3 @@ "minify-sham": "uglifyjs es5-sham.js --keep-fnames --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js",

"test-native": "jasmine-node --matchall tests/spec/",
"lint": "npm run jscs && npm run eslint",
"lint": "parallelshell 'npm run jscs' 'npm run eslint'",
"eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js",

@@ -38,9 +38,10 @@ "jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js"

"devDependencies": {
"eslint": "^1.10.1",
"@ljharb/eslint-config": "^1.6.0",
"eslint": "^1.10.3",
"@ljharb/eslint-config": "^1.6.1",
"jasmine-node": "^1.14.5",
"jscs": "^2.6.0",
"jscs": "^2.8.0",
"uglify-js": "^2.6.1",
"replace": "^0.3.0",
"semver": "^5.1.0"
"semver": "^5.1.0",
"parallelshell": "^2.0.0"
},

@@ -47,0 +48,0 @@ "engines": {

@@ -65,2 +65,3 @@ #es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>

* parseInt
* parseFloat
* Error.prototype.toString

@@ -67,0 +68,0 @@ * Error.prototype.name

@@ -9,4 +9,9 @@ /* global describe, it, xit, expect, beforeEach, jasmine */

var obj = {};
Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
for (var _ in obj) { return false; }
Object.defineProperty(obj, 'x', {
enumerable: false,
value: obj
});
for (var _ in obj) {
return false;
}
return obj.x === obj;

@@ -20,2 +25,79 @@ } catch (e) { /* this is ES3 */

var negativeDate;
beforeEach(function () {
var negativeCanned = [
{
getTime: -3509827329600292,
getUTCDay: 4,
getDay: 4,
dim: 31
}, {
getTime: -3509824651200292,
getUTCDay: 0,
getDay: 0,
dim: 29
}, {
getTime: -3509822145600292,
getUTCDay: 1,
getDay: 1,
dim: 31
}, {
getTime: -3509819467200292,
getUTCDay: 4,
getDay: 4,
dim: 30
}, {
getTime: -3509816875200292,
getUTCDay: 6,
getDay: 6,
dim: 31
}, {
getTime: -3509814196800292,
getUTCDay: 2,
getDay: 2,
dim: 30
}, {
getTime: -3509811604800292,
getUTCDay: 4,
getDay: 4,
dim: 31
}, {
getTime: -3509808926400292,
getUTCDay: 0,
getDay: 0,
dim: 31
}, {
getTime: -3509806248000292,
getUTCDay: 3,
getDay: 3,
dim: 30
}, {
getTime: -3509803656000292,
getUTCDay: 5,
getDay: 5,
dim: 31
}, {
getTime: -3509800977600292,
getUTCDay: 1,
getDay: 1,
dim: 30
}, {
getTime: -3509798385600292,
getUTCDay: 3,
getDay: 3,
dim: 31
}
];
negativeDate = negativeCanned.map(function (item) {
var dateFirst = new Date(item.getTime);
var dateLast = new Date(item.getTime + ((item.dim - 1) * 86400000));
return {
dates: [dateFirst, dateLast],
days: [1, item.dim],
getUTCDay: [item.getUTCDay, (item.getUTCDay + item.dim - 1) % 7],
getDay: [item.getDay, (item.getDay + item.dim - 1) % 7]
};
});
});
describe('.now()', function () {

@@ -33,3 +115,3 @@ it('should be the current time', function () {

it('works with standard formats', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(+new Date('2012-12-31T23:59:59.000Z')).toBe(1356998399000); // 1356998399000 1356998399000 1356998399000 1356998399000 1356998399000

@@ -46,3 +128,3 @@ expect(+new Date('2012-04-04T05:02:02.170Z')).toBe(1333515722170); // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170

expect(new Date('2034-03-01T00:00:00.000Z') -
new Date('2034-02-27T23:59:59.999Z')).toBe(86400001); // 86400001 86400001 86400001 86400001 1
new Date('2034-02-27T23:59:59.999Z')).toBe(86400001); // 86400001 86400001 86400001 86400001 1

@@ -52,30 +134,30 @@ });

ifSupportsDescriptorsIt('is not enumerable', function () {
expect(Object.keys(new Date())).not.toContain('constructor');
expect(Object.keys(new Date())).not.toContain('constructor');
});
it('works as a function', function () {
var zeroDate = Date(0);
expect(zeroDate).toBe(String(zeroDate));
var value = Date(1441705534578);
expect(value).toBe(String(value));
var zeroDate = Date(0);
expect(zeroDate).toBe(String(zeroDate));
var value = Date(1441705534578);
expect(value).toBe(String(value));
});
it('fixes this Safari 8/9 bug', function () {
var offset = new Date(1970).getTimezoneOffset() * 60e3;
var offset = new Date(1970).getTimezoneOffset() * 60e3;
var timestamp = 2147483647; // Math.pow(2, 31) - 1
var date = new Date(1970, 0, 1, 0, 0, 0, timestamp);
var expectedTimestamp = timestamp + offset;
expect(date.getTime()).toBe(expectedTimestamp);
var timestamp = 2147483647; // Math.pow(2, 31) - 1
var date = new Date(1970, 0, 1, 0, 0, 0, timestamp);
var expectedTimestamp = timestamp + offset;
expect(date.getTime()).toBe(expectedTimestamp);
var brokenTimestamp = 2147483648; // Math.pow(2, 31)
var brokenDate = new Date(1970, 0, 1, 0, 0, 0, brokenTimestamp);
var expectedBrokenTimestamp = brokenTimestamp + offset;
expect(brokenDate.getTime()).toBe(expectedBrokenTimestamp); // NaN in Safari 8/9
var brokenTimestamp = 2147483648; // Math.pow(2, 31)
var brokenDate = new Date(1970, 0, 1, 0, 0, 0, brokenTimestamp);
var expectedBrokenTimestamp = brokenTimestamp + offset;
expect(brokenDate.getTime()).toBe(expectedBrokenTimestamp); // NaN in Safari 8/9
var veryBrokenTS = 1435734000000;
var veryBrokenDate = new Date(1970, 0, 1, 0, 0, 0, veryBrokenTS);
var largeDate = new Date('Wed Jul 01 2015 07:00:00 GMT-0700 (PDT)');
var expectedVeryBrokenTS = veryBrokenTS + (largeDate.getTimezoneOffset() * 60e3);
expect(veryBrokenDate.getTime()).toBe(expectedVeryBrokenTS); // NaN in Safari 8/9
var veryBrokenTS = 1435734000000;
var veryBrokenDate = new Date(1970, 0, 1, 0, 0, 0, veryBrokenTS);
var largeDate = new Date('Wed Jul 01 2015 07:00:00 GMT-0700 (PDT)');
var expectedVeryBrokenTS = veryBrokenTS + (largeDate.getTimezoneOffset() * 60e3);
expect(veryBrokenDate.getTime()).toBe(expectedVeryBrokenTS); // NaN in Safari 8/9
});

@@ -88,7 +170,7 @@ });

ifSupportsDescriptorsIt('is not enumerable', function () {
expect(Object.getOwnPropertyDescriptor(Date, 'parse').enumerable).toBe(false);
expect(Object.getOwnPropertyDescriptor(Date, 'parse').enumerable).toBe(false);
});
it('should be an invalid date', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(Date.parse('2012-11-31T23:59:59.000Z')).toBeFalsy(); // 1354406399000 NaN NaN 1354406399000 NaN

@@ -111,3 +193,3 @@ expect(Date.parse('2012-12-31T23:59:60.000Z')).toBeFalsy(); // NaN NaN NaN NaN 1356998400000

var dates = {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1 Safari 8
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1 Safari 8
'2012-12-31T23:59:59.000Z': 1356998399000, // 1356998399000 1356998399000 1356998399000 1356998399000 1356998399000 1356998399000

@@ -130,3 +212,3 @@ '2012-04-04T05:02:02.170Z': 1333515722170, // 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 1333515722170

expect(Date.parse('2034-03-01T00:00:00.000Z') -
Date.parse('2034-02-27T23:59:59.999Z')).toBe(86400001); // 86400001 86400001 86400001 86400001 1
Date.parse('2034-02-27T23:59:59.999Z')).toBe(86400001); // 86400001 86400001 86400001 86400001 1

@@ -141,3 +223,3 @@ });

it('should support extended years', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(Date.parse('0000-01-01T00:00:00.000Z')).toBe(-621672192e5); // -621672192e5 -621672192e5 -621672192e5 -621672192e5 -621672192e5

@@ -155,3 +237,3 @@ expect(Date.parse('0001-01-01T00:00:00Z')).toBe(-621355968e5); // -621355968e5 -621355968e5 -621355968e5 8.64e15 -621355968e5

it('works with timezone offsets', function () {
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
// Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
expect(Date.parse('2012-01-29T12:00:00.000+01:00')).toBe(132783480e4); // 132783480e4 132783480e4 132783480e4 132783480e4 132783480e4

@@ -224,10 +306,39 @@ expect(Date.parse('2012-01-29T12:00:00.000-00:00')).toBe(132783840e4); // 132783840e4 132783840e4 132783840e4 132783840e4 132783840e4

// Opera 10.6/11.61/Opera 12 bug
expect(new Date(-3509827334573292).getUTCDate()).toBe(1);
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getUTCDate()).toBe(item.days[index], date);
});
});
});
});
describe('#getUTCDay()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getUTCDay()).toBe(item.getUTCDay[index]);
});
});
});
});
describe('#getUTCFullYear()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCFullYear()).toBe(-109252);
});
});
});
});
describe('#getUTCMonth()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
expect(new Date(-3509827334573292).getUTCMonth()).toBe(0);
negativeDate.forEach(function (item, index) {
item.dates.forEach(function (date) {
expect(date.getUTCMonth()).toBe(index);
});
});
});

@@ -241,2 +352,129 @@

describe('#getUTCHours()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCHours()).toBe(11);
});
});
});
});
describe('#getUTCMinutes()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCMinutes()).toBe(59);
});
});
});
});
describe('#getUTCSeconds()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCSeconds()).toBe(59);
});
});
});
});
describe('#getUTCMilliseconds()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getUTCMilliseconds()).toBe(708);
});
});
});
});
describe('#getDate()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getDate()).toBe(item.days[index]);
});
});
});
});
describe('#getDay()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date, index) {
expect(date.getDay()).toBe(item.getDay[index]);
});
});
});
});
describe('#getFullYear()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getFullYear()).toBe(-109252);
});
});
});
});
describe('#getMonth()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item, index) {
item.dates.forEach(function (date) {
expect(date.getMonth()).toBe(index);
});
});
});
});
describe('#getHours()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getHours() + Math.floor(date.getTimezoneOffset() / 60)).toBe(11);
});
});
});
});
describe('#getMinutes()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
var off = date.getTimezoneOffset();
var offHours = Math.floor(off / 60);
var offMins = off - offHours * 60;
expect(date.getMinutes() + offMins).toBe(59);
});
});
});
});
describe('#getSeconds()', function () {
it('should return the right value for negative dates', function () {
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getSeconds()).toBe(59);
});
});
});
});
describe('#getMilliseconds()', function () {
it('should return the right value for negative dates', function () {
// Opera 10.6/11.61/Opera 12 bug
negativeDate.forEach(function (item) {
item.dates.forEach(function (date) {
expect(date.getMilliseconds()).toBe(708);
});
});
});
});
describe('#toISOString()', function () {

@@ -251,4 +489,10 @@ // TODO: write the rest of the test.

it('should return correct dates', function () {
expect(new Date(-1).toISOString()).toBe('1969-12-31T23:59:59.999Z');// Safari 5.1.5 "1969-12-31T23:59:59.-01Z"
expect(new Date(-3509827334573292).toISOString()).toBe('-109252-01-01T10:37:06.708Z'); // Opera 11.61/Opera 12 bug with Date#getUTCMonth
expect(new Date(-1).toISOString()).toBe('1969-12-31T23:59:59.999Z'); // Safari 5.1.5 "1969-12-31T23:59:59.-01Z"
negativeDate.forEach(function (item, index) {
var m = index + 1;
item.dates.forEach(function (date, idx) {
var d = item.days[idx];
expect(date.toISOString()).toBe('-109252-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d) + 'T11:59:59.708Z'); // Opera 11.61/Opera 12 bug with Date#getUTCMonth
});
});
});

@@ -258,2 +502,22 @@

describe('#toUTCString()', function () {
it('should return correct dates', function () {
expect(new Date(-1509842289600292).toUTCString()).toBe('Mon, 01 Jan -45875 11:59:59 GMT');
});
});
describe('#toDateString()', function () {
it('should return correct dates', function () {
expect(new Date(-1509842289600292).toDateString()).toBe('Mon Jan 01 -45875');
});
});
describe('#toString()', function () {
it('should return correct dates', function () {
var actual = new Date(1449662400000).toString();
var re = /^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/;
expect(re.test(actual)).toBe(true, actual);
});
});
describe('#toJSON()', function () {

@@ -263,19 +527,19 @@

it('should call toISOString', function () {
var date = new Date(0);
date.toISOString = function () {
return 1;
};
expect(date.toJSON()).toBe(1);
var date = new Date(0);
date.toISOString = function () {
return 1;
};
expect(date.toJSON()).toBe(1);
});
it('should return null for not finite dates', function () {
var date = new Date(NaN),
json;
try {
json = date.toJSON();
} catch (e) {
/* invalid json */
expect(e).not.toEqual(jasmine.any(Error));
}
expect(json).toBe(null);
var date = new Date(NaN),
json;
try {
json = date.toJSON();
} catch (e) {
/* invalid json */
expect(e).not.toEqual(jasmine.any(Error));
}
expect(json).toBe(null);
});

@@ -282,0 +546,0 @@

@@ -10,2 +10,9 @@ /* global describe, it, xit, expect */

var is = function (x, y) {
if (x === 0 && y === 0) {
return 1 / x === 1 / y;
}
return x === y;
};
describe('parseInt', function () {

@@ -66,2 +73,13 @@ /* eslint-disable radix */

});
describe('parseFloat()', function () {
it('works with zeroes', function () {
expect(is(parseFloat('0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat(' 0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat('+0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat(' +0'), 0) ? '+0' : '-0').toBe('+0');
expect(is(parseFloat('-0'), -0) ? '-0' : '+0').toBe('-0');
expect(is(parseFloat(' -0'), -0) ? '-0' : '+0').toBe('-0');
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc