Comparing version 4.1.7 to 4.1.8
@@ -5,3 +5,3 @@ { | ||
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
"version": "v4.1.7", | ||
"version": "v4.1.8", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "shim", |
@@ -35,2 +35,3 @@ /*! | ||
var owns = call.bind(prototypeOfObject.hasOwnProperty); | ||
var propertyIsEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable); | ||
@@ -124,5 +125,8 @@ // If JS engine supports accessors creating shortcuts. | ||
// If object has a property then it's for sure both `enumerable` and | ||
// `configurable`. | ||
descriptor = { enumerable: true, configurable: true }; | ||
// If object has a property then it's for sure `configurable`, and | ||
// probably `enumerable`. Detect enumerability though. | ||
descriptor = { | ||
enumerable: propertyIsEnumerable(object, property), | ||
configurable: true | ||
}; | ||
@@ -414,3 +418,3 @@ // If JS engine supports accessor properties then property may be a | ||
} else { | ||
if (!supportsAccessors) { | ||
if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) { | ||
throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); | ||
@@ -417,0 +421,0 @@ } |
/*! | ||
* 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.1.7/LICENSE | ||
* see https://github.com/es-shims/es5-shim/blob/v4.1.8/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.prototype.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n;var o;var c;var i;var f=r(t,"__defineGetter__");if(f){n=e.bind(t.__defineGetter__);o=e.bind(t.__defineSetter__);c=e.bind(t.__lookupGetter__);i=e.bind(t.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function x(e){var r=e.__proto__;if(r||r===null){return r}else if(e.constructor){return e.constructor.prototype}else{return t}}}var l=function z(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};if(Object.defineProperty){var a=l({});var u=typeof document==="undefined"||l(document.createElement("div"));if(!u||!a){var p=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||p){var b="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function S(e,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(b+e)}if(p){try{return p.call(Object,e,n)}catch(o){}}var l;if(!r(e,n)){return l}l={enumerable:true,configurable:true};if(f){var a=e.__proto__;var u=e!==t;if(u){e.__proto__=t}var s=c(e,n);var O=i(e,n);if(u){e.__proto__=a}if(s||O){if(s){l.get=s}if(O){l.set=O}return l}}l.value=e[n];l.writable=true;return l}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function D(e){return Object.keys(e)}}if(!Object.create){var s;var O=!({__proto__:null}instanceof Object);var j=function k(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var d=function F(){var e;var t;t=new ActiveXObject("htmlfile");t.write("<script></script>");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var y=function G(){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(O||typeof document==="undefined"){s=function(){return{__proto__:null}}}else{s=function(){var e=j()?d():y();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;e.__proto__=null;var t=function r(){};t.prototype=e;s=function(){return new t};return new t}}Object.create=function A(e,t){var r;var n=function o(){};if(e===null){r=s()}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 _=function C(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var v=_({});var w=typeof document==="undefined"||_(document.createElement("div"));if(!v||!w){var h=Object.defineProperty,m=Object.defineProperties}}if(!Object.defineProperty||h){var P="Property description must be an object: ";var E="Object.defineProperty called on non-object: ";var g="getters & setters can not be defined on this javascript engine";Object.defineProperty=function N(e,r,l){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(E+e)}if(typeof l!=="object"&&typeof l!=="function"||l===null){throw new TypeError(P+l)}if(h){try{return h.call(Object,e,r,l)}catch(a){}}if("value"in l){if(f&&(c(e,r)||i(e,r))){var u=e.__proto__;e.__proto__=t;delete e[r];e[r]=l.value;e.__proto__=u}else{e[r]=l.value}}else{if(!f){throw new TypeError(g)}if("get"in l){n(e,r,l.get)}if("set"in l){o(e,r,l.set)}}return e}}if(!Object.defineProperties||m){Object.defineProperties=function W(e,t){if(m){try{return m.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 X(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function I(e){if(Object(e)!==e){throw new TypeError("Object.freeze can only be called on Objects.")}return e}}try{Object.freeze(function(){})}catch(T){Object.freeze=function(e){return function t(r){if(typeof r==="function"){return r}else{return e(r)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function L(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function q(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function B(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function H(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}}}); | ||
(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.prototype.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n=e.bind(t.propertyIsEnumerable);var o;var c;var i;var f;var a=r(t,"__defineGetter__");if(a){o=e.bind(t.__defineGetter__);c=e.bind(t.__defineSetter__);i=e.bind(t.__lookupGetter__);f=e.bind(t.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function z(e){var r=e.__proto__;if(r||r===null){return r}else if(e.constructor){return e.constructor.prototype}else{return t}}}var l=function S(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};if(Object.defineProperty){var u=l({});var p=typeof document==="undefined"||l(document.createElement("div"));if(!p||!u){var b=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||b){var s="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function D(e,o){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(s+e)}if(b){try{return b.call(Object,e,o)}catch(c){}}var l;if(!r(e,o)){return l}l={enumerable:n(e,o),configurable:true};if(a){var u=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var O=i(e,o);var j=f(e,o);if(p){e.__proto__=u}if(O||j){if(O){l.get=O}if(j){l.set=j}return l}}l.value=e[o];l.writable=true;return l}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function k(e){return Object.keys(e)}}if(!Object.create){var O;var j=!({__proto__:null}instanceof Object);var d=function F(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var y=function G(){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 A(){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"){O=function(){return{__proto__:null}}}else{O=function(){var e=d()?y():_();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;e.__proto__=null;var t=function r(){};t.prototype=e;O=function(){return new t};return new t}}Object.create=function C(e,t){var r;var n=function o(){};if(e===null){r=O()}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 v=function I(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var w=v({});var h=typeof document==="undefined"||v(document.createElement("div"));if(!w||!h){var m=Object.defineProperty,E=Object.defineProperties}}if(!Object.defineProperty||m){var P="Property description must be an object: ";var g="Object.defineProperty called on non-object: ";var T="getters & setters can not be defined on this javascript engine";Object.defineProperty=function N(e,r,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(g+e)}if(typeof n!=="object"&&typeof n!=="function"||n===null){throw new TypeError(P+n)}if(m){try{return m.call(Object,e,r,n)}catch(l){}}if("value"in n){if(a&&(i(e,r)||f(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(!a&&("get"in n||"set"in n)){throw new TypeError(T)}if("get"in n){o(e,r,n.get)}if("set"in n){c(e,r,n.set)}}return e}}if(!Object.defineProperties||E){Object.defineProperties=function W(e,t){if(E){try{return E.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 X(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function L(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 t(r){if(typeof r==="function"){return r}else{return e(r)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function q(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function B(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function H(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function J(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 |
416
es5-shim.js
@@ -42,8 +42,13 @@ /*! | ||
// Shortcut to an often accessed properties, in order to avoid multiple | ||
// dereference that costs universally. | ||
var ArrayPrototype = Array.prototype; | ||
var ObjectPrototype = Object.prototype; | ||
// dereference that costs universally. This also holds a reference to known-good | ||
// functions. | ||
var $Array = Array; | ||
var ArrayPrototype = $Array.prototype; | ||
var $Object = Object; | ||
var ObjectPrototype = $Object.prototype; | ||
var FunctionPrototype = Function.prototype; | ||
var StringPrototype = String.prototype; | ||
var NumberPrototype = Number.prototype; | ||
var $String = String; | ||
var StringPrototype = $String.prototype; | ||
var $Number = Number; | ||
var NumberPrototype = $Number.prototype; | ||
var array_slice = ArrayPrototype.slice; | ||
@@ -55,2 +60,4 @@ var array_splice = ArrayPrototype.splice; | ||
var call = FunctionPrototype.call; | ||
var max = Math.max; | ||
var min = Math.min; | ||
@@ -60,6 +67,2 @@ // Having a toString local variable name breaks in Opera so use to_string. | ||
var isArray = Array.isArray || function isArray(obj) { | ||
return to_string.call(obj) === '[object Array]'; | ||
}; | ||
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; | ||
@@ -70,22 +73,8 @@ var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, tryFunctionObject = function tryFunctionObject(value) { try { fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]'; isCallable = function isCallable(value) { if (typeof value !== 'function') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; }; | ||
var isArguments = function isArguments(value) { | ||
var str = to_string.call(value); | ||
var isArgs = str === '[object Arguments]'; | ||
if (!isArgs) { | ||
isArgs = !isArray(value) && | ||
value !== null && | ||
typeof value === 'object' && | ||
typeof value.length === 'number' && | ||
value.length >= 0 && | ||
isCallable(value.callee); | ||
} | ||
return isArgs; | ||
}; | ||
/* inlined from http://npmjs.com/define-properties */ | ||
var defineProperties = (function (has) { | ||
var supportsDescriptors = Object.defineProperty && (function () { | ||
var supportsDescriptors = $Object.defineProperty && (function () { | ||
try { | ||
var obj = {}; | ||
Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); | ||
$Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); | ||
for (var _ in obj) { return false; } | ||
@@ -104,3 +93,3 @@ return obj.x === obj; | ||
if (!forceAssign && (name in object)) { return; } | ||
Object.defineProperty(object, name, { | ||
$Object.defineProperty(object, name, { | ||
configurable: true, | ||
@@ -184,3 +173,3 @@ enumerable: false, | ||
} | ||
return Object(o); | ||
return $Object(o); | ||
}, | ||
@@ -249,3 +238,3 @@ | ||
); | ||
if (Object(result) === result) { | ||
if ($Object(result) === result) { | ||
return result; | ||
@@ -290,3 +279,3 @@ } | ||
var boundLength = Math.max(0, target.length - args.length); | ||
var boundLength = max(0, target.length - args.length); | ||
@@ -297,3 +286,3 @@ // 17. Set the attributes of the length own property of F to the values | ||
for (var i = 0; i < boundLength; i++) { | ||
boundArgs.push('$' + i); | ||
array_push.call(boundArgs, '$' + i); | ||
} | ||
@@ -344,2 +333,5 @@ | ||
var owns = call.bind(ObjectPrototype.hasOwnProperty); | ||
var toStr = call.bind(ObjectPrototype.toString); | ||
var strSlice = call.bind(StringPrototype.slice); | ||
var strSplit = call.bind(StringPrototype.split); | ||
@@ -351,42 +343,6 @@ // | ||
// ES5 15.4.4.12 | ||
// http://es5.github.com/#x15.4.4.12 | ||
var spliceNoopReturnsEmptyArray = (function () { | ||
var a = [1, 2]; | ||
var result = a.splice(); | ||
return a.length === 2 && isArray(result) && result.length === 0; | ||
}()); | ||
defineProperties(ArrayPrototype, { | ||
// Safari 5.0 bug where .splice() returns undefined | ||
splice: function splice(start, deleteCount) { | ||
if (arguments.length === 0) { | ||
return []; | ||
} else { | ||
return array_splice.apply(this, arguments); | ||
} | ||
} | ||
}, !spliceNoopReturnsEmptyArray); | ||
var isArray = $Array.isArray || function isArray(obj) { | ||
return toStr(obj) === '[object Array]'; | ||
}; | ||
var spliceWorksWithEmptyObject = (function () { | ||
var obj = {}; | ||
ArrayPrototype.splice.call(obj, 0, 0, 1); | ||
return obj.length === 1; | ||
}()); | ||
defineProperties(ArrayPrototype, { | ||
splice: function splice(start, deleteCount) { | ||
if (arguments.length === 0) { return []; } | ||
var args = arguments; | ||
this.length = Math.max(ES.ToInteger(this.length), 0); | ||
if (arguments.length > 0 && typeof deleteCount !== 'number') { | ||
args = array_slice.call(arguments); | ||
if (args.length < 2) { | ||
args.push(this.length - start); | ||
} else { | ||
args[1] = ES.ToInteger(deleteCount); | ||
} | ||
} | ||
return array_splice.apply(this, args); | ||
} | ||
}, !spliceWorksWithEmptyObject); | ||
// ES5 15.4.4.12 | ||
@@ -408,3 +364,3 @@ // http://es5.github.com/#x15.4.4.13 | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray | ||
defineProperties(Array, { isArray: isArray }); | ||
defineProperties($Array, { isArray: isArray }); | ||
@@ -429,3 +385,3 @@ // The IsCallable() check in the Array functions | ||
// and failure of `0 in boxedString` (Rhino) | ||
var boxedString = Object('a'); | ||
var boxedString = $Object('a'); | ||
var splitString = boxedString[0] !== 'a' || !(0 in boxedString); | ||
@@ -454,3 +410,3 @@ | ||
var object = ES.ToObject(this); | ||
var self = splitString && isString(this) ? this.split('') : object; | ||
var self = splitString && isString(this) ? strSplit(this, '') : object; | ||
var i = -1; | ||
@@ -488,5 +444,5 @@ var length = self.length >>> 0; | ||
var object = ES.ToObject(this); | ||
var self = splitString && isString(this) ? this.split('') : object; | ||
var self = splitString && isString(this) ? strSplit(this, '') : object; | ||
var length = self.length >>> 0; | ||
var result = Array(length); | ||
var result = $Array(length); | ||
var T; | ||
@@ -521,3 +477,3 @@ if (arguments.length > 1) { | ||
var object = ES.ToObject(this); | ||
var self = splitString && isString(this) ? this.split('') : object; | ||
var self = splitString && isString(this) ? strSplit(this, '') : object; | ||
var length = self.length >>> 0; | ||
@@ -540,3 +496,3 @@ var result = []; | ||
if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) { | ||
result.push(value); | ||
array_push.call(result, value); | ||
} | ||
@@ -555,3 +511,3 @@ } | ||
var object = ES.ToObject(this); | ||
var self = splitString && isString(this) ? this.split('') : object; | ||
var self = splitString && isString(this) ? strSplit(this, '') : object; | ||
var length = self.length >>> 0; | ||
@@ -583,3 +539,3 @@ var T; | ||
var object = ES.ToObject(this); | ||
var self = splitString && isString(this) ? this.split('') : object; | ||
var self = splitString && isString(this) ? strSplit(this, '') : object; | ||
var length = self.length >>> 0; | ||
@@ -615,3 +571,3 @@ var T; | ||
var object = ES.ToObject(this); | ||
var self = splitString && isString(this) ? this.split('') : object; | ||
var self = splitString && isString(this) ? strSplit(this, '') : object; | ||
var length = self.length >>> 0; | ||
@@ -667,3 +623,3 @@ | ||
var object = ES.ToObject(this); | ||
var self = splitString && isString(this) ? this.split('') : object; | ||
var self = splitString && isString(this) ? strSplit(this, '') : object; | ||
var length = self.length >>> 0; | ||
@@ -716,6 +672,6 @@ | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf | ||
var hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1; | ||
var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1; | ||
defineProperties(ArrayPrototype, { | ||
indexOf: function indexOf(searchElement /*, fromIndex */) { | ||
var self = splitString && isString(this) ? this.split('') : ES.ToObject(this); | ||
var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); | ||
var length = self.length >>> 0; | ||
@@ -733,3 +689,3 @@ | ||
// handle negative indices | ||
i = i >= 0 ? i : Math.max(0, length + i); | ||
i = i >= 0 ? i : max(0, length + i); | ||
for (; i < length; i++) { | ||
@@ -747,6 +703,6 @@ if (i in self && self[i] === searchElement) { | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf | ||
var hasFirefox2LastIndexOfBug = Array.prototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1; | ||
var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1; | ||
defineProperties(ArrayPrototype, { | ||
lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */) { | ||
var self = splitString && isString(this) ? this.split('') : ES.ToObject(this); | ||
var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); | ||
var length = self.length >>> 0; | ||
@@ -759,3 +715,3 @@ | ||
if (arguments.length > 1) { | ||
i = Math.min(i, ES.ToInteger(arguments[1])); | ||
i = min(i, ES.ToInteger(arguments[1])); | ||
} | ||
@@ -773,2 +729,124 @@ // handle negative indices | ||
// ES5 15.4.4.12 | ||
// http://es5.github.com/#x15.4.4.12 | ||
var spliceNoopReturnsEmptyArray = (function () { | ||
var a = [1, 2]; | ||
var result = a.splice(); | ||
return a.length === 2 && isArray(result) && result.length === 0; | ||
}()); | ||
defineProperties(ArrayPrototype, { | ||
// Safari 5.0 bug where .splice() returns undefined | ||
splice: function splice(start, deleteCount) { | ||
if (arguments.length === 0) { | ||
return []; | ||
} else { | ||
return array_splice.apply(this, arguments); | ||
} | ||
} | ||
}, !spliceNoopReturnsEmptyArray); | ||
var spliceWorksWithEmptyObject = (function () { | ||
var obj = {}; | ||
ArrayPrototype.splice.call(obj, 0, 0, 1); | ||
return obj.length === 1; | ||
}()); | ||
defineProperties(ArrayPrototype, { | ||
splice: function splice(start, deleteCount) { | ||
if (arguments.length === 0) { return []; } | ||
var args = arguments; | ||
this.length = max(ES.ToInteger(this.length), 0); | ||
if (arguments.length > 0 && typeof deleteCount !== 'number') { | ||
args = array_slice.call(arguments); | ||
if (args.length < 2) { | ||
array_push.call(args, this.length - start); | ||
} else { | ||
args[1] = ES.ToInteger(deleteCount); | ||
} | ||
} | ||
return array_splice.apply(this, args); | ||
} | ||
}, !spliceWorksWithEmptyObject); | ||
var spliceWorksWithLargeSparseArrays = (function () { | ||
// Per https://github.com/es-shims/es5-shim/issues/295 | ||
// Safari 7/8 breaks with sparse arrays of size 1e5 or greater | ||
var arr = new $Array(1e5); | ||
// note: the index MUST be 8 or larger or the test will false pass | ||
arr[8] = 'x'; | ||
arr.splice(1, 1); | ||
// note: this test must be defined *after* the indexOf shim | ||
// per https://github.com/es-shims/es5-shim/issues/313 | ||
return arr.indexOf('x') === 7; | ||
}()); | ||
var spliceWorksWithSmallSparseArrays = (function () { | ||
// Per https://github.com/es-shims/es5-shim/issues/295 | ||
// Opera 12.15 breaks on this, no idea why. | ||
var n = 256; | ||
var arr = []; | ||
arr[n] = 'a'; | ||
arr.splice(n + 1, 0, 'b'); | ||
return arr[n] === 'a'; | ||
}()); | ||
defineProperties(ArrayPrototype, { | ||
splice: function splice(start, deleteCount) { | ||
var O = ES.ToObject(this); | ||
var A = []; | ||
var len = ES.ToUint32(O.length); | ||
var relativeStart = ES.ToInteger(start); | ||
var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len); | ||
var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart); | ||
var k = 0; | ||
var from; | ||
while (k < actualDeleteCount) { | ||
from = $String(actualStart + k); | ||
if (owns(O, from)) { | ||
A[k] = O[from]; | ||
} | ||
k += 1; | ||
} | ||
var items = array_slice.call(arguments, 2); | ||
var itemCount = items.length; | ||
var to; | ||
if (itemCount < actualDeleteCount) { | ||
k = actualStart; | ||
while (k < (len - actualDeleteCount)) { | ||
from = $String(k + actualDeleteCount); | ||
to = $String(k + itemCount); | ||
if (owns(O, from)) { | ||
O[to] = O[from]; | ||
} else { | ||
delete O[to]; | ||
} | ||
k += 1; | ||
} | ||
k = len; | ||
while (k > (len - actualDeleteCount + itemCount)) { | ||
delete O[k - 1]; | ||
k -= 1; | ||
} | ||
} else if (itemCount > actualDeleteCount) { | ||
k = len - actualDeleteCount; | ||
while (k > actualStart) { | ||
from = $String(k + actualDeleteCount - 1); | ||
to = $String(k + itemCount - 1); | ||
if (owns(O, from)) { | ||
O[to] = O[from]; | ||
} else { | ||
delete O[to]; | ||
} | ||
k -= 1; | ||
} | ||
} | ||
k = actualStart; | ||
for (var i = 0; i < items.length; ++i) { | ||
O[k] = items[i]; | ||
k += 1; | ||
} | ||
O.length = len - actualDeleteCount + itemCount; | ||
return A; | ||
} | ||
}, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays); | ||
// | ||
@@ -783,22 +861,55 @@ // Object | ||
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation | ||
var hasDontEnumBug = !({ 'toString': null }).propertyIsEnumerable('toString'), | ||
hasProtoEnumBug = function () {}.propertyIsEnumerable('prototype'), | ||
hasStringEnumBug = !owns('x', '0'), | ||
dontEnums = [ | ||
'toString', | ||
'toLocaleString', | ||
'valueOf', | ||
'hasOwnProperty', | ||
'isPrototypeOf', | ||
'propertyIsEnumerable', | ||
'constructor' | ||
], | ||
dontEnumsLength = dontEnums.length; | ||
var hasDontEnumBug = !({ 'toString': null }).propertyIsEnumerable('toString'); | ||
var hasProtoEnumBug = function () {}.propertyIsEnumerable('prototype'); | ||
var hasStringEnumBug = !owns('x', '0'); | ||
var equalsConstructorPrototype = function (o) { | ||
var ctor = o.constructor; | ||
return ctor && ctor.prototype === o; | ||
}; | ||
var blacklistedKeys = ['window', 'console', 'parent', 'self', 'frames']; | ||
var hasAutomationEqualityBug = (function () { | ||
/* globals window */ | ||
if (typeof window === 'undefined') { return false; } | ||
for (var k in window) { | ||
if (blacklistedKeys.indexOf(k) === -1 && owns(window, k) && window[k] !== null && typeof window[k] === 'object') { | ||
try { | ||
equalsConstructorPrototype(window[k]); | ||
} catch (e) { | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
}()); | ||
var dontEnums = [ | ||
'toString', | ||
'toLocaleString', | ||
'valueOf', | ||
'hasOwnProperty', | ||
'isPrototypeOf', | ||
'propertyIsEnumerable', | ||
'constructor' | ||
]; | ||
var dontEnumsLength = dontEnums.length; | ||
defineProperties(Object, { | ||
var isArguments = function isArguments(value) { | ||
var str = toStr(value); | ||
var isArgs = str === '[object Arguments]'; | ||
if (!isArgs) { | ||
isArgs = !isArray(value) && | ||
value !== null && | ||
typeof value === 'object' && | ||
typeof value.length === 'number' && | ||
value.length >= 0 && | ||
isCallable(value.callee); | ||
} | ||
return isArgs; | ||
}; | ||
defineProperties($Object, { | ||
keys: function keys(object) { | ||
var isFn = isCallable(object), | ||
isArgs = isArguments(object), | ||
isObject = object !== null && typeof object === 'object', | ||
isStr = isObject && isString(object); | ||
var isFn = isCallable(object); | ||
var isArgs = isArguments(object); | ||
var isObject = object !== null && typeof object === 'object'; | ||
var isStr = isObject && isString(object); | ||
@@ -813,3 +924,3 @@ if (!isObject && !isFn && !isArgs) { | ||
for (var i = 0; i < object.length; ++i) { | ||
theKeys.push(String(i)); | ||
array_push.call(theKeys, $String(i)); | ||
} | ||
@@ -821,3 +932,3 @@ } | ||
if (!(skipProto && name === 'prototype') && owns(object, name)) { | ||
theKeys.push(String(name)); | ||
array_push.call(theKeys, $String(name)); | ||
} | ||
@@ -828,8 +939,7 @@ } | ||
if (hasDontEnumBug) { | ||
var ctor = object.constructor, | ||
skipConstructor = ctor && ctor.prototype === object; | ||
var skipConstructor = hasAutomationEqualityBug || equalsConstructorPrototype(object); | ||
for (var j = 0; j < dontEnumsLength; j++) { | ||
var dontEnum = dontEnums[j]; | ||
if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) { | ||
theKeys.push(dontEnum); | ||
array_push.call(theKeys, dontEnum); | ||
} | ||
@@ -842,11 +952,11 @@ } | ||
var keysWorksWithArguments = Object.keys && (function () { | ||
var keysWorksWithArguments = $Object.keys && (function () { | ||
// Safari 5.0 bug | ||
return Object.keys(arguments).length === 2; | ||
return $Object.keys(arguments).length === 2; | ||
}(1, 2)); | ||
var originalKeys = Object.keys; | ||
defineProperties(Object, { | ||
var originalKeys = $Object.keys; | ||
defineProperties($Object, { | ||
keys: function keys(object) { | ||
if (isArguments(object)) { | ||
return originalKeys(ArrayPrototype.slice.call(object)); | ||
return originalKeys(array_slice.call(object)); | ||
} else { | ||
@@ -873,2 +983,3 @@ return originalKeys(object); | ||
var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1; | ||
var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z'; | ||
@@ -893,3 +1004,3 @@ defineProperties(Date.prototype, { | ||
(year < 0 ? '-' : (year > 9999 ? '+' : '')) + | ||
('00000' + Math.abs(year)).slice((0 <= year && year <= 9999) ? -4 : -6) | ||
strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6) | ||
); | ||
@@ -908,8 +1019,8 @@ | ||
return ( | ||
year + '-' + result.slice(0, 2).join('-') + | ||
'T' + result.slice(2).join(':') + '.' + | ||
('000' + this.getUTCMilliseconds()).slice(-3) + 'Z' | ||
year + '-' + array_slice.call(result, 0, 2).join('-') + | ||
'T' + array_slice.call(result, 2).join(':') + '.' + | ||
strSlice('000' + this.getUTCMilliseconds(), -3) + 'Z' | ||
); | ||
} | ||
}, hasNegativeDateBug); | ||
}, hasNegativeDateBug || hasSafari51DateBug); | ||
@@ -940,3 +1051,3 @@ // ES5 15.9.5.44 | ||
// 2. Let tv be ES.ToPrimitive(O, hint Number). | ||
var O = Object(this); | ||
var O = $Object(this); | ||
var tv = ES.ToPrimitive(O); | ||
@@ -988,3 +1099,3 @@ // 3. If tv is a Number and is not finite, return null. | ||
if (this instanceof NativeDate) { | ||
date = length === 1 && String(Y) === Y ? // isString(Y) | ||
date = length === 1 && $String(Y) === Y ? // isString(Y) | ||
// We explicitly pass it through parse: | ||
@@ -1047,3 +1158,3 @@ new NativeDate(DateShim.parse(Y)) : | ||
var toUTC = function toUTC(t) { | ||
return Number(new NativeDate(1970, 0, 1, 0, 0, 0, t)); | ||
return $Number(new NativeDate(1970, 0, 1, 0, 0, 0, t)); | ||
}; | ||
@@ -1075,9 +1186,9 @@ | ||
// parse the UTC offset component | ||
var year = Number(match[1]), | ||
month = Number(match[2] || 1) - 1, | ||
day = Number(match[3] || 1) - 1, | ||
hour = Number(match[4] || 0), | ||
minute = Number(match[5] || 0), | ||
second = Number(match[6] || 0), | ||
millisecond = Math.floor(Number(match[7] || 0) * 1000), | ||
var year = $Number(match[1]), | ||
month = $Number(match[2] || 1) - 1, | ||
day = $Number(match[3] || 1) - 1, | ||
hour = $Number(match[4] || 0), | ||
minute = $Number(match[5] || 0), | ||
second = $Number(match[6] || 0), | ||
millisecond = Math.floor($Number(match[7] || 0) * 1000), | ||
// When time zone is missed, local offset should be used | ||
@@ -1088,4 +1199,4 @@ // (ES 5.1 bug) | ||
signOffset = match[9] === '-' ? 1 : -1, | ||
hourOffset = Number(match[10] || 0), | ||
minuteOffset = Number(match[11] || 0), | ||
hourOffset = $Number(match[10] || 0), | ||
minuteOffset = $Number(match[11] || 0), | ||
result; | ||
@@ -1181,7 +1292,7 @@ if ( | ||
if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) { | ||
var t = String(toFixedHelpers.data[i]); | ||
var t = $String(toFixedHelpers.data[i]); | ||
if (s === '') { | ||
s = t; | ||
} else { | ||
s += '0000000'.slice(0, 7 - t.length) + t; | ||
s += strSlice('0000000', 0, 7 - t.length) + t; | ||
} | ||
@@ -1215,3 +1326,3 @@ } | ||
// Test for NaN and round fractionDigits down | ||
f = Number(fractionDigits); | ||
f = $Number(fractionDigits); | ||
f = f !== f ? 0 : Math.floor(f); | ||
@@ -1223,3 +1334,3 @@ | ||
x = Number(this); | ||
x = $Number(this); | ||
@@ -1233,3 +1344,3 @@ // Test for NaN | ||
if (x <= -1e21 || x >= 1e21) { | ||
return String(x); | ||
return $String(x); | ||
} | ||
@@ -1280,3 +1391,3 @@ | ||
toFixedHelpers.multiply(1 << (-e), 0); | ||
m = toFixedHelpers.numToString() + '0.00000000000000000000'.slice(2, 2 + f); | ||
m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f); | ||
} | ||
@@ -1289,5 +1400,5 @@ } | ||
if (k <= f) { | ||
m = s + '0.0000000000000000000'.slice(0, f - k + 2) + m; | ||
m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m; | ||
} else { | ||
m = s + m.slice(0, k - f) + '.' + m.slice(k - f); | ||
m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f); | ||
} | ||
@@ -1322,3 +1433,2 @@ } else { | ||
var string_split = StringPrototype.split; | ||
if ( | ||
@@ -1343,3 +1453,3 @@ 'ab'.split(/(?:ab)*/).length !== 2 || | ||
if (!isRegex(separator)) { | ||
return string_split.call(this, separator, limit); | ||
return strSplit(this, separator, limit); | ||
} | ||
@@ -1376,3 +1486,3 @@ | ||
if (lastIndex > lastLastIndex) { | ||
output.push(string.slice(lastLastIndex, match.index)); | ||
array_push.call(output, strSlice(string, lastLastIndex, match.index)); | ||
// Fix browsers whose `exec` methods don't consistently return `undefined` for | ||
@@ -1392,3 +1502,3 @@ // nonparticipating capturing groups | ||
if (match.length > 1 && match.index < string.length) { | ||
array_push.apply(output, match.slice(1)); | ||
array_push.apply(output, array_slice.call(match, 1)); | ||
} | ||
@@ -1408,8 +1518,8 @@ lastLength = match[0].length; | ||
if (lastLength || !separatorCopy.test('')) { | ||
output.push(''); | ||
array_push.call(output, ''); | ||
} | ||
} else { | ||
output.push(string.slice(lastLastIndex)); | ||
array_push.call(output, strSlice(string, lastLastIndex)); | ||
} | ||
return output.length > splitLimit ? output.slice(0, splitLimit) : output; | ||
return output.length > splitLimit ? strSlice(output, 0, splitLimit) : output; | ||
}; | ||
@@ -1427,3 +1537,3 @@ }()); | ||
if (typeof separator === 'undefined' && limit === 0) { return []; } | ||
return string_split.call(this, separator, limit); | ||
return strSplit(this, separator, limit); | ||
}; | ||
@@ -1436,3 +1546,3 @@ } | ||
'x'.replace(/x(.)?/g, function (match, group) { | ||
groups.push(group); | ||
array_push.call(groups, group); | ||
}); | ||
@@ -1455,3 +1565,3 @@ return groups.length === 1 && typeof groups[0] === 'undefined'; | ||
searchValue.lastIndex = originalLastIndex; | ||
args.push(arguments[length - 2], arguments[length - 1]); | ||
array_push.call(args, arguments[length - 2], arguments[length - 1]); | ||
return replaceValue.apply(this, args); | ||
@@ -1475,3 +1585,3 @@ }; | ||
if (start < 0) { | ||
normalizedStart = Math.max(this.length + start, 0); | ||
normalizedStart = max(this.length + start, 0); | ||
} | ||
@@ -1499,3 +1609,3 @@ return string_substr.call(this, normalizedStart, length); | ||
} | ||
return String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, ''); | ||
return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, ''); | ||
} | ||
@@ -1510,4 +1620,4 @@ }, hasTrimWhitespaceBug); | ||
return function parseInt(str, radix) { | ||
var string = String(str).trim(); | ||
var defaultedRadix = Number(radix) || (hexRegex.test(string) ? 16 : 10); | ||
var string = $String(str).trim(); | ||
var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); | ||
return origParseInt(string, defaultedRadix); | ||
@@ -1514,0 +1624,0 @@ }; |
/*! | ||
* 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.1.7/LICENSE | ||
* see https://github.com/es-shims/es5-shim/blob/v4.1.8/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.prototype;var e=Object.prototype;var r=Function.prototype;var n=String.prototype;var i=Number.prototype;var a=t.slice;var o=t.splice;var u=t.push;var l=t.unshift;var f=t.concat;var s=r.call;var c=e.toString;var p=Array.isArray||function yt(t){return c.call(t)==="[object Array]"};var h=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var v;var g=Function.prototype.toString,y=function dt(t){try{g.call(t);return true}catch(e){return false}},d="[object Function]",m="[object GeneratorFunction]";v=function mt(t){if(typeof t!=="function"){return false}if(h){return y(t)}var e=c.call(t);return e===d||e===m};var b;var w=RegExp.prototype.exec,T=function bt(t){try{w.call(t);return true}catch(e){return false}},x="[object RegExp]";b=function wt(t){if(typeof t!=="object"){return false}return h?T(t):c.call(t)===x};var O;var j=String.prototype.valueOf,S=function Tt(t){try{j.call(t);return true}catch(e){return false}},N="[object String]";O=function xt(t){if(typeof t==="string"){return true}if(typeof t!=="object"){return false}return h?S(t):c.call(t)===N};var E=function Ot(t){var e=c.call(t);var r=e==="[object Arguments]";if(!r){r=!p(t)&&t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&v(t.callee)}return r};var I=function(t){var e=Object.defineProperty&&function(){try{var t={};Object.defineProperty(t,"x",{enumerable:false,value:t});for(var e in t){return false}return t.x===t}catch(r){return false}}();var r;if(e){r=function(t,e,r,n){if(!n&&e in t){return}Object.defineProperty(t,e,{configurable:true,enumerable:false,writable:true,value:r})}}else{r=function(t,e,r,n){if(!n&&e in t){return}t[e]=r}}return function n(e,i,a){for(var o in i){if(t.call(i,o)){r(e,o,i[o],a)}}}}(e.hasOwnProperty);var D=function jt(t){var e=typeof t;return t===null||e!=="object"&&e!=="function"};var M={ToInteger:function St(t){var e=+t;if(e!==e){e=0}else if(e!==0&&e!==1/0&&e!==-(1/0)){e=(e>0||-1)*Math.floor(Math.abs(e))}return e},ToPrimitive:function Nt(t){var e,r,n;if(D(t)){return t}r=t.valueOf;if(v(r)){e=r.call(t);if(D(e)){return e}}n=t.toString;if(v(n)){e=n.call(t);if(D(e)){return e}}throw new TypeError},ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return Object(t)},ToUint32:function Et(t){return t>>>0}};var k=function It(){};I(r,{bind:function Dt(t){var e=this;if(!v(e)){throw new TypeError("Function.prototype.bind called on incompatible "+e)}var r=a.call(arguments,1);var n;var i=function(){if(this instanceof n){var i=e.apply(this,f.call(r,a.call(arguments)));if(Object(i)===i){return i}return this}else{return e.apply(t,f.call(r,a.call(arguments)))}};var o=Math.max(0,e.length-r.length);var u=[];for(var l=0;l<o;l++){u.push("$"+l)}n=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this, arguments); }")(i);if(e.prototype){k.prototype=e.prototype;n.prototype=new k;k.prototype=null}return n}});var A=s.bind(e.hasOwnProperty);var F=function(){var t=[1,2];var e=t.splice();return t.length===2&&p(e)&&e.length===0}();I(t,{splice:function Mt(t,e){if(arguments.length===0){return[]}else{return o.apply(this,arguments)}}},!F);var R=function(){var e={};t.splice.call(e,0,0,1);return e.length===1}();I(t,{splice:function kt(t,e){if(arguments.length===0){return[]}var r=arguments;this.length=Math.max(M.ToInteger(this.length),0);if(arguments.length>0&&typeof e!=="number"){r=a.call(arguments);if(r.length<2){r.push(this.length-t)}else{r[1]=M.ToInteger(e)}}return o.apply(this,r)}},!R);var U=[].unshift(0)!==1;I(t,{unshift:function(){l.apply(this,arguments);return this.length}},U);I(Array,{isArray:p});var C=Object("a");var P=C[0]!=="a"||!(0 in C);var Z=function At(t){var e=true;var r=true;if(t){t.call("foo",function(t,r,n){if(typeof n!=="object"){e=false}});t.call([1],function(){"use strict";r=typeof this==="string"},"x")}return!!t&&e&&r};I(t,{forEach:function Ft(t){var e=M.ToObject(this);var r=P&&O(this)?this.split(""):e;var n=-1;var i=r.length>>>0;var a;if(arguments.length>1){a=arguments[1]}if(!v(t)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<i){if(n in r){if(typeof a!=="undefined"){t.call(a,r[n],n,e)}else{t(r[n],n,e)}}}}},!Z(t.forEach));I(t,{map:function Rt(t){var e=M.ToObject(this);var r=P&&O(this)?this.split(""):e;var n=r.length>>>0;var i=Array(n);var a;if(arguments.length>1){a=arguments[1]}if(!v(t)){throw new TypeError("Array.prototype.map callback must be a function")}for(var o=0;o<n;o++){if(o in r){if(typeof a!=="undefined"){i[o]=t.call(a,r[o],o,e)}else{i[o]=t(r[o],o,e)}}}return i}},!Z(t.map));I(t,{filter:function Ut(t){var e=M.ToObject(this);var r=P&&O(this)?this.split(""):e;var n=r.length>>>0;var i=[];var a;var o;if(arguments.length>1){o=arguments[1]}if(!v(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)){i.push(a)}}}return i}},!Z(t.filter));I(t,{every:function Ct(t){var e=M.ToObject(this);var r=P&&O(this)?this.split(""):e;var n=r.length>>>0;var i;if(arguments.length>1){i=arguments[1]}if(!v(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}},!Z(t.every));I(t,{some:function Pt(t){var e=M.ToObject(this);var r=P&&O(this)?this.split(""):e;var n=r.length>>>0;var i;if(arguments.length>1){i=arguments[1]}if(!v(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}},!Z(t.some));var J=false;if(t.reduce){J=typeof t.reduce.call("es5",function(t,e,r,n){return n})==="object"}I(t,{reduce:function Zt(t){var e=M.ToObject(this);var r=P&&O(this)?this.split(""):e;var n=r.length>>>0;if(!v(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}},!J);var z=false;if(t.reduceRight){z=typeof t.reduceRight.call("es5",function(t,e,r,n){return n})==="object"}I(t,{reduceRight:function Jt(t){var e=M.ToObject(this);var r=P&&O(this)?this.split(""):e;var n=r.length>>>0;if(!v(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}},!z);var $=Array.prototype.indexOf&&[0,1].indexOf(1,2)!==-1;I(t,{indexOf:function zt(t){var e=P&&O(this)?this.split(""):M.ToObject(this);var r=e.length>>>0;if(r===0){return-1}var n=0;if(arguments.length>1){n=M.ToInteger(arguments[1])}n=n>=0?n:Math.max(0,r+n);for(;n<r;n++){if(n in e&&e[n]===t){return n}}return-1}},$);var B=Array.prototype.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;I(t,{lastIndexOf:function $t(t){var e=P&&O(this)?this.split(""):M.ToObject(this);var r=e.length>>>0;if(r===0){return-1}var n=r-1;if(arguments.length>1){n=Math.min(n,M.ToInteger(arguments[1]))}n=n>=0?n:r-Math.abs(n);for(;n>=0;n--){if(n in e&&t===e[n]){return n}}return-1}},B);var G=!{toString:null}.propertyIsEnumerable("toString"),H=function(){}.propertyIsEnumerable("prototype"),L=!A("x","0"),X=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Y=X.length;I(Object,{keys:function Bt(t){var e=v(t),r=E(t),n=t!==null&&typeof t==="object",i=n&&O(t);if(!n&&!e&&!r){throw new TypeError("Object.keys called on a non-object")}var a=[];var o=H&&e;if(i&&L||r){for(var u=0;u<t.length;++u){a.push(String(u))}}if(!r){for(var l in t){if(!(o&&l==="prototype")&&A(t,l)){a.push(String(l))}}}if(G){var f=t.constructor,s=f&&f.prototype===t;for(var c=0;c<Y;c++){var p=X[c];if(!(s&&p==="constructor")&&A(t,p)){a.push(p)}}}return a}});var q=Object.keys&&function(){return Object.keys(arguments).length===2}(1,2);var K=Object.keys;I(Object,{keys:function Gt(e){if(E(e)){return K(t.slice.call(e))}else{return K(e)}}},!q);var Q=-621987552e5;var V="-000001";var W=Date.prototype.toISOString&&new Date(Q).toISOString().indexOf(V)===-1;I(Date.prototype,{toISOString:function Ht(){var t,e,r,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;t=[i+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()];n=(n<0?"-":n>9999?"+":"")+("00000"+Math.abs(n)).slice(0<=n&&n<=9999?-4:-6);e=t.length;while(e--){r=t[e];if(r<10){t[e]="0"+r}}return n+"-"+t.slice(0,2).join("-")+"T"+t.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"}},W);var _=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(Q).toJSON().indexOf(V)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(t){return false}}();if(!_){Date.prototype.toJSON=function Lt(t){var e=Object(this);var r=M.ToPrimitive(e);if(typeof r==="number"&&!isFinite(r)){return null}var n=e.toISOString;if(!v(n)){throw new TypeError("toISOString property is not callable")}return n.call(e)}}var tt=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var et=!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 rt=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(!Date.parse||rt||et||!tt){Date=function(t){var e=function l(r,n,i,a,o,u,f){var s=arguments.length;var c;if(this instanceof t){c=s===1&&String(r)===r?new t(e.parse(r)):s>=7?new t(r,n,i,a,o,u,f):s>=6?new t(r,n,i,a,o,u):s>=5?new t(r,n,i,a,o):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):new t}else{c=t.apply(this,arguments)}I(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 f(t,e){var r=e>1?1:0;return n[e]+Math.floor((t-1969+r)/4)-Math.floor((t-1901+r)/100)+Math.floor((t-1601+r)/400)+365*(t-1970)};var a=function s(e){return Number(new t(1970,0,1,0,0,0,e))};for(var o in t){if(A(t,o)){e[o]=t[o]}}I(e,{now:t.now,UTC:t.UTC},true);e.prototype=t.prototype;I(e.prototype,{constructor:e},true);var u=function c(e){var n=r.exec(e);if(n){var o=Number(n[1]),u=Number(n[2]||1)-1,l=Number(n[3]||1)-1,f=Number(n[4]||0),s=Number(n[5]||0),c=Number(n[6]||0),p=Math.floor(Number(n[7]||0)*1e3),h=Boolean(n[4]&&!n[8]),v=n[9]==="-"?1:-1,g=Number(n[10]||0),y=Number(n[11]||0),d;if(f<(s>0||c>0||p>0?24:25)&&s<60&&c<60&&p<1e3&&u>-1&&u<12&&g<24&&y<60&&l>-1&&l<i(o,u+1)-i(o,u)){d=((i(o,u)+l)*24+f+g*v)*60;d=((d+s+y*v)*60+c)*1e3+p;if(h){d=a(d)}if(-864e13<=d&&d<=864e13){return d}}return NaN}return t.parse.apply(this,arguments)};I(e,{parse:u});return e}(Date)}if(!Date.now){Date.now=function Xt(){return(new Date).getTime()}}var nt=i.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var it={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function Yt(t,e){var r=-1;var n=e;while(++r<it.size){n+=t*it.data[r];it.data[r]=n%it.base;n=Math.floor(n/it.base)}},divide:function qt(t){var e=it.size,r=0;while(--e>=0){r+=it.data[e];it.data[e]=Math.floor(r/t);r=r%t*it.base}},numToString:function Kt(){var t=it.size;var e="";while(--t>=0){if(e!==""||t===0||it.data[t]!==0){var r=String(it.data[t]);if(e===""){e=r}else{e+="0000000".slice(0,7-r.length)+r}}}return e},pow:function Qt(t,e,r){return e===0?r:e%2===1?Qt(t,e-1,r*t):Qt(t*t,e/2,r)},log:function Vt(t){var e=0;var r=t;while(r>=4096){e+=12;r/=4096}while(r>=2){e+=1;r/=2}return e}};I(i,{toFixed:function Wt(t){var e,r,n,i,a,o,u,l;e=Number(t);e=e!==e?0:Math.floor(e);if(e<0||e>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}r=Number(this);if(r!==r){return"NaN"}if(r<=-1e21||r>=1e21){return String(r)}n="";if(r<0){n="-";r=-r}i="0";if(r>1e-21){a=it.log(r*it.pow(2,69,1))-69;o=a<0?r*it.pow(2,-a,1):r/it.pow(2,a,1);o*=4503599627370496;a=52-a;if(a>0){it.multiply(0,o);u=e;while(u>=7){it.multiply(1e7,0);u-=7}it.multiply(it.pow(10,u,1),0);u=a-1;while(u>=23){it.divide(1<<23);u-=23}it.divide(1<<u);it.multiply(1,1);it.divide(2);i=it.numToString()}else{it.multiply(0,o);it.multiply(1<<-a,0);i=it.numToString()+"0.00000000000000000000".slice(2,2+e)}}if(e>0){l=i.length;if(l<=e){i=n+"0.0000000000000000000".slice(0,e-l+2)+i}else{i=n+i.slice(0,l-e)+"."+i.slice(l-e)}}else{i=n+i}return i}},nt);var at=n.split;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";n.split=function(e,r){var n=this;if(typeof e==="undefined"&&r===0){return[]}if(!b(e)){return at.call(this,e,r)}var i=[];var a=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),o=0,l,f,s,c;var p=new RegExp(e.source,a+"g");n+="";if(!t){l=new RegExp("^"+p.source+"$(?!\\s)",a)}var h=typeof r==="undefined"?-1>>>0:M.ToUint32(r);f=p.exec(n);while(f){s=f.index+f[0].length;if(s>o){i.push(n.slice(o,f.index));if(!t&&f.length>1){f[0].replace(l,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){f[t]=void 0}}})}if(f.length>1&&f.index<n.length){u.apply(i,f.slice(1))}c=f[0].length;o=s;if(i.length>=h){break}}if(p.lastIndex===f.index){p.lastIndex++}f=p.exec(n)}if(o===n.length){if(c||!p.test("")){i.push("")}}else{i.push(n.slice(o))}return i.length>h?i.slice(0,h):i}})()}else if("0".split(void 0,0).length){n.split=function _t(t,e){if(typeof t==="undefined"&&e===0){return[]}return at.call(this,t,e)}}var ot=n.replace;var ut=function(){var t=[];"x".replace(/x(.)?/g,function(e,r){t.push(r)});return t.length===1&&typeof t[0]==="undefined"}();if(!ut){n.replace=function te(t,e){var r=v(e);var n=b(t)&&/\)[*?]/.test(t.source);if(!r||!n){return ot.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;a.push(arguments[n-2],arguments[n-1]);return e.apply(this,a)};return ot.call(this,t,i)}}}var lt=n.substr;var ft="".substr&&"0b".substr(-1)!=="b";I(n,{substr:function ee(t,e){var r=t;if(t<0){r=Math.max(this.length+t,0)}return lt.call(this,r,e)}},ft);var st=" \n\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var ct="\u200b";var pt="["+st+"]";var ht=new RegExp("^"+pt+pt+"*");var vt=new RegExp(pt+pt+"*$");var gt=n.trim&&(st.trim()||!ct.trim());I(n,{trim:function re(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(ht,"").replace(vt,"")}},gt);if(parseInt(st+"08")!==8||parseInt(st+"0x16")!==22){parseInt=function(t){var e=/^0[xX]/;return function r(n,i){var a=String(n).trim();var o=Number(i)||(e.test(a)?16:10);return t(a,o)}}(parseInt)}}); | ||
(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=Array;var t=e.prototype;var r=Object;var n=r.prototype;var a=Function.prototype;var i=String;var o=i.prototype;var l=Number;var u=l.prototype;var f=t.slice;var s=t.splice;var c=t.push;var v=t.unshift;var p=t.concat;var h=a.call;var g=Math.max;var y=Math.min;var d=n.toString;var w=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var m;var b=Function.prototype.toString,T=function ke(e){try{b.call(e);return true}catch(t){return false}},x="[object Function]",O="[object GeneratorFunction]";m=function Me(e){if(typeof e!=="function"){return false}if(w){return T(e)}var t=d.call(e);return t===x||t===O};var S;var j=RegExp.prototype.exec,E=function Fe(e){try{j.call(e);return true}catch(t){return false}},I="[object RegExp]";S=function Re(e){if(typeof e!=="object"){return false}return w?E(e):d.call(e)===I};var D;var N=String.prototype.valueOf,k=function Ae(e){try{N.call(e);return true}catch(t){return false}},M="[object String]";D=function Ue(e){if(typeof e==="string"){return true}if(typeof e!=="object"){return false}return w?k(e):d.call(e)===M};var F=function(e){var t=r.defineProperty&&function(){try{var e={};r.defineProperty(e,"x",{enumerable:false,value:e});for(var t in e){return false}return e.x===e}catch(n){return false}}();var n;if(t){n=function(e,t,n,a){if(!a&&t in e){return}r.defineProperty(e,t,{configurable:true,enumerable:false,writable:true,value:n})}}else{n=function(e,t,r,n){if(!n&&t in e){return}e[t]=r}}return function a(t,r,i){for(var o in r){if(e.call(r,o)){n(t,o,r[o],i)}}}}(n.hasOwnProperty);var R=function Ce(e){var t=typeof e;return e===null||t!=="object"&&t!=="function"};var A={ToInteger:function Pe(e){var t=+e;if(t!==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 Ze(e){var t,r,n;if(R(e)){return e}r=e.valueOf;if(m(r)){t=r.call(e);if(R(t)){return t}}n=e.toString;if(m(n)){t=n.call(e);if(R(t)){return t}}throw new TypeError},ToObject:function(e){if(e==null){throw new TypeError("can't convert "+e+" to object")}return r(e)},ToUint32:function Je(e){return e>>>0}};var U=function ze(){};F(a,{bind:function $e(e){var t=this;if(!m(t)){throw new TypeError("Function.prototype.bind called on incompatible "+t)}var n=f.call(arguments,1);var a;var i=function(){if(this instanceof a){var i=t.apply(this,p.call(n,f.call(arguments)));if(r(i)===i){return i}return this}else{return t.apply(e,p.call(n,f.call(arguments)))}};var o=g(0,t.length-n.length);var l=[];for(var u=0;u<o;u++){c.call(l,"$"+u)}a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this, arguments); }")(i);if(t.prototype){U.prototype=t.prototype;a.prototype=new U;U.prototype=null}return a}});var C=h.bind(n.hasOwnProperty);var P=h.bind(n.toString);var Z=h.bind(o.slice);var J=h.bind(o.split);var z=e.isArray||function Be(e){return P(e)==="[object Array]"};var $=[].unshift(0)!==1;F(t,{unshift:function(){v.apply(this,arguments);return this.length}},$);F(e,{isArray:z});var B=r("a");var G=B[0]!=="a"||!(0 in B);var H=function Ge(e){var t=true;var r=true;if(e){e.call("foo",function(e,r,n){if(typeof n!=="object"){t=false}});e.call([1],function(){"use strict";r=typeof this==="string"},"x")}return!!e&&t&&r};F(t,{forEach:function He(e){var t=A.ToObject(this);var r=G&&D(this)?J(this,""):t;var n=-1;var a=r.length>>>0;var i;if(arguments.length>1){i=arguments[1]}if(!m(e)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<a){if(n in r){if(typeof i!=="undefined"){e.call(i,r[n],n,t)}else{e(r[n],n,t)}}}}},!H(t.forEach));F(t,{map:function Le(t){var r=A.ToObject(this);var n=G&&D(this)?J(this,""):r;var a=n.length>>>0;var i=e(a);var o;if(arguments.length>1){o=arguments[1]}if(!m(t)){throw new TypeError("Array.prototype.map callback must be a function")}for(var l=0;l<a;l++){if(l in n){if(typeof o!=="undefined"){i[l]=t.call(o,n[l],l,r)}else{i[l]=t(n[l],l,r)}}}return i}},!H(t.map));F(t,{filter:function Xe(e){var t=A.ToObject(this);var r=G&&D(this)?J(this,""):t;var n=r.length>>>0;var a=[];var i;var o;if(arguments.length>1){o=arguments[1]}if(!m(e)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var l=0;l<n;l++){if(l in r){i=r[l];if(typeof o==="undefined"?e(i,l,t):e.call(o,i,l,t)){c.call(a,i)}}}return a}},!H(t.filter));F(t,{every:function Ye(e){var t=A.ToObject(this);var r=G&&D(this)?J(this,""):t;var n=r.length>>>0;var a;if(arguments.length>1){a=arguments[1]}if(!m(e)){throw new TypeError("Array.prototype.every callback must be a function")}for(var i=0;i<n;i++){if(i in r&&!(typeof a==="undefined"?e(r[i],i,t):e.call(a,r[i],i,t))){return false}}return true}},!H(t.every));F(t,{some:function qe(e){var t=A.ToObject(this);var r=G&&D(this)?J(this,""):t;var n=r.length>>>0;var a;if(arguments.length>1){a=arguments[1]}if(!m(e)){throw new TypeError("Array.prototype.some callback must be a function")}for(var i=0;i<n;i++){if(i in r&&(typeof a==="undefined"?e(r[i],i,t):e.call(a,r[i],i,t))){return true}}return false}},!H(t.some));var L=false;if(t.reduce){L=typeof t.reduce.call("es5",function(e,t,r,n){return n})==="object"}F(t,{reduce:function Ke(e){var t=A.ToObject(this);var r=G&&D(this)?J(this,""):t;var n=r.length>>>0;if(!m(e)){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 a=0;var i;if(arguments.length>=2){i=arguments[1]}else{do{if(a in r){i=r[a++];break}if(++a>=n){throw new TypeError("reduce of empty array with no initial value")}}while(true)}for(;a<n;a++){if(a in r){i=e(i,r[a],a,t)}}return i}},!L);var X=false;if(t.reduceRight){X=typeof t.reduceRight.call("es5",function(e,t,r,n){return n})==="object"}F(t,{reduceRight:function Qe(e){var t=A.ToObject(this);var r=G&&D(this)?J(this,""):t;var n=r.length>>>0;if(!m(e)){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 a;var i=n-1;if(arguments.length>=2){a=arguments[1]}else{do{if(i in r){a=r[i--];break}if(--i<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}if(i<0){return a}do{if(i in r){a=e(a,r[i],i,t)}}while(i--);return a}},!X);var Y=t.indexOf&&[0,1].indexOf(1,2)!==-1;F(t,{indexOf:function Ve(e){var t=G&&D(this)?J(this,""):A.ToObject(this);var r=t.length>>>0;if(r===0){return-1}var n=0;if(arguments.length>1){n=A.ToInteger(arguments[1])}n=n>=0?n:g(0,r+n);for(;n<r;n++){if(n in t&&t[n]===e){return n}}return-1}},Y);var q=t.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;F(t,{lastIndexOf:function We(e){var t=G&&D(this)?J(this,""):A.ToObject(this);var r=t.length>>>0;if(r===0){return-1}var n=r-1;if(arguments.length>1){n=y(n,A.ToInteger(arguments[1]))}n=n>=0?n:r-Math.abs(n);for(;n>=0;n--){if(n in t&&e===t[n]){return n}}return-1}},q);var K=function(){var e=[1,2];var t=e.splice();return e.length===2&&z(t)&&t.length===0}();F(t,{splice:function _e(e,t){if(arguments.length===0){return[]}else{return s.apply(this,arguments)}}},!K);var Q=function(){var e={};t.splice.call(e,0,0,1);return e.length===1}();F(t,{splice:function et(e,t){if(arguments.length===0){return[]}var r=arguments;this.length=g(A.ToInteger(this.length),0);if(arguments.length>0&&typeof t!=="number"){r=f.call(arguments);if(r.length<2){c.call(r,this.length-e)}else{r[1]=A.ToInteger(t)}}return s.apply(this,r)}},!Q);var V=function(){var t=new e(1e5);t[8]="x";t.splice(1,1);return t.indexOf("x")===7}();var W=function(){var e=256;var t=[];t[e]="a";t.splice(e+1,0,"b");return t[e]==="a"}();F(t,{splice:function tt(e,t){var r=A.ToObject(this);var n=[];var a=A.ToUint32(r.length);var o=A.ToInteger(e);var l=o<0?g(a+o,0):y(o,a);var u=y(g(A.ToInteger(t),0),a-l);var s=0;var c;while(s<u){c=i(l+s);if(C(r,c)){n[s]=r[c]}s+=1}var v=f.call(arguments,2);var p=v.length;var h;if(p<u){s=l;while(s<a-u){c=i(s+u);h=i(s+p);if(C(r,c)){r[h]=r[c]}else{delete r[h]}s+=1}s=a;while(s>a-u+p){delete r[s-1];s-=1}}else if(p>u){s=a-u;while(s>l){c=i(s+u-1);h=i(s+p-1);if(C(r,c)){r[h]=r[c]}else{delete r[h]}s-=1}}s=l;for(var d=0;d<v.length;++d){r[s]=v[d];s+=1}r.length=a-u+p;return n}},!V||!W);var _=!{toString:null}.propertyIsEnumerable("toString");var ee=function(){}.propertyIsEnumerable("prototype");var te=!C("x","0");var re=function(e){var t=e.constructor;return t&&t.prototype===e};var ne=["window","console","parent","self","frames"];var ae=function(){if(typeof window==="undefined"){return false}for(var e in window){if(ne.indexOf(e)===-1&&C(window,e)&&window[e]!==null&&typeof window[e]==="object"){try{re(window[e])}catch(t){return true}}}return false}();var ie=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var oe=ie.length;var le=function rt(e){var t=P(e);var r=t==="[object Arguments]";if(!r){r=!z(e)&&e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&m(e.callee)}return r};F(r,{keys:function nt(e){var t=m(e);var r=le(e);var n=e!==null&&typeof e==="object";var a=n&&D(e);if(!n&&!t&&!r){throw new TypeError("Object.keys called on a non-object")}var o=[];var l=ee&&t;if(a&&te||r){for(var u=0;u<e.length;++u){c.call(o,i(u))}}if(!r){for(var f in e){if(!(l&&f==="prototype")&&C(e,f)){c.call(o,i(f))}}}if(_){var s=ae||re(e);for(var v=0;v<oe;v++){var p=ie[v];if(!(s&&p==="constructor")&&C(e,p)){c.call(o,p)}}}return o}});var ue=r.keys&&function(){return r.keys(arguments).length===2}(1,2);var fe=r.keys;F(r,{keys:function at(e){if(le(e)){return fe(f.call(e))}else{return fe(e)}}},!ue);var se=-621987552e5;var ce="-000001";var ve=Date.prototype.toISOString&&new Date(se).toISOString().indexOf(ce)===-1;var pe=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z";F(Date.prototype,{toISOString:function it(){var e,t,r,n,a;if(!isFinite(this)){throw new RangeError("Date.prototype.toISOString called on non-finite value.")}n=this.getUTCFullYear();a=this.getUTCMonth();n+=Math.floor(a/12);a=(a%12+12)%12;e=[a+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()];n=(n<0?"-":n>9999?"+":"")+Z("00000"+Math.abs(n),0<=n&&n<=9999?-4:-6);t=e.length;while(t--){r=e[t];if(r<10){e[t]="0"+r}}return n+"-"+f.call(e,0,2).join("-")+"T"+f.call(e,2).join(":")+"."+Z("000"+this.getUTCMilliseconds(),-3)+"Z"}},ve||pe);var he=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(se).toJSON().indexOf(ce)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(e){return false}}();if(!he){Date.prototype.toJSON=function ot(e){var t=r(this);var n=A.ToPrimitive(t);if(typeof n==="number"&&!isFinite(n)){return null}var a=t.toISOString;if(!m(a)){throw new TypeError("toISOString property is not callable")}return a.call(t)}}var ge=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var ye=!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 de=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(!Date.parse||de||ye||!ge){Date=function(e){var t=function s(r,n,a,o,l,u,f){var s=arguments.length;var c;if(this instanceof e){c=s===1&&i(r)===r?new e(t.parse(r)):s>=7?new e(r,n,a,o,l,u,f):s>=6?new e(r,n,a,o,l,u):s>=5?new e(r,n,a,o,l):s>=4?new e(r,n,a,o):s>=3?new e(r,n,a):s>=2?new e(r,n):s>=1?new e(r):new e}else{c=e.apply(this,arguments)}F(c,{constructor:t},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 a=function c(e,t){var r=t>1?1:0;return n[t]+Math.floor((e-1969+r)/4)-Math.floor((e-1901+r)/100)+Math.floor((e-1601+r)/400)+365*(e-1970)};var o=function v(t){return l(new e(1970,0,1,0,0,0,t))};for(var u in e){if(C(e,u)){t[u]=e[u]}}F(t,{now:e.now,UTC:e.UTC},true);t.prototype=e.prototype;F(t.prototype,{constructor:t},true);var f=function p(t){var n=r.exec(t);if(n){var i=l(n[1]),u=l(n[2]||1)-1,f=l(n[3]||1)-1,s=l(n[4]||0),c=l(n[5]||0),v=l(n[6]||0),p=Math.floor(l(n[7]||0)*1e3),h=Boolean(n[4]&&!n[8]),g=n[9]==="-"?1:-1,y=l(n[10]||0),d=l(n[11]||0),w;if(s<(c>0||v>0||p>0?24:25)&&c<60&&v<60&&p<1e3&&u>-1&&u<12&&y<24&&d<60&&f>-1&&f<a(i,u+1)-a(i,u)){w=((a(i,u)+f)*24+s+y*g)*60;w=((w+c+d*g)*60+v)*1e3+p;if(h){w=o(w)}if(-864e13<=w&&w<=864e13){return w}}return NaN}return e.parse.apply(this,arguments)};F(t,{parse:f});return t}(Date)}if(!Date.now){Date.now=function lt(){return(new Date).getTime()}}var we=u.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var me={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function ut(e,t){var r=-1;var n=t;while(++r<me.size){n+=e*me.data[r];me.data[r]=n%me.base;n=Math.floor(n/me.base)}},divide:function ft(e){var t=me.size,r=0;while(--t>=0){r+=me.data[t];me.data[t]=Math.floor(r/e);r=r%e*me.base}},numToString:function st(){var e=me.size;var t="";while(--e>=0){if(t!==""||e===0||me.data[e]!==0){var r=i(me.data[e]);if(t===""){t=r}else{t+=Z("0000000",0,7-r.length)+r}}}return t},pow:function ct(e,t,r){return t===0?r:t%2===1?ct(e,t-1,r*e):ct(e*e,t/2,r)},log:function vt(e){var t=0;var r=e;while(r>=4096){t+=12;r/=4096}while(r>=2){t+=1;r/=2}return t}};F(u,{toFixed:function pt(e){var t,r,n,a,o,u,f,s;t=l(e);t=t!==t?0:Math.floor(t);if(t<0||t>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}r=l(this);if(r!==r){return"NaN"}if(r<=-1e21||r>=1e21){return i(r)}n="";if(r<0){n="-";r=-r}a="0";if(r>1e-21){o=me.log(r*me.pow(2,69,1))-69;u=o<0?r*me.pow(2,-o,1):r/me.pow(2,o,1);u*=4503599627370496;o=52-o;if(o>0){me.multiply(0,u);f=t;while(f>=7){me.multiply(1e7,0);f-=7}me.multiply(me.pow(10,f,1),0);f=o-1;while(f>=23){me.divide(1<<23);f-=23}me.divide(1<<f);me.multiply(1,1);me.divide(2);a=me.numToString()}else{me.multiply(0,u);me.multiply(1<<-o,0);a=me.numToString()+Z("0.00000000000000000000",2,2+t)}}if(t>0){s=a.length;if(s<=t){a=n+Z("0.0000000000000000000",0,t-s+2)+a}else{a=n+Z(a,0,s-t)+"."+Z(a,s-t)}}else{a=n+a}return a}},we);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 e=typeof/()??/.exec("")[1]==="undefined";o.split=function(t,r){var n=this;if(typeof t==="undefined"&&r===0){return[]}if(!S(t)){return J(this,t,r)}var a=[];var i=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.extended?"x":"")+(t.sticky?"y":""),o=0,l,u,s,v;var p=new RegExp(t.source,i+"g");n+="";if(!e){l=new RegExp("^"+p.source+"$(?!\\s)",i)}var h=typeof r==="undefined"?-1>>>0:A.ToUint32(r);u=p.exec(n);while(u){s=u.index+u[0].length;if(s>o){c.call(a,Z(n,o,u.index));if(!e&&u.length>1){u[0].replace(l,function(){for(var e=1;e<arguments.length-2;e++){if(typeof arguments[e]==="undefined"){u[e]=void 0}}})}if(u.length>1&&u.index<n.length){c.apply(a,f.call(u,1))}v=u[0].length;o=s;if(a.length>=h){break}}if(p.lastIndex===u.index){p.lastIndex++}u=p.exec(n)}if(o===n.length){if(v||!p.test("")){c.call(a,"")}}else{c.call(a,Z(n,o))}return a.length>h?Z(a,0,h):a}})()}else if("0".split(void 0,0).length){o.split=function ht(e,t){if(typeof e==="undefined"&&t===0){return[]}return J(this,e,t)}}var be=o.replace;var Te=function(){var e=[];"x".replace(/x(.)?/g,function(t,r){c.call(e,r)});return e.length===1&&typeof e[0]==="undefined"}();if(!Te){o.replace=function gt(e,t){var r=m(t);var n=S(e)&&/\)[*?]/.test(e.source);if(!r||!n){return be.call(this,e,t)}else{var a=function(r){var n=arguments.length;var a=e.lastIndex;e.lastIndex=0;var i=e.exec(r)||[];e.lastIndex=a;c.call(i,arguments[n-2],arguments[n-1]);return t.apply(this,i)};return be.call(this,e,a)}}}var xe=o.substr;var Oe="".substr&&"0b".substr(-1)!=="b";F(o,{substr:function yt(e,t){var r=e;if(e<0){r=g(this.length+e,0)}return xe.call(this,r,t)}},Oe);var Se=" \n\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var je="\u200b";var Ee="["+Se+"]";var Ie=new RegExp("^"+Ee+Ee+"*");var De=new RegExp(Ee+Ee+"*$");var Ne=o.trim&&(Se.trim()||!je.trim());F(o,{trim:function dt(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return i(this).replace(Ie,"").replace(De,"")}},Ne);if(parseInt(Se+"08")!==8||parseInt(Se+"0x16")!==22){parseInt=function(e){var t=/^0[xX]/;return function r(n,a){var o=i(n).trim();var u=l(a)||(t.test(o)?16:10);return e(o,u)}}(parseInt)}}); | ||
//# sourceMappingURL=es5-shim.map |
{ | ||
"name": "es5-shim", | ||
"version": "4.1.7", | ||
"version": "4.1.8", | ||
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
@@ -35,3 +35,3 @@ "homepage": "http://github.com/es-shims/es5-shim/", | ||
"devDependencies": { | ||
"eslint": "^0.23.0", | ||
"eslint": "^0.24.0", | ||
"jasmine-node": "^1.14.5", | ||
@@ -38,0 +38,0 @@ "jscs": "^1.13.1", |
@@ -1295,4 +1295,28 @@ /* global describe, it, expect, beforeEach, jasmine, xit */ | ||
}); | ||
it('should not break on sparse arrays in Opera', function () { | ||
// test from https://github.com/wikimedia/VisualEditor/blob/d468b00311e69c2095b9da360c5745153342a5c3/src/ve.utils.js#L182-L196 | ||
var n = 256; | ||
var arr = []; | ||
arr[n] = 'a'; | ||
arr.splice(n + 1, 0, 'b'); | ||
expect(arr[n]).toBe('a'); | ||
}); | ||
it('should not break on sparse arrays in Safari 7/8', function () { | ||
// test from https://github.com/wikimedia/VisualEditor/blob/d468b00311e69c2095b9da360c5745153342a5c3/src/ve.utils.js#L182-L196 | ||
var justFine = new Array(1e5 - 1); | ||
justFine[10] = 'x'; | ||
var tooBig = new Array(1e5); | ||
tooBig[8] = 'x'; | ||
justFine.splice(1, 1); | ||
expect(8 in justFine).toBe(false); | ||
expect(justFine.indexOf('x')).toBe(9); | ||
tooBig.splice(1, 1); | ||
expect(6 in tooBig).toBe(false); | ||
expect(tooBig.indexOf('x')).toBe(7); | ||
}); | ||
}); | ||
}); |
@@ -176,2 +176,21 @@ /* global describe, it, xit, expect, beforeEach */ | ||
describe('getUTCDate', function () { | ||
it('should return the right value for negative dates', function () { | ||
// Opera 10.6/11.61/Opera 12 bug | ||
expect(new Date(-3509827334573292).getUTCDate()).toBe(1); | ||
}); | ||
}); | ||
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); | ||
}); | ||
it('should return correct values', function () { | ||
expect(new Date(8.64e15).getUTCMonth()).toBe(8); | ||
expect(new Date(0).getUTCMonth()).toBe(0); | ||
}); | ||
}); | ||
describe('toISOString', function () { | ||
@@ -178,0 +197,0 @@ // TODO: write the rest of the test. |
@@ -128,34 +128,18 @@ /* global describe, it, expect, beforeEach */ | ||
}); | ||
it('returns the correct value if constructor returns primitive', function () { | ||
var oracle = [1, 2, 3]; | ||
var Subject = function () { | ||
var Subject = function (oracle) { | ||
expect(this).not.toBe(oracle); | ||
return oracle; | ||
}.bind(null); | ||
var result = new Subject(); | ||
expect(result).toBe(oracle); | ||
oracle = {}; | ||
result = new Subject(); | ||
expect(result).toBe(oracle); | ||
var primitives = ['asdf', null, true, 1]; | ||
for (var i = 0; i < primitives.length; ++i) { | ||
expect(new Subject(primitives[i])).not.toBe(primitives[i]); | ||
} | ||
oracle = function () {}; | ||
result = new Subject(); | ||
expect(result).toBe(oracle); | ||
oracle = 'asdf'; | ||
result = new Subject(); | ||
expect(result).not.toBe(oracle); | ||
oracle = null; | ||
result = new Subject(); | ||
expect(result).not.toBe(oracle); | ||
oracle = true; | ||
result = new Subject(); | ||
expect(result).not.toBe(oracle); | ||
oracle = 1; | ||
result = new Subject(); | ||
expect(result).not.toBe(oracle); | ||
var objects = [[1, 2, 3], {}, function () {}]; | ||
for (var j = 0; j < objects.length; ++j) { | ||
expect(new Subject(objects[j])).toBe(objects[j]); | ||
} | ||
}); | ||
@@ -162,0 +146,0 @@ it('returns the value that instance of original "class" when called as a constructor', function () { |
@@ -1,7 +0,9 @@ | ||
/* global describe, it, xit, expect, beforeEach, jasmine */ | ||
/* global describe, it, xit, expect, beforeEach, jasmine, window */ | ||
var ifWindowIt = typeof window === 'undefined' ? xit : it; | ||
describe('Object', function () { | ||
'use strict'; | ||
describe('Object.keys', function () { | ||
describe('.keys()', function () { | ||
var obj = { | ||
@@ -105,2 +107,20 @@ str: 'boz', | ||
}); | ||
ifWindowIt('can serialize all objects on the `window`', function () { | ||
var has = Object.prototype.hasOwnProperty; | ||
var keys, exception; | ||
var blacklistedKeys = ['window', 'console', 'parent', 'self', 'frames']; | ||
for (var k in window) { | ||
keys = exception = void 0; | ||
if (blacklistedKeys.indexOf(k) === -1 && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { | ||
try { | ||
keys = Object.keys(window[k]); | ||
} catch (e) { | ||
exception = e; | ||
} | ||
expect(Array.isArray(keys)).toEqual(true); | ||
expect(exception).toBeUndefined(); | ||
} | ||
} | ||
}); | ||
}); | ||
@@ -184,2 +204,8 @@ | ||
}); | ||
it('should not throw error for empty descriptor', function () { | ||
expect(function () { | ||
Object.defineProperty({}, 'name', {}); | ||
}).not.toThrow(); | ||
}); | ||
}); | ||
@@ -186,0 +212,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 not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374339
7209