Comparing version 3.4.0 to 4.0.0
{ | ||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], | ||
"additionalRules": [], | ||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], | ||
"disallowImplicitTypeConversion": ["binary", "string"], | ||
"disallowKeywords": ["with", "eval"], | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"disallowMultipleLineStrings": true, | ||
"disallowQuotedKeysInObjects": "allButReserved", | ||
"disallowSpaceAfterBinaryOperators": [], | ||
"disallowSpaceAfterKeywords": [], | ||
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, | ||
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, | ||
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, | ||
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], | ||
"disallowSpaceBeforeBinaryOperators": [], | ||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], | ||
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowQuotedKeysInObjects": "allButReserved", | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"disallowTrailingWhitespace": true, | ||
"excludeFiles": ["node_modules/**", "vendor/**"], | ||
"requireCommaBeforeLineBreak": true, | ||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], | ||
"requireSpaceAfterPrefixUnaryOperators": [], | ||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], | ||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], | ||
"requireSpaceBeforePostfixUnaryOperators": [], | ||
"requireKeywordsOnNewLine": [], | ||
"disallowSpaceBeforeBinaryOperators": [], | ||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], | ||
"requireLineFeedAtFileEnd": true, | ||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], | ||
"disallowSpaceAfterBinaryOperators": [], | ||
"disallowImplicitTypeConversion": ["binary", "string"], | ||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], | ||
"disallowKeywords": ["with", "eval"], | ||
"requireSpaceAfterPrefixUnaryOperators": [], | ||
"validateLineBreaks": "LF", | ||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], | ||
"requireKeywordsOnNewLine": [], | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"requireSpaceBeforePostfixUnaryOperators": [], | ||
"requireLineFeedAtFileEnd": true, | ||
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, | ||
"disallowTrailingWhitespace": true, | ||
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, | ||
"excludeFiles": ["node_modules/**", "vendor/**"], | ||
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, | ||
"disallowMultipleLineStrings": true, | ||
"additionalRules": [] | ||
"validateLineBreaks": "LF" | ||
} | ||
{ | ||
"name": "es5-shim", | ||
"version": "3.4.0", | ||
"version": "4.0.0", | ||
"main": "es5-shim.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -5,3 +5,3 @@ { | ||
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
"version": "v3.4.0", | ||
"version": "v4.0.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "shim", |
752
es5-shim.js
@@ -40,18 +40,21 @@ /*! | ||
// dereference that costs universally. | ||
var call = Function.prototype.call; | ||
var prototypeOfArray = Array.prototype; | ||
var prototypeOfObject = Object.prototype; | ||
var _Array_slice_ = prototypeOfArray.slice; | ||
var array_splice = Array.prototype.splice; | ||
var array_push = Array.prototype.push; | ||
var array_unshift = Array.prototype.unshift; | ||
var ArrayPrototype = Array.prototype; | ||
var ObjectPrototype = Object.prototype; | ||
var FunctionPrototype = Function.prototype; | ||
var StringPrototype = String.prototype; | ||
var NumberPrototype = Number.prototype; | ||
var _Array_slice_ = ArrayPrototype.slice; | ||
var array_splice = ArrayPrototype.splice; | ||
var array_push = ArrayPrototype.push; | ||
var array_unshift = ArrayPrototype.unshift; | ||
var call = FunctionPrototype.call; | ||
// Having a toString local variable name breaks in Opera so use _toString. | ||
var _toString = prototypeOfObject.toString; | ||
var _toString = ObjectPrototype.toString; | ||
var isFunction = function (val) { | ||
return prototypeOfObject.toString.call(val) === '[object Function]'; | ||
return ObjectPrototype.toString.call(val) === '[object Function]'; | ||
}; | ||
var isRegex = function (val) { | ||
return prototypeOfObject.toString.call(val) === '[object RegExp]'; | ||
return ObjectPrototype.toString.call(val) === '[object RegExp]'; | ||
}; | ||
@@ -61,2 +64,5 @@ var isArray = function isArray(obj) { | ||
}; | ||
var isString = function isString(obj) { | ||
return _toString.call(obj) === "[object String]"; | ||
}; | ||
var isArguments = function isArguments(value) { | ||
@@ -76,3 +82,104 @@ var str = _toString.call(value); | ||
var supportsDescriptors = Object.defineProperty && (function () { | ||
try { | ||
Object.defineProperty({}, 'x', {}); | ||
return true; | ||
} catch (e) { /* this is ES3 */ | ||
return false; | ||
} | ||
}()); | ||
// Define configurable, writable and non-enumerable props | ||
// if they don't exist. | ||
var defineProperty; | ||
if (supportsDescriptors) { | ||
defineProperty = function (object, name, method, forceAssign) { | ||
if (!forceAssign && (name in object)) { return; } | ||
Object.defineProperty(object, name, { | ||
configurable: true, | ||
enumerable: false, | ||
writable: true, | ||
value: method | ||
}); | ||
}; | ||
} else { | ||
defineProperty = function (object, name, method, forceAssign) { | ||
if (!forceAssign && (name in object)) { return; } | ||
object[name] = method; | ||
}; | ||
} | ||
var defineProperties = function (object, map, forceAssign) { | ||
for (var name in map) { | ||
if (ObjectPrototype.hasOwnProperty.call(map, name)) { | ||
defineProperty(object, name, map[name], forceAssign); | ||
} | ||
} | ||
}; | ||
// | ||
// Util | ||
// ====== | ||
// | ||
// ES5 9.4 | ||
// http://es5.github.com/#x9.4 | ||
// http://jsperf.com/to-integer | ||
function toInteger(n) { | ||
n = +n; | ||
if (n !== n) { // isNaN | ||
n = 0; | ||
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) { | ||
n = (n > 0 || -1) * Math.floor(Math.abs(n)); | ||
} | ||
return n; | ||
} | ||
function isPrimitive(input) { | ||
var type = typeof input; | ||
return ( | ||
input === null || | ||
type === "undefined" || | ||
type === "boolean" || | ||
type === "number" || | ||
type === "string" | ||
); | ||
} | ||
function toPrimitive(input) { | ||
var val, valueOf, toStr; | ||
if (isPrimitive(input)) { | ||
return input; | ||
} | ||
valueOf = input.valueOf; | ||
if (isFunction(valueOf)) { | ||
val = valueOf.call(input); | ||
if (isPrimitive(val)) { | ||
return val; | ||
} | ||
} | ||
toStr = input.toString; | ||
if (isFunction(toStr)) { | ||
val = toStr.call(input); | ||
if (isPrimitive(val)) { | ||
return val; | ||
} | ||
} | ||
throw new TypeError(); | ||
} | ||
// ES5 9.9 | ||
// http://es5.github.com/#x9.9 | ||
var toObject = function (o) { | ||
if (o == null) { // this matches both null and undefined | ||
throw new TypeError("can't convert " + o + " to object"); | ||
} | ||
return Object(o); | ||
}; | ||
var ToUint32 = function ToUint32(x) { | ||
return x >>> 0; | ||
}; | ||
// | ||
// Function | ||
@@ -87,4 +194,4 @@ // ======== | ||
if (!Function.prototype.bind) { | ||
Function.prototype.bind = function bind(that) { // .length is 1 | ||
defineProperties(FunctionPrototype, { | ||
bind: function bind(that) { // .length is 1 | ||
// 1. Let Target be the this value. | ||
@@ -218,8 +325,8 @@ var target = this; | ||
return bound; | ||
}; | ||
} | ||
} | ||
}); | ||
// _Please note: Shortcuts are defined after `Function.prototype.bind` as we | ||
// us it in defining shortcuts. | ||
var owns = call.bind(prototypeOfObject.hasOwnProperty); | ||
var owns = call.bind(ObjectPrototype.hasOwnProperty); | ||
@@ -232,7 +339,7 @@ // If JS engine supports accessors creating shortcuts. | ||
var supportsAccessors; | ||
if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { | ||
defineGetter = call.bind(prototypeOfObject.__defineGetter__); | ||
defineSetter = call.bind(prototypeOfObject.__defineSetter__); | ||
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); | ||
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); | ||
if ((supportsAccessors = owns(ObjectPrototype, "__defineGetter__"))) { | ||
defineGetter = call.bind(ObjectPrototype.__defineGetter__); | ||
defineSetter = call.bind(ObjectPrototype.__defineSetter__); | ||
lookupGetter = call.bind(ObjectPrototype.__lookupGetter__); | ||
lookupSetter = call.bind(ObjectPrototype.__lookupSetter__); | ||
} | ||
@@ -247,8 +354,2 @@ | ||
// http://es5.github.com/#x15.4.4.12 | ||
var spliceWorksWithEmptyObject = (function () { | ||
var obj = {}; | ||
Array.prototype.splice.call(obj, 0, 0, 1); | ||
return obj.length === 1; | ||
}()); | ||
var omittingSecondSpliceArgIsNoop = [1].splice(0).length === 0; | ||
var spliceNoopReturnsEmptyArray = (function () { | ||
@@ -259,12 +360,21 @@ var a = [1, 2]; | ||
}()); | ||
if (spliceNoopReturnsEmptyArray) { | ||
// Safari 5.0 bug where .split() returns undefined | ||
Array.prototype.splice = function splice(start, deleteCount) { | ||
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 []; } | ||
else { return array_splice.apply(this, arguments); } | ||
}; | ||
} | ||
if (!omittingSecondSpliceArgIsNoop || !spliceWorksWithEmptyObject) { | ||
Array.prototype.splice = function splice(start, deleteCount) { | ||
if (arguments.length === 0) { return []; } | ||
var args = arguments; | ||
@@ -274,8 +384,11 @@ this.length = Math.max(toInteger(this.length), 0); | ||
args = _Array_slice_.call(arguments); | ||
if (args.length < 2) { args.push(toInteger(deleteCount)); } | ||
else { args[1] = toInteger(deleteCount); } | ||
if (args.length < 2) { | ||
args.push(this.length - start); | ||
} else { | ||
args[1] = toInteger(deleteCount); | ||
} | ||
} | ||
return array_splice.apply(this, args); | ||
}; | ||
} | ||
} | ||
}, !spliceWorksWithEmptyObject); | ||
@@ -287,8 +400,9 @@ // ES5 15.4.4.12 | ||
// IE < 8 bug: [].unshift(0) === undefined but should be "1" | ||
if ([].unshift(0) !== 1) { | ||
Array.prototype.unshift = function () { | ||
var hasUnshiftReturnValueBug = [].unshift(0) !== 1; | ||
defineProperties(ArrayPrototype, { | ||
unshift: function () { | ||
array_unshift.apply(this, arguments); | ||
return this.length; | ||
}; | ||
} | ||
} | ||
}, hasUnshiftReturnValueBug); | ||
@@ -298,5 +412,3 @@ // ES5 15.4.3.2 | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray | ||
if (!Array.isArray) { | ||
Array.isArray = isArray; | ||
} | ||
defineProperties(Array, { isArray: isArray }); | ||
@@ -341,8 +453,6 @@ // The IsCallable() check in the Array functions | ||
if (!Array.prototype.forEach || !properlyBoxesContext(Array.prototype.forEach)) { | ||
Array.prototype.forEach = function forEach(fun /*, thisp*/) { | ||
defineProperties(ArrayPrototype, { | ||
forEach: function forEach(fun /*, thisp*/) { | ||
var object = toObject(this), | ||
self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
object, | ||
self = splitString && isString(this) ? this.split('') : object, | ||
thisp = arguments[1], | ||
@@ -365,4 +475,4 @@ i = -1, | ||
} | ||
}; | ||
} | ||
} | ||
}, !properlyBoxesContext(ArrayPrototype.forEach)); | ||
@@ -372,8 +482,6 @@ // ES5 15.4.4.19 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map | ||
if (!Array.prototype.map || !properlyBoxesContext(Array.prototype.map)) { | ||
Array.prototype.map = function map(fun /*, thisp*/) { | ||
defineProperties(ArrayPrototype, { | ||
map: function map(fun /*, thisp*/) { | ||
var object = toObject(this), | ||
self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
object, | ||
self = splitString && isString(this) ? this.split('') : object, | ||
length = self.length >>> 0, | ||
@@ -394,4 +502,4 @@ result = Array(length), | ||
return result; | ||
}; | ||
} | ||
} | ||
}, !properlyBoxesContext(ArrayPrototype.map)); | ||
@@ -401,8 +509,6 @@ // ES5 15.4.4.20 | ||
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter | ||
if (!Array.prototype.filter || !properlyBoxesContext(Array.prototype.filter)) { | ||
Array.prototype.filter = function filter(fun /*, thisp */) { | ||
defineProperties(ArrayPrototype, { | ||
filter: function filter(fun /*, thisp */) { | ||
var object = toObject(this), | ||
self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
object, | ||
self = splitString && isString(this) ? this.split('') : object, | ||
length = self.length >>> 0, | ||
@@ -427,4 +533,4 @@ result = [], | ||
return result; | ||
}; | ||
} | ||
} | ||
}, !properlyBoxesContext(ArrayPrototype.filter)); | ||
@@ -434,8 +540,6 @@ // ES5 15.4.4.16 | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every | ||
if (!Array.prototype.every || !properlyBoxesContext(Array.prototype.every)) { | ||
Array.prototype.every = function every(fun /*, thisp */) { | ||
defineProperties(ArrayPrototype, { | ||
every: function every(fun /*, thisp */) { | ||
var object = toObject(this), | ||
self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
object, | ||
self = splitString && isString(this) ? this.split('') : object, | ||
length = self.length >>> 0, | ||
@@ -455,4 +559,4 @@ thisp = arguments[1]; | ||
return true; | ||
}; | ||
} | ||
} | ||
}, !properlyBoxesContext(ArrayPrototype.every)); | ||
@@ -462,8 +566,6 @@ // ES5 15.4.4.17 | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some | ||
if (!Array.prototype.some || !properlyBoxesContext(Array.prototype.some)) { | ||
Array.prototype.some = function some(fun /*, thisp */) { | ||
defineProperties(ArrayPrototype, { | ||
some: function some(fun /*, thisp */) { | ||
var object = toObject(this), | ||
self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
object, | ||
self = splitString && isString(this) ? this.split('') : object, | ||
length = self.length >>> 0, | ||
@@ -483,4 +585,4 @@ thisp = arguments[1]; | ||
return false; | ||
}; | ||
} | ||
} | ||
}, !properlyBoxesContext(ArrayPrototype.some)); | ||
@@ -491,11 +593,9 @@ // ES5 15.4.4.21 | ||
var reduceCoercesToObject = false; | ||
if (Array.prototype.reduce) { | ||
reduceCoercesToObject = typeof Array.prototype.reduce.call('es5', function (_, __, ___, list) { return list; }) === 'object'; | ||
if (ArrayPrototype.reduce) { | ||
reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) { return list; }) === 'object'; | ||
} | ||
if (!Array.prototype.reduce || !reduceCoercesToObject) { | ||
Array.prototype.reduce = function reduce(fun /*, initial*/) { | ||
defineProperties(ArrayPrototype, { | ||
reduce: function reduce(fun /*, initial*/) { | ||
var object = toObject(this), | ||
self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
object, | ||
self = splitString && isString(this) ? this.split('') : object, | ||
length = self.length >>> 0; | ||
@@ -538,4 +638,4 @@ | ||
return result; | ||
}; | ||
} | ||
} | ||
}, !reduceCoercesToObject); | ||
@@ -546,11 +646,9 @@ // ES5 15.4.4.22 | ||
var reduceRightCoercesToObject = false; | ||
if (Array.prototype.reduceRight) { | ||
reduceRightCoercesToObject = typeof Array.prototype.reduceRight.call('es5', function (_, __, ___, list) { return list; }) === 'object'; | ||
if (ArrayPrototype.reduceRight) { | ||
reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) { return list; }) === 'object'; | ||
} | ||
if (!Array.prototype.reduceRight || !reduceRightCoercesToObject) { | ||
Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { | ||
defineProperties(ArrayPrototype, { | ||
reduceRight: function reduceRight(fun /*, initial*/) { | ||
var object = toObject(this), | ||
self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
object, | ||
self = splitString && isString(this) ? this.split('') : object, | ||
length = self.length >>> 0; | ||
@@ -596,4 +694,4 @@ | ||
return result; | ||
}; | ||
} | ||
} | ||
}, !reduceRightCoercesToObject); | ||
@@ -603,7 +701,6 @@ // ES5 15.4.4.14 | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf | ||
if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) !== -1)) { | ||
Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { | ||
var self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
toObject(this), | ||
var hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1; | ||
defineProperties(ArrayPrototype, { | ||
indexOf: function indexOf(sought /*, fromIndex */ ) { | ||
var self = splitString && isString(this) ? this.split('') : toObject(this), | ||
length = self.length >>> 0; | ||
@@ -628,4 +725,4 @@ | ||
return -1; | ||
}; | ||
} | ||
} | ||
}, hasFirefox2IndexOfBug); | ||
@@ -635,7 +732,6 @@ // ES5 15.4.4.15 | ||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf | ||
if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) !== -1)) { | ||
Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { | ||
var self = splitString && _toString.call(this) === "[object String]" ? | ||
this.split("") : | ||
toObject(this), | ||
var hasFirefox2LastIndexOfBug = Array.prototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1; | ||
defineProperties(ArrayPrototype, { | ||
lastIndexOf: function lastIndexOf(sought /*, fromIndex */) { | ||
var self = splitString && isString(this) ? this.split('') : toObject(this), | ||
length = self.length >>> 0; | ||
@@ -658,4 +754,4 @@ | ||
return -1; | ||
}; | ||
} | ||
} | ||
}, hasFirefox2LastIndexOfBug); | ||
@@ -669,25 +765,23 @@ // | ||
// http://es5.github.com/#x15.2.3.14 | ||
var keysWorksWithArguments = Object.keys && (function () { | ||
return Object.keys(arguments).length === 2; | ||
}(1, 2)); | ||
if (!Object.keys) { | ||
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation | ||
var hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'), | ||
hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'), | ||
dontEnums = [ | ||
"toString", | ||
"toLocaleString", | ||
"valueOf", | ||
"hasOwnProperty", | ||
"isPrototypeOf", | ||
"propertyIsEnumerable", | ||
"constructor" | ||
], | ||
dontEnumsLength = dontEnums.length; | ||
Object.keys = function keys(object) { | ||
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation | ||
var hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'), | ||
hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'), | ||
dontEnums = [ | ||
"toString", | ||
"toLocaleString", | ||
"valueOf", | ||
"hasOwnProperty", | ||
"isPrototypeOf", | ||
"propertyIsEnumerable", | ||
"constructor" | ||
], | ||
dontEnumsLength = dontEnums.length; | ||
defineProperties(Object, { | ||
keys: function keys(object) { | ||
var isFn = isFunction(object), | ||
isArgs = isArguments(object), | ||
isObject = object !== null && typeof object === 'object', | ||
isString = isObject && _toString.call(object) === '[object String]'; | ||
isStr = isObject && isString(object); | ||
@@ -700,3 +794,3 @@ if (!isObject && !isFn && !isArgs) { | ||
var skipProto = hasProtoEnumBug && isFn; | ||
if (isString || isArgs) { | ||
if (isStr || isArgs) { | ||
for (var i = 0; i < object.length; ++i) { | ||
@@ -724,14 +818,19 @@ theKeys.push(String(i)); | ||
return theKeys; | ||
}; | ||
} else if (!keysWorksWithArguments) { | ||
} | ||
}); | ||
var keysWorksWithArguments = Object.keys && (function () { | ||
// Safari 5.0 bug | ||
var originalKeys = Object.keys; | ||
Object.keys = function keys(object) { | ||
return Object.keys(arguments).length === 2; | ||
}(1, 2)); | ||
var originalKeys = Object.keys; | ||
defineProperties(Object, { | ||
keys: function keys(object) { | ||
if (isArguments(object)) { | ||
return originalKeys(Array.prototype.slice.call(object)); | ||
return originalKeys(ArrayPrototype.slice.call(object)); | ||
} else { | ||
return originalKeys(object); | ||
} | ||
}; | ||
} | ||
} | ||
}, !keysWorksWithArguments); | ||
@@ -750,9 +849,8 @@ // | ||
// this object is not a finite Number a RangeError exception is thrown. | ||
var negativeDate = -62198755200000, | ||
negativeYearString = "-000001"; | ||
if ( | ||
!Date.prototype.toISOString || | ||
(new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1) | ||
) { | ||
Date.prototype.toISOString = function toISOString() { | ||
var negativeDate = -62198755200000; | ||
var negativeYearString = "-000001"; | ||
var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1; | ||
defineProperties(Date.prototype, { | ||
toISOString: function toISOString() { | ||
var result, length, value, year, month; | ||
@@ -792,4 +890,4 @@ if (!isFinite(this)) { | ||
); | ||
}; | ||
} | ||
} | ||
}, hasNegativeDateBug); | ||
@@ -1018,148 +1116,147 @@ | ||
// http://es5.github.com/#x15.7.4.5 | ||
if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== '0.000' || (0.9).toFixed(0) === '0' || (1.255).toFixed(2) !== '1.25' || (1000000000000000128).toFixed(0) !== "1000000000000000128") { | ||
// Hide these variables and functions | ||
(function () { | ||
var base, size, data, i; | ||
var hasToFixedBugs = NumberPrototype.toFixed && ( | ||
(0.00008).toFixed(3) !== '0.000' | ||
|| (0.9).toFixed(0) !== '1' | ||
|| (1.255).toFixed(2) !== '1.25' | ||
|| (1000000000000000128).toFixed(0) !== "1000000000000000128" | ||
); | ||
base = 1e7; | ||
size = 6; | ||
data = [0, 0, 0, 0, 0, 0]; | ||
var toFixedHelpers = { | ||
base: 1e7, | ||
size: 6, | ||
data: [0, 0, 0, 0, 0, 0], | ||
multiply: function multiply(n, c) { | ||
var i = -1; | ||
while (++i < toFixedHelpers.size) { | ||
c += n * toFixedHelpers.data[i]; | ||
toFixedHelpers.data[i] = c % toFixedHelpers.base; | ||
c = Math.floor(c / toFixedHelpers.base); | ||
} | ||
}, | ||
divide: function divide(n) { | ||
var i = toFixedHelpers.size, c = 0; | ||
while (--i >= 0) { | ||
c += toFixedHelpers.data[i]; | ||
toFixedHelpers.data[i] = Math.floor(c / n); | ||
c = (c % n) * toFixedHelpers.base; | ||
} | ||
}, | ||
numToString: function numToString() { | ||
var i = toFixedHelpers.size; | ||
var s = ''; | ||
while (--i >= 0) { | ||
if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) { | ||
var t = String(toFixedHelpers.data[i]); | ||
if (s === '') { | ||
s = t; | ||
} else { | ||
s += '0000000'.slice(0, 7 - t.length) + t; | ||
} | ||
} | ||
} | ||
return s; | ||
}, | ||
pow: function pow(x, n, acc) { | ||
return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc))); | ||
}, | ||
log: function log(x) { | ||
var n = 0; | ||
while (x >= 4096) { | ||
n += 12; | ||
x /= 4096; | ||
} | ||
while (x >= 2) { | ||
n += 1; | ||
x /= 2; | ||
} | ||
return n; | ||
} | ||
}; | ||
function multiply(n, c) { | ||
var i = -1; | ||
while (++i < size) { | ||
c += n * data[i]; | ||
data[i] = c % base; | ||
c = Math.floor(c / base); | ||
} | ||
} | ||
defineProperties(NumberPrototype, { | ||
toFixed: function toFixed(fractionDigits) { | ||
var f, x, s, m, e, z, j, k; | ||
function divide(n) { | ||
var i = size, c = 0; | ||
while (--i >= 0) { | ||
c += data[i]; | ||
data[i] = Math.floor(c / n); | ||
c = (c % n) * base; | ||
} | ||
} | ||
// Test for NaN and round fractionDigits down | ||
f = Number(fractionDigits); | ||
f = f !== f ? 0 : Math.floor(f); | ||
function numToString() { | ||
var i = size; | ||
var s = ''; | ||
while (--i >= 0) { | ||
if (s !== '' || i === 0 || data[i] !== 0) { | ||
var t = String(data[i]); | ||
if (s === '') { | ||
s = t; | ||
} else { | ||
s += '0000000'.slice(0, 7 - t.length) + t; | ||
} | ||
} | ||
} | ||
return s; | ||
if (f < 0 || f > 20) { | ||
throw new RangeError("Number.toFixed called with invalid number of decimals"); | ||
} | ||
function pow(x, n, acc) { | ||
return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc))); | ||
x = Number(this); | ||
// Test for NaN | ||
if (x !== x) { | ||
return "NaN"; | ||
} | ||
function log(x) { | ||
var n = 0; | ||
while (x >= 4096) { | ||
n += 12; | ||
x /= 4096; | ||
} | ||
while (x >= 2) { | ||
n += 1; | ||
x /= 2; | ||
} | ||
return n; | ||
// If it is too big or small, return the string value of the number | ||
if (x <= -1e21 || x >= 1e21) { | ||
return String(x); | ||
} | ||
Number.prototype.toFixed = function toFixed(fractionDigits) { | ||
var f, x, s, m, e, z, j, k; | ||
s = ""; | ||
// Test for NaN and round fractionDigits down | ||
f = Number(fractionDigits); | ||
f = f !== f ? 0 : Math.floor(f); | ||
if (x < 0) { | ||
s = "-"; | ||
x = -x; | ||
} | ||
if (f < 0 || f > 20) { | ||
throw new RangeError("Number.toFixed called with invalid number of decimals"); | ||
} | ||
m = "0"; | ||
x = Number(this); | ||
if (x > 1e-21) { | ||
// 1e-21 < x < 1e21 | ||
// -70 < log2(x) < 70 | ||
e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69; | ||
z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1)); | ||
z *= 0x10000000000000; // Math.pow(2, 52); | ||
e = 52 - e; | ||
// Test for NaN | ||
if (x !== x) { | ||
return "NaN"; | ||
} | ||
// -18 < e < 122 | ||
// x = z / 2 ^ e | ||
if (e > 0) { | ||
toFixedHelpers.multiply(0, z); | ||
j = f; | ||
// If it is too big or small, return the string value of the number | ||
if (x <= -1e21 || x >= 1e21) { | ||
return String(x); | ||
} | ||
while (j >= 7) { | ||
toFixedHelpers.multiply(1e7, 0); | ||
j -= 7; | ||
} | ||
s = ""; | ||
toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0); | ||
j = e - 1; | ||
if (x < 0) { | ||
s = "-"; | ||
x = -x; | ||
} | ||
while (j >= 23) { | ||
toFixedHelpers.divide(1 << 23); | ||
j -= 23; | ||
} | ||
m = "0"; | ||
if (x > 1e-21) { | ||
// 1e-21 < x < 1e21 | ||
// -70 < log2(x) < 70 | ||
e = log(x * pow(2, 69, 1)) - 69; | ||
z = (e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1)); | ||
z *= 0x10000000000000; // Math.pow(2, 52); | ||
e = 52 - e; | ||
// -18 < e < 122 | ||
// x = z / 2 ^ e | ||
if (e > 0) { | ||
multiply(0, z); | ||
j = f; | ||
while (j >= 7) { | ||
multiply(1e7, 0); | ||
j -= 7; | ||
} | ||
multiply(pow(10, j, 1), 0); | ||
j = e - 1; | ||
while (j >= 23) { | ||
divide(1 << 23); | ||
j -= 23; | ||
} | ||
divide(1 << j); | ||
multiply(1, 1); | ||
divide(2); | ||
m = numToString(); | ||
} else { | ||
multiply(0, z); | ||
multiply(1 << (-e), 0); | ||
m = numToString() + '0.00000000000000000000'.slice(2, 2 + f); | ||
} | ||
toFixedHelpers.divide(1 << j); | ||
toFixedHelpers.multiply(1, 1); | ||
toFixedHelpers.divide(2); | ||
m = toFixedHelpers.numToString(); | ||
} else { | ||
toFixedHelpers.multiply(0, z); | ||
toFixedHelpers.multiply(1 << (-e), 0); | ||
m = toFixedHelpers.numToString() + '0.00000000000000000000'.slice(2, 2 + f); | ||
} | ||
} | ||
if (f > 0) { | ||
k = m.length; | ||
if (f > 0) { | ||
k = m.length; | ||
if (k <= f) { | ||
m = s + '0.0000000000000000000'.slice(0, f - k + 2) + m; | ||
} else { | ||
m = s + m.slice(0, k - f) + '.' + m.slice(k - f); | ||
} | ||
if (k <= f) { | ||
m = s + '0.0000000000000000000'.slice(0, f - k + 2) + m; | ||
} else { | ||
m = s + m; | ||
m = s + m.slice(0, k - f) + '.' + m.slice(k - f); | ||
} | ||
} else { | ||
m = s + m; | ||
} | ||
return m; | ||
}; | ||
}()); | ||
} | ||
return m; | ||
} | ||
}, hasToFixedBugs); | ||
@@ -1187,3 +1284,3 @@ | ||
var string_split = String.prototype.split; | ||
var string_split = StringPrototype.split; | ||
if ( | ||
@@ -1200,3 +1297,3 @@ 'ab'.split(/(?:ab)*/).length !== 2 || | ||
String.prototype.split = function (separator, limit) { | ||
StringPrototype.split = function (separator, limit) { | ||
var string = this; | ||
@@ -1253,3 +1350,3 @@ if (separator === void 0 && limit === 0) { | ||
if (match.length > 1 && match.index < string.length) { | ||
Array.prototype.push.apply(output, match.slice(1)); | ||
ArrayPrototype.push.apply(output, match.slice(1)); | ||
} | ||
@@ -1284,3 +1381,3 @@ lastLength = match[0].length; | ||
} else if ("0".split(void 0, 0).length) { | ||
String.prototype.split = function split(separator, limit) { | ||
StringPrototype.split = function split(separator, limit) { | ||
if (separator === void 0 && limit === 0) { return []; } | ||
@@ -1291,3 +1388,3 @@ return string_split.call(this, separator, limit); | ||
var str_replace = String.prototype.replace; | ||
var str_replace = StringPrototype.replace; | ||
var replaceReportsGroupsCorrectly = (function () { | ||
@@ -1302,3 +1399,3 @@ var groups = []; | ||
if (!replaceReportsGroupsCorrectly) { | ||
String.prototype.replace = function replace(searchValue, replaceValue) { | ||
StringPrototype.replace = function replace(searchValue, replaceValue) { | ||
var isFn = isFunction(replaceValue); | ||
@@ -1328,11 +1425,6 @@ var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source); | ||
// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE | ||
if ("".substr && "0b".substr(-1) !== "b") { | ||
var string_substr = String.prototype.substr; | ||
/** | ||
* Get the substring of a string | ||
* @param {integer} start where to start the substring | ||
* @param {integer} length how many characters to return | ||
* @return {string} | ||
*/ | ||
String.prototype.substr = function substr(start, length) { | ||
var string_substr = StringPrototype.substr; | ||
var hasNegativeSubstrBug = "".substr && "0b".substr(-1) !== "b"; | ||
defineProperties(StringPrototype, { | ||
substr: function substr(start, length) { | ||
return string_substr.call( | ||
@@ -1343,4 +1435,4 @@ this, | ||
); | ||
}; | ||
} | ||
} | ||
}, hasNegativeSubstrBug); | ||
@@ -1353,17 +1445,16 @@ // ES5 15.5.4.20 | ||
var zeroWidth = '\u200b'; | ||
if (!String.prototype.trim || ws.trim() || !zeroWidth.trim()) { | ||
var wsRegexChars = "[" + ws + "]"; | ||
var trimBeginRegexp = new RegExp("^" + wsRegexChars + wsRegexChars + "*"); | ||
var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + "*$"); | ||
var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim()); | ||
defineProperties(StringPrototype, { | ||
// http://blog.stevenlevithan.com/archives/faster-trim-javascript | ||
// http://perfectionkills.com/whitespace-deviations/ | ||
ws = "[" + ws + "]"; | ||
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), | ||
trimEndRegexp = new RegExp(ws + ws + "*$"); | ||
String.prototype.trim = function trim() { | ||
trim: function trim() { | ||
if (this === void 0 || this === null) { | ||
throw new TypeError("can't convert " + this + " to object"); | ||
} | ||
return String(this) | ||
.replace(trimBeginRegexp, "") | ||
.replace(trimEndRegexp, ""); | ||
}; | ||
} | ||
return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); | ||
} | ||
}, hasTrimWhitespaceBug); | ||
@@ -1384,67 +1475,2 @@ // ES-5 15.1.2.2 | ||
// | ||
// Util | ||
// ====== | ||
// | ||
// ES5 9.4 | ||
// http://es5.github.com/#x9.4 | ||
// http://jsperf.com/to-integer | ||
function toInteger(n) { | ||
n = +n; | ||
if (n !== n) { // isNaN | ||
n = 0; | ||
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) { | ||
n = (n > 0 || -1) * Math.floor(Math.abs(n)); | ||
} | ||
return n; | ||
} | ||
function isPrimitive(input) { | ||
var type = typeof input; | ||
return ( | ||
input === null || | ||
type === "undefined" || | ||
type === "boolean" || | ||
type === "number" || | ||
type === "string" | ||
); | ||
} | ||
function toPrimitive(input) { | ||
var val, valueOf, toStr; | ||
if (isPrimitive(input)) { | ||
return input; | ||
} | ||
valueOf = input.valueOf; | ||
if (isFunction(valueOf)) { | ||
val = valueOf.call(input); | ||
if (isPrimitive(val)) { | ||
return val; | ||
} | ||
} | ||
toStr = input.toString; | ||
if (isFunction(toStr)) { | ||
val = toStr.call(input); | ||
if (isPrimitive(val)) { | ||
return val; | ||
} | ||
} | ||
throw new TypeError(); | ||
} | ||
// ES5 9.9 | ||
// http://es5.github.com/#x9.9 | ||
var toObject = function (o) { | ||
if (o == null) { // this matches both null and undefined | ||
throw new TypeError("can't convert " + o + " to object"); | ||
} | ||
return Object(o); | ||
}; | ||
var ToUint32 = function ToUint32(x) { | ||
return x >>> 0; | ||
}; | ||
})); |
@@ -6,3 +6,3 @@ /*! | ||
*/ | ||
(function(t,r){if(typeof define==="function"&&define.amd){define(r)}else if(typeof exports==="object"){module.exports=r()}else{t.returnExports=r()}})(this,function(){var t=Function.prototype.call;var r=Array.prototype;var e=Object.prototype;var n=r.slice;var i=Array.prototype.splice;var o=Array.prototype.push;var a=Array.prototype.unshift;var l=e.toString;var u=function(t){return e.toString.call(t)==="[object Function]"};var p=function(t){return e.toString.call(t)==="[object RegExp]"};var s=function W(t){return l.call(t)==="[object Array]"};var f=function tr(t){var r=l.call(t);var e=r==="[object Arguments]";if(!e){e=!s(r)&&t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&u(t.callee)}return e};function c(){}if(!Function.prototype.bind){Function.prototype.bind=function rr(t){var r=this;if(!u(r)){throw new TypeError("Function.prototype.bind called on incompatible "+r)}var e=n.call(arguments,1);var i=function(){if(this instanceof p){var i=r.apply(this,e.concat(n.call(arguments)));if(Object(i)===i){return i}return this}else{return r.apply(t,e.concat(n.call(arguments)))}};var o=Math.max(0,r.length-e.length);var a=[];for(var l=0;l<o;l++){a.push("$"+l)}var p=Function("binder","return function ("+a.join(",")+"){return binder.apply(this,arguments)}")(i);if(r.prototype){c.prototype=r.prototype;p.prototype=new c;c.prototype=null}return p}}var h=t.bind(e.hasOwnProperty);var y;var g;var v;var d;var b;if(b=h(e,"__defineGetter__")){y=t.bind(e.__defineGetter__);g=t.bind(e.__defineSetter__);v=t.bind(e.__lookupGetter__);d=t.bind(e.__lookupSetter__)}var m=function(){var t={};Array.prototype.splice.call(t,0,0,1);return t.length===1}();var w=[1].splice(0).length===0;var S=function(){var t=[1,2];var r=t.splice();return t.length===2&&s(r)&&r.length===0}();if(S){Array.prototype.splice=function er(t,r){if(arguments.length===0){return[]}else{return i.apply(this,arguments)}}}if(!w||!m){Array.prototype.splice=function nr(t,r){if(arguments.length===0){return[]}var e=arguments;this.length=Math.max(q(this.length),0);if(arguments.length>0&&typeof r!=="number"){e=n.call(arguments);if(e.length<2){e.push(q(r))}else{e[1]=q(r)}}return i.apply(this,e)}}if([].unshift(0)!==1){Array.prototype.unshift=function(){a.apply(this,arguments);return this.length}}if(!Array.isArray){Array.isArray=s}var x=Object("a");var A=x[0]!=="a"||!(0 in x);var j=function ir(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};if(!Array.prototype.forEach||!j(Array.prototype.forEach)){Array.prototype.forEach=function or(t){var r=Q(this),e=A&&l.call(this)==="[object String]"?this.split(""):r,n=arguments[1],i=-1,o=e.length>>>0;if(!u(t)){throw new TypeError}while(++i<o){if(i in e){t.call(n,e[i],i,r)}}}}if(!Array.prototype.map||!j(Array.prototype.map)){Array.prototype.map=function ar(t){var r=Q(this),e=A&&l.call(this)==="[object String]"?this.split(""):r,n=e.length>>>0,i=Array(n),o=arguments[1];if(!u(t)){throw new TypeError(t+" is not a function")}for(var a=0;a<n;a++){if(a in e){i[a]=t.call(o,e[a],a,r)}}return i}}if(!Array.prototype.filter||!j(Array.prototype.filter)){Array.prototype.filter=function lr(t){var r=Q(this),e=A&&l.call(this)==="[object String]"?this.split(""):r,n=e.length>>>0,i=[],o,a=arguments[1];if(!u(t)){throw new TypeError(t+" is not a function")}for(var p=0;p<n;p++){if(p in e){o=e[p];if(t.call(a,o,p,r)){i.push(o)}}}return i}}if(!Array.prototype.every||!j(Array.prototype.every)){Array.prototype.every=function ur(t){var r=Q(this),e=A&&l.call(this)==="[object String]"?this.split(""):r,n=e.length>>>0,i=arguments[1];if(!u(t)){throw new TypeError(t+" is not a function")}for(var o=0;o<n;o++){if(o in e&&!t.call(i,e[o],o,r)){return false}}return true}}if(!Array.prototype.some||!j(Array.prototype.some)){Array.prototype.some=function pr(t){var r=Q(this),e=A&&l.call(this)==="[object String]"?this.split(""):r,n=e.length>>>0,i=arguments[1];if(!u(t)){throw new TypeError(t+" is not a function")}for(var o=0;o<n;o++){if(o in e&&t.call(i,e[o],o,r)){return true}}return false}}var O=false;if(Array.prototype.reduce){O=typeof Array.prototype.reduce.call("es5",function(t,r,e,n){return n})==="object"}if(!Array.prototype.reduce||!O){Array.prototype.reduce=function sr(t){var r=Q(this),e=A&&l.call(this)==="[object String]"?this.split(""):r,n=e.length>>>0;if(!u(t)){throw new TypeError(t+" is not a function")}if(!n&&arguments.length===1){throw new TypeError("reduce of empty array with no initial value")}var i=0;var o;if(arguments.length>=2){o=arguments[1]}else{do{if(i in e){o=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){o=t.call(void 0,o,e[i],i,r)}}return o}}var E=false;if(Array.prototype.reduceRight){E=typeof Array.prototype.reduceRight.call("es5",function(t,r,e,n){return n})==="object"}if(!Array.prototype.reduceRight||!E){Array.prototype.reduceRight=function fr(t){var r=Q(this),e=A&&l.call(this)==="[object String]"?this.split(""):r,n=e.length>>>0;if(!u(t)){throw new TypeError(t+" is not a function")}if(!n&&arguments.length===1){throw new TypeError("reduceRight of empty array with no initial value")}var i,o=n-1;if(arguments.length>=2){i=arguments[1]}else{do{if(o in e){i=e[o--];break}if(--o<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}if(o<0){return i}do{if(o in e){i=t.call(void 0,i,e[o],o,r)}}while(o--);return i}}if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!==-1){Array.prototype.indexOf=function cr(t){var r=A&&l.call(this)==="[object String]"?this.split(""):Q(this),e=r.length>>>0;if(!e){return-1}var n=0;if(arguments.length>1){n=q(arguments[1])}n=n>=0?n:Math.max(0,e+n);for(;n<e;n++){if(n in r&&r[n]===t){return n}}return-1}}if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!==-1){Array.prototype.lastIndexOf=function hr(t){var r=A&&l.call(this)==="[object String]"?this.split(""):Q(this),e=r.length>>>0;if(!e){return-1}var n=e-1;if(arguments.length>1){n=Math.min(n,q(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}}var N=Object.keys&&function(){return Object.keys(arguments).length===2}(1,2);if(!Object.keys){var T=!{toString:null}.propertyIsEnumerable("toString"),I=function(){}.propertyIsEnumerable("prototype"),D=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=D.length;Object.keys=function yr(t){var r=u(t),e=f(t),n=t!==null&&typeof t==="object",i=n&&l.call(t)==="[object String]";if(!n&&!r&&!e){throw new TypeError("Object.keys called on a non-object")}var o=[];var a=I&&r;if(i||e){for(var p=0;p<t.length;++p){o.push(String(p))}}else{for(var s in t){if(!(a&&s==="prototype")&&h(t,s)){o.push(String(s))}}}if(T){var c=t.constructor,y=c&&c.prototype===t;for(var g=0;g<_;g++){var v=D[g];if(!(y&&v==="constructor")&&h(t,v)){o.push(v)}}}return o}}else if(!N){var M=Object.keys;Object.keys=function gr(t){if(f(t)){return M(Array.prototype.slice.call(t))}else{return M(t)}}}var F=-621987552e5,R="-000001";if(!Date.prototype.toISOString||new Date(F).toISOString().indexOf(R)===-1){Date.prototype.toISOString=function vr(){var t,r,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;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);r=t.length;while(r--){e=t[r];if(e<10){t[r]="0"+e}}return n+"-"+t.slice(0,2).join("-")+"T"+t.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"}}var k=false;try{k=Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(F).toJSON().indexOf(R)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(C){}if(!k){Date.prototype.toJSON=function dr(t){var r=Object(this),e=K(r),n;if(typeof e==="number"&&!isFinite(e)){return null}n=r.toISOString;if(typeof n!=="function"){throw new TypeError("toISOString property is not callable")}return n.call(r)}}var U=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var Z=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"));var J=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(!Date.parse||J||Z||!U){Date=function(t){function r(e,n,i,o,a,l,u){var p=arguments.length;if(this instanceof t){var s=p===1&&String(e)===e?new t(r.parse(e)):p>=7?new t(e,n,i,o,a,l,u):p>=6?new t(e,n,i,o,a,l):p>=5?new t(e,n,i,o,a):p>=4?new t(e,n,i,o):p>=3?new t(e,n,i):p>=2?new t(e,n):p>=1?new t(e):new t;s.constructor=r;return s}return t.apply(this,arguments)}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];function i(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)}function o(r){return Number(new t(1970,0,1,0,0,0,r))}for(var a in t){r[a]=t[a]}r.now=t.now;r.UTC=t.UTC;r.prototype=t.prototype;r.prototype.constructor=r;r.parse=function l(r){var n=e.exec(r);if(n){var a=Number(n[1]),l=Number(n[2]||1)-1,u=Number(n[3]||1)-1,p=Number(n[4]||0),s=Number(n[5]||0),f=Number(n[6]||0),c=Math.floor(Number(n[7]||0)*1e3),h=Boolean(n[4]&&!n[8]),y=n[9]==="-"?1:-1,g=Number(n[10]||0),v=Number(n[11]||0),d;if(p<(s>0||f>0||c>0?24:25)&&s<60&&f<60&&c<1e3&&l>-1&&l<12&&g<24&&v<60&&u>-1&&u<i(a,l+1)-i(a,l)){d=((i(a,l)+u)*24+p+g*y)*60;d=((d+s+v*y)*60+f)*1e3+c;if(h){d=o(d)}if(-864e13<=d&&d<=864e13){return d}}return NaN}return t.parse.apply(this,arguments)};return r}(Date)}if(!Date.now){Date.now=function br(){return(new Date).getTime()}}if(!Number.prototype.toFixed||8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)==="0"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128"){(function(){var t,r,e,n;t=1e7;r=6;e=[0,0,0,0,0,0];function i(n,i){var o=-1;while(++o<r){i+=n*e[o];e[o]=i%t;i=Math.floor(i/t)}}function o(n){var i=r,o=0;while(--i>=0){o+=e[i];e[i]=Math.floor(o/n);o=o%n*t}}function a(){var t=r;var n="";while(--t>=0){if(n!==""||t===0||e[t]!==0){var i=String(e[t]);if(n===""){n=i}else{n+="0000000".slice(0,7-i.length)+i}}}return n}function l(t,r,e){return r===0?e:r%2===1?l(t,r-1,e*t):l(t*t,r/2,e)}function u(t){var r=0;while(t>=4096){r+=12;t/=4096}while(t>=2){r+=1;t/=2}return r}Number.prototype.toFixed=function p(t){var r,e,n,p,s,f,c,h;r=Number(t);r=r!==r?0:Math.floor(r);if(r<0||r>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}e=Number(this);if(e!==e){return"NaN"}if(e<=-1e21||e>=1e21){return String(e)}n="";if(e<0){n="-";e=-e}p="0";if(e>1e-21){s=u(e*l(2,69,1))-69;f=s<0?e*l(2,-s,1):e/l(2,s,1);f*=4503599627370496;s=52-s;if(s>0){i(0,f);c=r;while(c>=7){i(1e7,0);c-=7}i(l(10,c,1),0);c=s-1;while(c>=23){o(1<<23);c-=23}o(1<<c);i(1,1);o(2);p=a()}else{i(0,f);i(1<<-s,0);p=a()+"0.00000000000000000000".slice(2,2+r)}}if(r>0){h=p.length;if(h<=r){p=n+"0.0000000000000000000".slice(0,r-h+2)+p}else{p=n+p.slice(0,h-r)+"."+p.slice(h-r)}}else{p=n+p}return p}})()}var $=String.prototype.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=/()??/.exec("")[1]===void 0;String.prototype.split=function(r,e){var n=this;if(r===void 0&&e===0){return[]}if(l.call(r)!=="[object RegExp]"){return $.call(this,r,e)}var i=[],o=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),a=0,u,p,s,f;r=new RegExp(r.source,o+"g");n+="";if(!t){u=new RegExp("^"+r.source+"$(?!\\s)",o)}e=e===void 0?-1>>>0:V(e);while(p=r.exec(n)){s=p.index+p[0].length;if(s>a){i.push(n.slice(a,p.index));if(!t&&p.length>1){p[0].replace(u,function(){for(var t=1;t<arguments.length-2;t++){if(arguments[t]===void 0){p[t]=void 0}}})}if(p.length>1&&p.index<n.length){Array.prototype.push.apply(i,p.slice(1))}f=p[0].length;a=s;if(i.length>=e){break}}if(r.lastIndex===p.index){r.lastIndex++}}if(a===n.length){if(f||!r.test("")){i.push("")}}else{i.push(n.slice(a))}return i.length>e?i.slice(0,e):i}})()}else if("0".split(void 0,0).length){String.prototype.split=function mr(t,r){if(t===void 0&&r===0){return[]}return $.call(this,t,r)}}var G=String.prototype.replace;var P=function(){var t=[];"x".replace(/x(.)?/g,function(r,e){t.push(e)});return t.length===1&&typeof t[0]==="undefined"}();if(!P){String.prototype.replace=function wr(t,r){var e=u(r);var n=p(t)&&/\)[*?]/.test(t.source);if(!e||!n){return G.call(this,t,r)}else{var i=function(e){var n=arguments.length;var i=t.lastIndex;t.lastIndex=0;var o=t.exec(e);t.lastIndex=i;o.push(arguments[n-2],arguments[n-1]);return r.apply(this,o)};return G.call(this,t,i)}}}if("".substr&&"0b".substr(-1)!=="b"){var B=String.prototype.substr;String.prototype.substr=function Sr(t,r){return B.call(this,t<0?(t=this.length+t)<0?0:t:t,r)}}var H=" \n\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var L="\u200b";if(!String.prototype.trim||H.trim()||!L.trim()){H="["+H+"]";var X=new RegExp("^"+H+H+"*"),Y=new RegExp(H+H+"*$");String.prototype.trim=function xr(){if(this===void 0||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(X,"").replace(Y,"")}}if(parseInt(H+"08")!==8||parseInt(H+"0x16")!==22){parseInt=function(t){var r=/^0[xX]/;return function e(n,i){n=String(n).trim();if(!Number(i)){i=r.test(n)?16:10}return t(n,i)}}(parseInt)}function q(t){t=+t;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}function z(t){var r=typeof t;return t===null||r==="undefined"||r==="boolean"||r==="number"||r==="string"}function K(t){var r,e,n;if(z(t)){return t}e=t.valueOf;if(u(e)){r=e.call(t);if(z(r)){return r}}n=t.toString;if(u(n)){r=n.call(t);if(z(r)){return r}}throw new TypeError}var Q=function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return Object(t)};var V=function Ar(t){return t>>>0}}); | ||
(function(t,e){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 l=t.push;var u=t.unshift;var s=r.call;var f=e.toString;var c=function(t){return e.toString.call(t)==="[object Function]"};var h=function(t){return e.toString.call(t)==="[object RegExp]"};var p=function ve(t){return f.call(t)==="[object Array]"};var v=function ge(t){return f.call(t)==="[object String]"};var g=function ye(t){var e=f.call(t);var r=e==="[object Arguments]";if(!r){r=!p(e)&&t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&c(t.callee)}return r};var y=Object.defineProperty&&function(){try{Object.defineProperty({},"x",{});return true}catch(t){return false}}();var d;if(y){d=function(t,e,r,n){if(!n&&e in t){return}Object.defineProperty(t,e,{configurable:true,enumerable:false,writable:true,value:r})}}else{d=function(t,e,r,n){if(!n&&e in t){return}t[e]=r}}var m=function(t,r,n){for(var i in r){if(e.hasOwnProperty.call(r,i)){d(t,i,r[i],n)}}};function w(t){t=+t;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}function b(t){var e=typeof t;return t===null||e==="undefined"||e==="boolean"||e==="number"||e==="string"}function x(t){var e,r,n;if(b(t)){return t}r=t.valueOf;if(c(r)){e=r.call(t);if(b(e)){return e}}n=t.toString;if(c(n)){e=n.call(t);if(b(e)){return e}}throw new TypeError}var S=function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return Object(t)};var O=function de(t){return t>>>0};function T(){}m(r,{bind:function me(t){var e=this;if(!c(e)){throw new TypeError("Function.prototype.bind called on incompatible "+e)}var r=a.call(arguments,1);var n=function(){if(this instanceof u){var n=e.apply(this,r.concat(a.call(arguments)));if(Object(n)===n){return n}return this}else{return e.apply(t,r.concat(a.call(arguments)))}};var i=Math.max(0,e.length-r.length);var o=[];for(var l=0;l<i;l++){o.push("$"+l)}var u=Function("binder","return function ("+o.join(",")+"){return binder.apply(this,arguments)}")(n);if(e.prototype){T.prototype=e.prototype;u.prototype=new T;T.prototype=null}return u}});var j=s.bind(e.hasOwnProperty);var E;var N;var I;var D;var _;if(_=j(e,"__defineGetter__")){E=s.bind(e.__defineGetter__);N=s.bind(e.__defineSetter__);I=s.bind(e.__lookupGetter__);D=s.bind(e.__lookupSetter__)}var M=function(){var t=[1,2];var e=t.splice();return t.length===2&&p(e)&&e.length===0}();m(t,{splice:function we(t,e){if(arguments.length===0){return[]}else{return o.apply(this,arguments)}}},M);var F=function(){var e={};t.splice.call(e,0,0,1);return e.length===1}();m(t,{splice:function be(t,e){if(arguments.length===0){return[]}var r=arguments;this.length=Math.max(w(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]=w(e)}}return o.apply(this,r)}},!F);var R=[].unshift(0)!==1;m(t,{unshift:function(){u.apply(this,arguments);return this.length}},R);m(Array,{isArray:p});var k=Object("a");var C=k[0]!=="a"||!(0 in k);var U=function xe(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};m(t,{forEach:function Se(t){var e=S(this),r=C&&v(this)?this.split(""):e,n=arguments[1],i=-1,a=r.length>>>0;if(!c(t)){throw new TypeError}while(++i<a){if(i in r){t.call(n,r[i],i,e)}}}},!U(t.forEach));m(t,{map:function Oe(t){var e=S(this),r=C&&v(this)?this.split(""):e,n=r.length>>>0,i=Array(n),a=arguments[1];if(!c(t)){throw new TypeError(t+" is not a function")}for(var o=0;o<n;o++){if(o in r){i[o]=t.call(a,r[o],o,e)}}return i}},!U(t.map));m(t,{filter:function Te(t){var e=S(this),r=C&&v(this)?this.split(""):e,n=r.length>>>0,i=[],a,o=arguments[1];if(!c(t)){throw new TypeError(t+" is not a function")}for(var l=0;l<n;l++){if(l in r){a=r[l];if(t.call(o,a,l,e)){i.push(a)}}}return i}},!U(t.filter));m(t,{every:function je(t){var e=S(this),r=C&&v(this)?this.split(""):e,n=r.length>>>0,i=arguments[1];if(!c(t)){throw new TypeError(t+" is not a function")}for(var a=0;a<n;a++){if(a in r&&!t.call(i,r[a],a,e)){return false}}return true}},!U(t.every));m(t,{some:function Ee(t){var e=S(this),r=C&&v(this)?this.split(""):e,n=r.length>>>0,i=arguments[1];if(!c(t)){throw new TypeError(t+" is not a function")}for(var a=0;a<n;a++){if(a in r&&t.call(i,r[a],a,e)){return true}}return false}},!U(t.some));var A=false;if(t.reduce){A=typeof t.reduce.call("es5",function(t,e,r,n){return n})==="object"}m(t,{reduce:function Ne(t){var e=S(this),r=C&&v(this)?this.split(""):e,n=r.length>>>0;if(!c(t)){throw new TypeError(t+" is not a function")}if(!n&&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.call(void 0,a,r[i],i,e)}}return a}},!A);var P=false;if(t.reduceRight){P=typeof t.reduceRight.call("es5",function(t,e,r,n){return n})==="object"}m(t,{reduceRight:function Ie(t){var e=S(this),r=C&&v(this)?this.split(""):e,n=r.length>>>0;if(!c(t)){throw new TypeError(t+" is not a function")}if(!n&&arguments.length===1){throw new TypeError("reduceRight of empty array with no initial value")}var i,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.call(void 0,i,r[a],a,e)}}while(a--);return i}},!P);var Z=Array.prototype.indexOf&&[0,1].indexOf(1,2)!==-1;m(t,{indexOf:function De(t){var e=C&&v(this)?this.split(""):S(this),r=e.length>>>0;if(!r){return-1}var n=0;if(arguments.length>1){n=w(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}},Z);var J=Array.prototype.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;m(t,{lastIndexOf:function _e(t){var e=C&&v(this)?this.split(""):S(this),r=e.length>>>0;if(!r){return-1}var n=r-1;if(arguments.length>1){n=Math.min(n,w(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}},J);var z=!{toString:null}.propertyIsEnumerable("toString"),$=function(){}.propertyIsEnumerable("prototype"),G=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],B=G.length;m(Object,{keys:function Me(t){var e=c(t),r=g(t),n=t!==null&&typeof t==="object",i=n&&v(t);if(!n&&!e&&!r){throw new TypeError("Object.keys called on a non-object")}var a=[];var o=$&&e;if(i||r){for(var l=0;l<t.length;++l){a.push(String(l))}}else{for(var u in t){if(!(o&&u==="prototype")&&j(t,u)){a.push(String(u))}}}if(z){var s=t.constructor,f=s&&s.prototype===t;for(var h=0;h<B;h++){var p=G[h];if(!(f&&p==="constructor")&&j(t,p)){a.push(p)}}}return a}});var H=Object.keys&&function(){return Object.keys(arguments).length===2}(1,2);var L=Object.keys;m(Object,{keys:function Fe(e){if(g(e)){return L(t.slice.call(e))}else{return L(e)}}},!H);var X=-621987552e5;var Y="-000001";var q=Date.prototype.toISOString&&new Date(X).toISOString().indexOf(Y)===-1;m(Date.prototype,{toISOString:function Re(){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"}},q);var K=false;try{K=Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(X).toJSON().indexOf(Y)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(Q){}if(!K){Date.prototype.toJSON=function ke(t){var e=Object(this),r=x(e),n;if(typeof r==="number"&&!isFinite(r)){return null}n=e.toISOString;if(typeof n!=="function"){throw new TypeError("toISOString property is not callable")}return n.call(e)}}var V=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var W=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"));var te=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(!Date.parse||te||W||!V){Date=function(t){function e(r,n,i,a,o,l,u){var s=arguments.length;if(this instanceof t){var f=s===1&&String(r)===r?new t(e.parse(r)):s>=7?new t(r,n,i,a,o,l,u):s>=6?new t(r,n,i,a,o,l):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;f.constructor=e;return f}return t.apply(this,arguments)}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];function i(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)}function a(e){return Number(new t(1970,0,1,0,0,0,e))}for(var o in t){e[o]=t[o]}e.now=t.now;e.UTC=t.UTC;e.prototype=t.prototype;e.prototype.constructor=e;e.parse=function l(e){var n=r.exec(e);if(n){var o=Number(n[1]),l=Number(n[2]||1)-1,u=Number(n[3]||1)-1,s=Number(n[4]||0),f=Number(n[5]||0),c=Number(n[6]||0),h=Math.floor(Number(n[7]||0)*1e3),p=Boolean(n[4]&&!n[8]),v=n[9]==="-"?1:-1,g=Number(n[10]||0),y=Number(n[11]||0),d;if(s<(f>0||c>0||h>0?24:25)&&f<60&&c<60&&h<1e3&&l>-1&&l<12&&g<24&&y<60&&u>-1&&u<i(o,l+1)-i(o,l)){d=((i(o,l)+u)*24+s+g*v)*60;d=((d+f+y*v)*60+c)*1e3+h;if(p){d=a(d)}if(-864e13<=d&&d<=864e13){return d}}return NaN}return t.parse.apply(this,arguments)};return e}(Date)}if(!Date.now){Date.now=function Ce(){return(new Date).getTime()}}var ee=i.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var re={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function Ue(t,e){var r=-1;while(++r<re.size){e+=t*re.data[r];re.data[r]=e%re.base;e=Math.floor(e/re.base)}},divide:function Ae(t){var e=re.size,r=0;while(--e>=0){r+=re.data[e];re.data[e]=Math.floor(r/t);r=r%t*re.base}},numToString:function Pe(){var t=re.size;var e="";while(--t>=0){if(e!==""||t===0||re.data[t]!==0){var r=String(re.data[t]);if(e===""){e=r}else{e+="0000000".slice(0,7-r.length)+r}}}return e},pow:function Ze(t,e,r){return e===0?r:e%2===1?Ze(t,e-1,r*t):Ze(t*t,e/2,r)},log:function Je(t){var e=0;while(t>=4096){e+=12;t/=4096}while(t>=2){e+=1;t/=2}return e}};m(i,{toFixed:function ze(t){var e,r,n,i,a,o,l,u;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=re.log(r*re.pow(2,69,1))-69;o=a<0?r*re.pow(2,-a,1):r/re.pow(2,a,1);o*=4503599627370496;a=52-a;if(a>0){re.multiply(0,o);l=e;while(l>=7){re.multiply(1e7,0);l-=7}re.multiply(re.pow(10,l,1),0);l=a-1;while(l>=23){re.divide(1<<23);l-=23}re.divide(1<<l);re.multiply(1,1);re.divide(2);i=re.numToString()}else{re.multiply(0,o);re.multiply(1<<-a,0);i=re.numToString()+"0.00000000000000000000".slice(2,2+e)}}if(e>0){u=i.length;if(u<=e){i=n+"0.0000000000000000000".slice(0,e-u+2)+i}else{i=n+i.slice(0,u-e)+"."+i.slice(u-e)}}else{i=n+i}return i}},ee);var ne=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 e=/()??/.exec("")[1]===void 0;n.split=function(r,n){var i=this;if(r===void 0&&n===0){return[]}if(f.call(r)!=="[object RegExp]"){return ne.call(this,r,n)}var a=[],o=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),l=0,u,s,c,h;r=new RegExp(r.source,o+"g");i+="";if(!e){u=new RegExp("^"+r.source+"$(?!\\s)",o)}n=n===void 0?-1>>>0:O(n);while(s=r.exec(i)){c=s.index+s[0].length;if(c>l){a.push(i.slice(l,s.index));if(!e&&s.length>1){s[0].replace(u,function(){for(var t=1;t<arguments.length-2;t++){if(arguments[t]===void 0){s[t]=void 0}}})}if(s.length>1&&s.index<i.length){t.push.apply(a,s.slice(1))}h=s[0].length;l=c;if(a.length>=n){break}}if(r.lastIndex===s.index){r.lastIndex++}}if(l===i.length){if(h||!r.test("")){a.push("")}}else{a.push(i.slice(l))}return a.length>n?a.slice(0,n):a}})()}else if("0".split(void 0,0).length){n.split=function $e(t,e){if(t===void 0&&e===0){return[]}return ne.call(this,t,e)}}var ie=n.replace;var ae=function(){var t=[];"x".replace(/x(.)?/g,function(e,r){t.push(r)});return t.length===1&&typeof t[0]==="undefined"}();if(!ae){n.replace=function Ge(t,e){var r=c(e);var n=h(t)&&/\)[*?]/.test(t.source);if(!r||!n){return ie.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 ie.call(this,t,i)}}}var oe=n.substr;var le="".substr&&"0b".substr(-1)!=="b";m(n,{substr:function Be(t,e){return oe.call(this,t<0?(t=this.length+t)<0?0:t:t,e)}},le);var ue=" \n\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var se="\u200b";var fe="["+ue+"]";var ce=new RegExp("^"+fe+fe+"*");var he=new RegExp(fe+fe+"*$");var pe=n.trim&&(ue.trim()||!se.trim());m(n,{trim:function He(){if(this===void 0||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(ce,"").replace(he,"")}},pe);if(parseInt(ue+"08")!==8||parseInt(ue+"0x16")!==22){parseInt=function(t){var e=/^0[xX]/;return function r(n,i){n=String(n).trim();if(!Number(i)){i=e.test(n)?16:10}return t(n,i)}}(parseInt)}}); | ||
//# sourceMappingURL=es5-shim.map |
{ | ||
"name": "es5-shim", | ||
"version": "3.4.0", | ||
"version": "4.0.0", | ||
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
@@ -33,9 +33,10 @@ "homepage": "http://github.com/es-shims/es5-shim/", | ||
"minify-sham": "uglifyjs es5-sham.js --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js", | ||
"test": "jasmine-node --matchall tests/spec/", | ||
"test": "jasmine-node --matchall ./ tests/spec/", | ||
"test-native": "jasmine-node --matchall tests/spec/", | ||
"lint": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js" | ||
}, | ||
"devDependencies": { | ||
"jasmine-node": "~1.14.2", | ||
"jscs": "~1.4.5", | ||
"uglify-js": "~2.4.12" | ||
"jasmine-node": "1.14.2", | ||
"jscs": "~1.5.8", | ||
"uglify-js": "~2.4.14" | ||
}, | ||
@@ -42,0 +43,0 @@ "engines": { |
{ | ||
"Object": { | ||
"prototype": {} | ||
"prototype": {}, | ||
"keys": "object-keys" | ||
@@ -5,0 +5,0 @@ } |
require('../helpers/h-matchers'); | ||
require('../../'); | ||
@@ -1179,3 +1179,6 @@ var toString = Object.prototype.toString; | ||
it('treats undefined deleteCount as 0', function () { | ||
/* This test is disabled, because ES6 normalizes actual | ||
* browser behavior, contradicting ES5. | ||
*/ | ||
xit('treats undefined deleteCount as 0', function () { | ||
expect(test.splice(0).length).toBe(0); | ||
@@ -1197,3 +1200,3 @@ expect(test.splice(0)).toEqual(test.splice(0, 0)); | ||
array.splice(0, 0, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); | ||
array.splice(0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20); | ||
array.splice(1, 0, "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21","F22", "F23", "F24", "F25", "F26"); | ||
@@ -1200,0 +1203,0 @@ array.splice(5, 0, "XXX"); |
@@ -12,3 +12,3 @@ describe('Object', function () { | ||
"null": null, | ||
"undefined": undefined | ||
undefined: undefined | ||
}; | ||
@@ -15,0 +15,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
329272
6803
0
34