Comparing version 4.0.5 to 4.0.6
@@ -16,2 +16,4 @@ { | ||
"requireSpaceBetweenArguments": true, | ||
"disallowSpacesInsideParentheses": true, | ||
@@ -18,0 +20,0 @@ |
{ | ||
"name": "es5-shim", | ||
"version": "4.0.5", | ||
"version": "4.0.6", | ||
"main": "es5-shim.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -5,3 +5,3 @@ { | ||
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
"version": "v4.0.5", | ||
"version": "v4.0.6", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "shim", |
@@ -42,2 +42,3 @@ /*! | ||
if (supportsAccessors) { | ||
/*eslint-disable no-underscore-dangle */ | ||
defineGetter = call.bind(prototypeOfObject.__defineGetter__); | ||
@@ -47,2 +48,3 @@ defineSetter = call.bind(prototypeOfObject.__defineSetter__); | ||
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); | ||
/*eslint-enable no-underscore-dangle */ | ||
} | ||
@@ -61,3 +63,5 @@ | ||
Object.getPrototypeOf = function getPrototypeOf(object) { | ||
/*eslint-disable no-proto */ | ||
var proto = object.__proto__; | ||
/*eslint-enable no-proto */ | ||
if (proto || proto === null) { | ||
@@ -99,2 +103,3 @@ return proto; | ||
/*eslint-disable no-proto */ | ||
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { | ||
@@ -115,5 +120,7 @@ if ((typeof object !== 'object' && typeof object !== 'function') || object === null) { | ||
var descriptor; | ||
// If object does not owns property return undefined immediately. | ||
if (!owns(object, property)) { | ||
return; | ||
return descriptor; | ||
} | ||
@@ -123,3 +130,3 @@ | ||
// `configurable`. | ||
var descriptor = { enumerable: true, configurable: true }; | ||
descriptor = { enumerable: true, configurable: true }; | ||
@@ -170,2 +177,3 @@ // If JS engine supports accessor properties then property may be a | ||
}; | ||
/*eslint-enable no-proto */ | ||
} | ||
@@ -207,3 +215,5 @@ | ||
parent.appendChild(iframe); | ||
/*eslint-disable no-script-url */ | ||
iframe.src = 'javascript:'; | ||
/*eslint-enable no-script-url */ | ||
var empty = iframe.contentWindow.Object.prototype; | ||
@@ -219,3 +229,5 @@ parent.removeChild(iframe); | ||
delete empty.valueOf; | ||
/*eslint-disable no-proto */ | ||
empty.__proto__ = null; | ||
/*eslint-enable no-proto */ | ||
@@ -254,3 +266,5 @@ function Empty() {} | ||
// objects created using `Object.create` | ||
/*eslint-disable no-proto */ | ||
object.__proto__ = prototype; | ||
/*eslint-enable no-proto */ | ||
} | ||
@@ -322,3 +336,3 @@ | ||
// If it's a data property. | ||
if (owns(descriptor, 'value')) { | ||
if ('value' in descriptor) { | ||
// fail silently if 'writable', 'enumerable', or 'configurable' | ||
@@ -329,6 +343,6 @@ // are requested but not supported | ||
if ( // can't implement these features; allow false but not true | ||
!(owns(descriptor, 'writable') ? descriptor.writable : true) || | ||
!(owns(descriptor, 'enumerable') ? descriptor.enumerable : true) || | ||
!(owns(descriptor, 'configurable') ? descriptor.configurable : true) | ||
) | ||
('writable' in descriptor && !descriptor.writable) || | ||
('enumerable' in descriptor && !descriptor.enumerable) || | ||
('configurable' in descriptor && !descriptor.configurable) | ||
)) | ||
throw new RangeError( | ||
@@ -344,2 +358,3 @@ 'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.' | ||
// accessor. | ||
/*eslint-disable no-proto */ | ||
var prototype = object.__proto__; | ||
@@ -353,2 +368,3 @@ object.__proto__ = prototypeOfObject; | ||
object.__proto__ = prototype; | ||
/*eslint-enable no-proto */ | ||
} else { | ||
@@ -362,6 +378,6 @@ object[property] = descriptor.value; | ||
// If we got that far then getters and setters can be defined !! | ||
if (owns(descriptor, 'get')) { | ||
if ('get' in descriptor) { | ||
defineGetter(object, property, descriptor.get); | ||
} | ||
if (owns(descriptor, 'set')) { | ||
if ('set' in descriptor) { | ||
defineSetter(object, property, descriptor.set); | ||
@@ -400,2 +416,5 @@ } | ||
Object.seal = function seal(object) { | ||
if (Object(object) !== object) { | ||
throw new TypeError('Object.seal can only be called on Objects.'); | ||
} | ||
// this is misleading and breaks feature-detection, but | ||
@@ -412,2 +431,5 @@ // allows "securable" code to "gracefully" degrade to working | ||
Object.freeze = function freeze(object) { | ||
if (Object(object) !== object) { | ||
throw new TypeError('Object.freeze can only be called on Objects.'); | ||
} | ||
// this is misleading and breaks feature-detection, but | ||
@@ -439,2 +461,5 @@ // allows "securable" code to "gracefully" degrade to working | ||
Object.preventExtensions = function preventExtensions(object) { | ||
if (Object(object) !== object) { | ||
throw new TypeError('Object.preventExtensions can only be called on Objects.'); | ||
} | ||
// this is misleading and breaks feature-detection, but | ||
@@ -451,2 +476,5 @@ // allows "securable" code to "gracefully" degrade to working | ||
Object.isSealed = function isSealed(object) { | ||
if (Object(object) !== object) { | ||
throw new TypeError('Object.isSealed can only be called on Objects.'); | ||
} | ||
return false; | ||
@@ -460,2 +488,5 @@ }; | ||
Object.isFrozen = function isFrozen(object) { | ||
if (Object(object) !== object) { | ||
throw new TypeError('Object.isFrozen can only be called on Objects.'); | ||
} | ||
return false; | ||
@@ -471,3 +502,3 @@ }; | ||
if (Object(object) !== object) { | ||
throw new TypeError(); // TODO message | ||
throw new TypeError('Object.isExtensible can only be called on Objects.'); | ||
} | ||
@@ -474,0 +505,0 @@ // 2. Return the Boolean value of the [[Extensible]] internal property of O. |
/*! | ||
* https://github.com/es-shims/es5-shim | ||
* @license es5-shim Copyright 2009-2014 by contributors, MIT License | ||
* see https://github.com/es-shims/es5-shim/blob/v4.0.5/LICENSE | ||
* see https://github.com/es-shims/es5-shim/blob/v4.0.6/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 i;var c;var f=r(t,"__defineGetter__");if(f){n=e.bind(t.__defineGetter__);o=e.bind(t.__defineSetter__);i=e.bind(t.__lookupGetter__);c=e.bind(t.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function g(e){var r=e.__proto__;if(r||r===null){return r}else if(e.constructor){return e.constructor.prototype}else{return t}}}function u(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){}}if(Object.defineProperty){var p=u({});var a=typeof document==="undefined"||u(document.createElement("div"));if(!a||!p){var l=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||l){var b="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function E(e,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(b+e)}if(l){try{return l.call(Object,e,n)}catch(o){}}if(!r(e,n)){return}var u={enumerable:true,configurable:true};if(f){var p=e.__proto__;var a=e!==t;if(a){e.__proto__=t}var s=i(e,n);var _=c(e,n);if(a){e.__proto__=p}if(s||_){if(s){u.get=s}if(_){u.set=_}return u}}u.value=e[n];u.writable=true;return u}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function x(e){return Object.keys(e)}}if(!Object.create){var s;var _=!({__proto__:null}instanceof Object);if(_||typeof document==="undefined"){s=function(){return{__proto__:null}}}else{s=function(){var e=document.createElement("iframe");var t=document.body||document.documentElement;e.style.display="none";t.appendChild(e);e.src="javascript:";var r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;delete r.constructor;delete r.hasOwnProperty;delete r.propertyIsEnumerable;delete r.isPrototypeOf;delete r.toLocaleString;delete r.toString;delete r.valueOf;r.__proto__=null;function n(){}n.prototype=r;s=function(){return new n};return new n}}Object.create=function z(e,t){var r;function n(){}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}}function d(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){}}if(Object.defineProperty){var y=d({});var O=typeof document==="undefined"||d(document.createElement("div"));if(!y||!O){var j=Object.defineProperty,v=Object.defineProperties}}if(!Object.defineProperty||j){var w="Property description must be an object: ";var P="Object.defineProperty called on non-object: ";var m="getters & setters can not be defined on this javascript engine";Object.defineProperty=function S(e,u,p){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(P+e)}if(typeof p!=="object"&&typeof p!=="function"||p===null){throw new TypeError(w+p)}if(j){try{return j.call(Object,e,u,p)}catch(a){}}if(r(p,"value")){if(f&&(i(e,u)||c(e,u))){var l=e.__proto__;e.__proto__=t;delete e[u];e[u]=p.value;e.__proto__=l}else{e[u]=p.value}}else{if(!f){throw new TypeError(m)}if(r(p,"get")){n(e,u,p.get)}if(r(p,"set")){o(e,u,p.set)}}return e}}if(!Object.defineProperties||v){Object.defineProperties=function T(e,t){if(v){try{return v.call(Object,e,t)}catch(n){}}for(var o in t){if(r(t,o)&&o!=="__proto__"){Object.defineProperty(e,o,t[o])}}return e}}if(!Object.seal){Object.seal=function D(e){return e}}if(!Object.freeze){Object.freeze=function k(e){return e}}try{Object.freeze(function(){})}catch(h){Object.freeze=function F(e){return function t(r){if(typeof r==="function"){return r}else{return e(r)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function G(e){return e}}if(!Object.isSealed){Object.isSealed=function C(e){return false}}if(!Object.isFrozen){Object.isFrozen=function N(e){return false}}if(!Object.isExtensible){Object.isExtensible=function I(e){if(Object(e)!==e){throw new TypeError}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;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 E(e){var r=e.__proto__;if(r||r===null){return r}else if(e.constructor){return e.constructor.prototype}else{return t}}}function l(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){}}if(Object.defineProperty){var u=l({});var a=typeof document==="undefined"||l(document.createElement("div"));if(!a||!u){var p=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||p){var b="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function g(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 u=e.__proto__;var a=e!==t;if(a){e.__proto__=t}var s=c(e,n);var O=i(e,n);if(a){e.__proto__=u}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 T(e){return Object.keys(e)}}if(!Object.create){var s;var O=!({__proto__:null}instanceof Object);if(O||typeof document==="undefined"){s=function(){return{__proto__:null}}}else{s=function(){var e=document.createElement("iframe");var t=document.body||document.documentElement;e.style.display="none";t.appendChild(e);e.src="javascript:";var r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;delete r.constructor;delete r.hasOwnProperty;delete r.propertyIsEnumerable;delete r.isPrototypeOf;delete r.toLocaleString;delete r.toString;delete r.valueOf;r.__proto__=null;function n(){}n.prototype=r;s=function(){return new n};return new n}}Object.create=function x(e,t){var r;function n(){}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}}function j(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){}}if(Object.defineProperty){var d=j({});var y=typeof document==="undefined"||j(document.createElement("div"));if(!d||!y){var _=Object.defineProperty,v=Object.defineProperties}}if(!Object.defineProperty||_){var w="Property description must be an object: ";var P="Object.defineProperty called on non-object: ";var h="getters & setters can not be defined on this javascript engine";Object.defineProperty=function z(e,r,l){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(P+e)}if(typeof l!=="object"&&typeof l!=="function"||l===null){throw new TypeError(w+l)}if(_){try{return _.call(Object,e,r,l)}catch(u){}}if("value"in l){if(f&&(c(e,r)||i(e,r))){var a=e.__proto__;e.__proto__=t;delete e[r];e[r]=l.value;e.__proto__=a}else{e[r]=l.value}}else{if(!f){throw new TypeError(h)}if("get"in l){n(e,r,l.get)}if("set"in l){o(e,r,l.set)}}return e}}if(!Object.defineProperties||v){Object.defineProperties=function S(e,t){if(v){try{return v.call(Object,e,t)}catch(n){}}for(var o in t){if(r(t,o)&&o!=="__proto__"){Object.defineProperty(e,o,t[o])}}return e}}if(!Object.seal){Object.seal=function D(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function F(e){if(Object(e)!==e){throw new TypeError("Object.freeze can only be called on Objects.")}return e}}try{Object.freeze(function(){})}catch(m){Object.freeze=function k(e){return function t(r){if(typeof r==="function"){return r}else{return e(r)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function G(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function C(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function N(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function I(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 |
@@ -9,7 +9,8 @@ /*! | ||
// Add semicolon to prevent IIFE from being passed as argument to concatenated code. | ||
; | ||
// UMD (Universal Module Definition) | ||
// see https://github.com/umdjs/umd/blob/master/returnExports.js | ||
// Add semicolon to prevent IIFE from being passed as argument to concatenated code. | ||
;(function (root, factory) { | ||
(function (root, factory) { | ||
'use strict'; | ||
@@ -82,37 +83,40 @@ /*global define, exports, module */ | ||
var supportsDescriptors = Object.defineProperty && (function () { | ||
try { | ||
Object.defineProperty({}, 'x', {}); | ||
return true; | ||
} catch (e) { /* this is ES3 */ | ||
return false; | ||
} | ||
}()); | ||
/* inlined from http://npmjs.com/define-properties */ | ||
var defineProperties = (function (has) { | ||
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); | ||
} | ||
} | ||
}; | ||
// 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; | ||
}; | ||
} | ||
return function defineProperties(object, map, forceAssign) { | ||
for (var name in map) { | ||
if (has.call(map, name)) { | ||
defineProperty(object, name, map[name], forceAssign); | ||
} | ||
} | ||
}; | ||
}(ObjectPrototype.hasOwnProperty)); | ||
@@ -353,3 +357,3 @@ // | ||
} | ||
}, spliceNoopReturnsEmptyArray); | ||
}, !spliceNoopReturnsEmptyArray); | ||
@@ -732,2 +736,3 @@ var spliceWorksWithEmptyObject = (function () { | ||
hasProtoEnumBug = function () {}.propertyIsEnumerable('prototype'), | ||
hasStringEnumBug = !owns('x', '0'), | ||
dontEnums = [ | ||
@@ -757,7 +762,9 @@ 'toString', | ||
var skipProto = hasProtoEnumBug && isFn; | ||
if (isStr || isArgs) { | ||
if ((isStr && hasStringEnumBug) || isArgs) { | ||
for (var i = 0; i < object.length; ++i) { | ||
theKeys.push(String(i)); | ||
} | ||
} else { | ||
} | ||
if (!isArgs) { | ||
for (var name in object) { | ||
@@ -833,3 +840,3 @@ if (!(skipProto && name === 'prototype') && owns(object, name)) { | ||
(year < 0 ? '-' : (year > 9999 ? '+' : '')) + | ||
('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6) | ||
('00000' + Math.abs(year)).slice((0 <= year && year <= 9999) ? -4 : -6) | ||
); | ||
@@ -922,4 +929,5 @@ | ||
/*global Date: true */ | ||
/*eslint-disable no-undef*/ | ||
Date = (function (NativeDate) { | ||
/*eslint-enable no-undef*/ | ||
// Date.length === 7 | ||
@@ -1294,3 +1302,4 @@ function Date(Y, M, D, h, m, s, ms) { | ||
ES.ToUint32(limit); | ||
while (match = separator.exec(string)) { | ||
match = separator.exec(string); | ||
while (match) { | ||
// `separator.lastIndex` is not reliable cross-browser | ||
@@ -1303,2 +1312,3 @@ lastIndex = match.index + match[0].length; | ||
if (!compliantExecNpcg && match.length > 1) { | ||
/*eslint-disable no-loop-func */ | ||
match[0].replace(separator2, function () { | ||
@@ -1311,2 +1321,3 @@ for (var i = 1; i < arguments.length - 2; i++) { | ||
}); | ||
/*eslint-enable no-loop-func */ | ||
} | ||
@@ -1325,2 +1336,3 @@ if (match.length > 1 && match.index < string.length) { | ||
} | ||
match = separator.exec(string); | ||
} | ||
@@ -1327,0 +1339,0 @@ if (lastLastIndex === string.length) { |
/*! | ||
* https://github.com/es-shims/es5-shim | ||
* @license es5-shim Copyright 2009-2014 by contributors, MIT License | ||
* see https://github.com/es-shims/es5-shim/blob/v4.0.5/LICENSE | ||
* see https://github.com/es-shims/es5-shim/blob/v4.0.6/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 s=r.call;var f=e.toString;var c=function(t){return f.call(t)==="[object Function]"};var p=function(t){return f.call(t)==="[object RegExp]"};var h=function le(t){return f.call(t)==="[object Array]"};var v=function se(t){return f.call(t)==="[object String]"};var g=function fe(t){var e=f.call(t);var r=e==="[object Arguments]";if(!r){r=!h(t)&&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 b(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}function w(t){var e=typeof t;return t===null||e==="undefined"||e==="boolean"||e==="number"||e==="string"}function x(t){var e,r,n;if(w(t)){return t}r=t.valueOf;if(c(r)){e=r.call(t);if(w(e)){return e}}n=t.toString;if(c(n)){e=n.call(t);if(w(e)){return e}}throw new TypeError}var O={ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return Object(t)},ToUint32:function ce(t){return t>>>0}};var T=function pe(){};m(r,{bind:function he(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;var i=function(){if(this instanceof n){var i=e.apply(this,r.concat(a.call(arguments)));if(Object(i)===i){return i}return this}else{return e.apply(t,r.concat(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){T.prototype=e.prototype;n.prototype=new T;T.prototype=null}return n}});var j=s.bind(e.hasOwnProperty);var S=function(){var t=[1,2];var e=t.splice();return t.length===2&&h(e)&&e.length===0}();m(t,{splice:function ve(t,e){if(arguments.length===0){return[]}else{return o.apply(this,arguments)}}},S);var E=function(){var e={};t.splice.call(e,0,0,1);return e.length===1}();m(t,{splice:function ge(t,e){if(arguments.length===0){return[]}var r=arguments;this.length=Math.max(b(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]=b(e)}}return o.apply(this,r)}},!E);var N=[].unshift(0)!==1;m(t,{unshift:function(){l.apply(this,arguments);return this.length}},N);m(Array,{isArray:h});var I=Object("a");var D=I[0]!=="a"||!(0 in I);var M=function ye(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 de(t){var e=O.ToObject(this),r=D&&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)}}}},!M(t.forEach));m(t,{map:function me(t){var e=O.ToObject(this),r=D&&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}},!M(t.map));m(t,{filter:function be(t){var e=O.ToObject(this),r=D&&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 u=0;u<n;u++){if(u in r){a=r[u];if(t.call(o,a,u,e)){i.push(a)}}}return i}},!M(t.filter));m(t,{every:function we(t){var e=O.ToObject(this),r=D&&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}},!M(t.every));m(t,{some:function xe(t){var e=O.ToObject(this),r=D&&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}},!M(t.some));var F=false;if(t.reduce){F=typeof t.reduce.call("es5",function(t,e,r,n){return n})==="object"}m(t,{reduce:function Oe(t){var e=O.ToObject(this),r=D&&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}},!F);var R=false;if(t.reduceRight){R=typeof t.reduceRight.call("es5",function(t,e,r,n){return n})==="object"}m(t,{reduceRight:function Te(t){var e=O.ToObject(this),r=D&&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}},!R);var U=Array.prototype.indexOf&&[0,1].indexOf(1,2)!==-1;m(t,{indexOf:function je(t){var e=D&&v(this)?this.split(""):O.ToObject(this),r=e.length>>>0;if(!r){return-1}var n=0;if(arguments.length>1){n=b(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}},U);var k=Array.prototype.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;m(t,{lastIndexOf:function Se(t){var e=D&&v(this)?this.split(""):O.ToObject(this),r=e.length>>>0;if(!r){return-1}var n=r-1;if(arguments.length>1){n=Math.min(n,b(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}},k);var C=!{toString:null}.propertyIsEnumerable("toString"),A=function(){}.propertyIsEnumerable("prototype"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Z=P.length;m(Object,{keys:function Ee(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=A&&e;if(i||r){for(var u=0;u<t.length;++u){a.push(String(u))}}else{for(var l in t){if(!(o&&l==="prototype")&&j(t,l)){a.push(String(l))}}}if(C){var s=t.constructor,f=s&&s.prototype===t;for(var p=0;p<Z;p++){var h=P[p];if(!(f&&h==="constructor")&&j(t,h)){a.push(h)}}}return a}});var J=Object.keys&&function(){return Object.keys(arguments).length===2}(1,2);var z=Object.keys;m(Object,{keys:function Ne(e){if(g(e)){return z(t.slice.call(e))}else{return z(e)}}},!J);var $=-621987552e5;var B="-000001";var H=Date.prototype.toISOString&&new Date($).toISOString().indexOf(B)===-1;m(Date.prototype,{toISOString:function Ie(){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"}},H);var L=false;try{L=Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date($).toJSON().indexOf(B)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(X){}if(!L){Date.prototype.toJSON=function De(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 Y=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var q=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"));var G=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(!Date.parse||G||q||!Y){Date=function(t){function e(r,n,i,a,o,u,l){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,u,l):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;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 u(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,s=Number(n[4]||0),f=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(s<(f>0||c>0||p>0?24:25)&&f<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+s+g*v)*60;d=((d+f+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)};return e}(Date)}if(!Date.now){Date.now=function Me(){return(new Date).getTime()}}var K=i.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var Q={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function Fe(t,e){var r=-1;while(++r<Q.size){e+=t*Q.data[r];Q.data[r]=e%Q.base;e=Math.floor(e/Q.base)}},divide:function Re(t){var e=Q.size,r=0;while(--e>=0){r+=Q.data[e];Q.data[e]=Math.floor(r/t);r=r%t*Q.base}},numToString:function Ue(){var t=Q.size;var e="";while(--t>=0){if(e!==""||t===0||Q.data[t]!==0){var r=String(Q.data[t]);if(e===""){e=r}else{e+="0000000".slice(0,7-r.length)+r}}}return e},pow:function ke(t,e,r){return e===0?r:e%2===1?ke(t,e-1,r*t):ke(t*t,e/2,r)},log:function Ce(t){var e=0;while(t>=4096){e+=12;t/=4096}while(t>=2){e+=1;t/=2}return e}};m(i,{toFixed:function Ae(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=Q.log(r*Q.pow(2,69,1))-69;o=a<0?r*Q.pow(2,-a,1):r/Q.pow(2,a,1);o*=4503599627370496;a=52-a;if(a>0){Q.multiply(0,o);u=e;while(u>=7){Q.multiply(1e7,0);u-=7}Q.multiply(Q.pow(10,u,1),0);u=a-1;while(u>=23){Q.divide(1<<23);u-=23}Q.divide(1<<u);Q.multiply(1,1);Q.divide(2);i=Q.numToString()}else{Q.multiply(0,o);Q.multiply(1<<-a,0);i=Q.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}},K);var V=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(f.call(e)!=="[object RegExp]"){return V.call(this,e,r)}var i=[],a=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),o=0,l,s,c,p;e=new RegExp(e.source,a+"g");n+="";if(!t){l=new RegExp("^"+e.source+"$(?!\\s)",a)}r=typeof r==="undefined"?-1>>>0:O.ToUint32(r);while(s=e.exec(n)){c=s.index+s[0].length;if(c>o){i.push(n.slice(o,s.index));if(!t&&s.length>1){s[0].replace(l,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){s[t]=void 0}}})}if(s.length>1&&s.index<n.length){u.apply(i,s.slice(1))}p=s[0].length;o=c;if(i.length>=r){break}}if(e.lastIndex===s.index){e.lastIndex++}}if(o===n.length){if(p||!e.test("")){i.push("")}}else{i.push(n.slice(o))}return i.length>r?i.slice(0,r):i}})()}else if("0".split(void 0,0).length){n.split=function Pe(t,e){if(typeof t==="undefined"&&e===0){return[]}return V.call(this,t,e)}}var W=n.replace;var _=function(){var t=[];"x".replace(/x(.)?/g,function(e,r){t.push(r)});return t.length===1&&typeof t[0]==="undefined"}();if(!_){n.replace=function Ze(t,e){var r=c(e);var n=p(t)&&/\)[*?]/.test(t.source);if(!r||!n){return W.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 W.call(this,t,i)}}}var te=n.substr;var ee="".substr&&"0b".substr(-1)!=="b";m(n,{substr:function Je(t,e){return te.call(this,t<0?(t=this.length+t)<0?0:t:t,e)}},ee);var re=" \n\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var ne="\u200b";var ie="["+re+"]";var ae=new RegExp("^"+ie+ie+"*");var oe=new RegExp(ie+ie+"*$");var ue=n.trim&&(re.trim()||!ne.trim());m(n,{trim:function ze(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(ae,"").replace(oe,"")}},ue);if(parseInt(re+"08")!==8||parseInt(re+"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)}}); | ||
(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 s=r.call;var f=e.toString;var c=function(t){return f.call(t)==="[object Function]"};var p=function(t){return f.call(t)==="[object RegExp]"};var h=function ue(t){return f.call(t)==="[object Array]"};var v=function le(t){return f.call(t)==="[object String]"};var g=function se(t){var e=f.call(t);var r=e==="[object Arguments]";if(!r){r=!h(t)&&t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&c(t.callee)}return r};var y=function(t){var e=Object.defineProperty&&function(){try{Object.defineProperty({},"x",{});return true}catch(t){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);function d(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}function m(t){var e=typeof t;return t===null||e==="undefined"||e==="boolean"||e==="number"||e==="string"}function b(t){var e,r,n;if(m(t)){return t}r=t.valueOf;if(c(r)){e=r.call(t);if(m(e)){return e}}n=t.toString;if(c(n)){e=n.call(t);if(m(e)){return e}}throw new TypeError}var w={ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return Object(t)},ToUint32:function fe(t){return t>>>0}};var x=function ce(){};y(r,{bind:function pe(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;var i=function(){if(this instanceof n){var i=e.apply(this,r.concat(a.call(arguments)));if(Object(i)===i){return i}return this}else{return e.apply(t,r.concat(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){x.prototype=e.prototype;n.prototype=new x;x.prototype=null}return n}});var O=s.bind(e.hasOwnProperty);var T=function(){var t=[1,2];var e=t.splice();return t.length===2&&h(e)&&e.length===0}();y(t,{splice:function he(t,e){if(arguments.length===0){return[]}else{return o.apply(this,arguments)}}},!T);var j=function(){var e={};t.splice.call(e,0,0,1);return e.length===1}();y(t,{splice:function ve(t,e){if(arguments.length===0){return[]}var r=arguments;this.length=Math.max(d(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]=d(e)}}return o.apply(this,r)}},!j);var S=[].unshift(0)!==1;y(t,{unshift:function(){l.apply(this,arguments);return this.length}},S);y(Array,{isArray:h});var E=Object("a");var N=E[0]!=="a"||!(0 in E);var I=function ge(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};y(t,{forEach:function ye(t){var e=w.ToObject(this),r=N&&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)}}}},!I(t.forEach));y(t,{map:function de(t){var e=w.ToObject(this),r=N&&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}},!I(t.map));y(t,{filter:function me(t){var e=w.ToObject(this),r=N&&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 u=0;u<n;u++){if(u in r){a=r[u];if(t.call(o,a,u,e)){i.push(a)}}}return i}},!I(t.filter));y(t,{every:function be(t){var e=w.ToObject(this),r=N&&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}},!I(t.every));y(t,{some:function we(t){var e=w.ToObject(this),r=N&&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}},!I(t.some));var D=false;if(t.reduce){D=typeof t.reduce.call("es5",function(t,e,r,n){return n})==="object"}y(t,{reduce:function xe(t){var e=w.ToObject(this),r=N&&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}},!D);var M=false;if(t.reduceRight){M=typeof t.reduceRight.call("es5",function(t,e,r,n){return n})==="object"}y(t,{reduceRight:function Oe(t){var e=w.ToObject(this),r=N&&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}},!M);var F=Array.prototype.indexOf&&[0,1].indexOf(1,2)!==-1;y(t,{indexOf:function Te(t){var e=N&&v(this)?this.split(""):w.ToObject(this),r=e.length>>>0;if(!r){return-1}var n=0;if(arguments.length>1){n=d(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}},F);var R=Array.prototype.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;y(t,{lastIndexOf:function je(t){var e=N&&v(this)?this.split(""):w.ToObject(this),r=e.length>>>0;if(!r){return-1}var n=r-1;if(arguments.length>1){n=Math.min(n,d(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}},R);var U=!{toString:null}.propertyIsEnumerable("toString"),k=function(){}.propertyIsEnumerable("prototype"),C=!O("x","0"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],P=A.length;y(Object,{keys:function Se(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=k&&e;if(i&&C||r){for(var u=0;u<t.length;++u){a.push(String(u))}}if(!r){for(var l in t){if(!(o&&l==="prototype")&&O(t,l)){a.push(String(l))}}}if(U){var s=t.constructor,f=s&&s.prototype===t;for(var p=0;p<P;p++){var h=A[p];if(!(f&&h==="constructor")&&O(t,h)){a.push(h)}}}return a}});var Z=Object.keys&&function(){return Object.keys(arguments).length===2}(1,2);var J=Object.keys;y(Object,{keys:function Ee(e){if(g(e)){return J(t.slice.call(e))}else{return J(e)}}},!Z);var z=-621987552e5;var $="-000001";var B=Date.prototype.toISOString&&new Date(z).toISOString().indexOf($)===-1;y(Date.prototype,{toISOString:function Ne(){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"}},B);var H=false;try{H=Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(z).toJSON().indexOf($)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(L){}if(!H){Date.prototype.toJSON=function Ie(t){var e=Object(this),r=b(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 X=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var Y=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"));var q=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(!Date.parse||q||Y||!X){Date=function(t){function e(r,n,i,a,o,u,l){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,u,l):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;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 u(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,s=Number(n[4]||0),f=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(s<(f>0||c>0||p>0?24:25)&&f<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+s+g*v)*60;d=((d+f+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)};return e}(Date)}if(!Date.now){Date.now=function De(){return(new Date).getTime()}}var G=i.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var K={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function Me(t,e){var r=-1;while(++r<K.size){e+=t*K.data[r];K.data[r]=e%K.base;e=Math.floor(e/K.base)}},divide:function Fe(t){var e=K.size,r=0;while(--e>=0){r+=K.data[e];K.data[e]=Math.floor(r/t);r=r%t*K.base}},numToString:function Re(){var t=K.size;var e="";while(--t>=0){if(e!==""||t===0||K.data[t]!==0){var r=String(K.data[t]);if(e===""){e=r}else{e+="0000000".slice(0,7-r.length)+r}}}return e},pow:function Ue(t,e,r){return e===0?r:e%2===1?Ue(t,e-1,r*t):Ue(t*t,e/2,r)},log:function ke(t){var e=0;while(t>=4096){e+=12;t/=4096}while(t>=2){e+=1;t/=2}return e}};y(i,{toFixed:function Ce(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=K.log(r*K.pow(2,69,1))-69;o=a<0?r*K.pow(2,-a,1):r/K.pow(2,a,1);o*=4503599627370496;a=52-a;if(a>0){K.multiply(0,o);u=e;while(u>=7){K.multiply(1e7,0);u-=7}K.multiply(K.pow(10,u,1),0);u=a-1;while(u>=23){K.divide(1<<23);u-=23}K.divide(1<<u);K.multiply(1,1);K.divide(2);i=K.numToString()}else{K.multiply(0,o);K.multiply(1<<-a,0);i=K.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}},G);var Q=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(f.call(e)!=="[object RegExp]"){return Q.call(this,e,r)}var i=[],a=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),o=0,l,s,c,p;e=new RegExp(e.source,a+"g");n+="";if(!t){l=new RegExp("^"+e.source+"$(?!\\s)",a)}r=typeof r==="undefined"?-1>>>0:w.ToUint32(r);s=e.exec(n);while(s){c=s.index+s[0].length;if(c>o){i.push(n.slice(o,s.index));if(!t&&s.length>1){s[0].replace(l,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){s[t]=void 0}}})}if(s.length>1&&s.index<n.length){u.apply(i,s.slice(1))}p=s[0].length;o=c;if(i.length>=r){break}}if(e.lastIndex===s.index){e.lastIndex++}s=e.exec(n)}if(o===n.length){if(p||!e.test("")){i.push("")}}else{i.push(n.slice(o))}return i.length>r?i.slice(0,r):i}})()}else if("0".split(void 0,0).length){n.split=function Ae(t,e){if(typeof t==="undefined"&&e===0){return[]}return Q.call(this,t,e)}}var V=n.replace;var W=function(){var t=[];"x".replace(/x(.)?/g,function(e,r){t.push(r)});return t.length===1&&typeof t[0]==="undefined"}();if(!W){n.replace=function Pe(t,e){var r=c(e);var n=p(t)&&/\)[*?]/.test(t.source);if(!r||!n){return V.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 V.call(this,t,i)}}}var _=n.substr;var te="".substr&&"0b".substr(-1)!=="b";y(n,{substr:function Ze(t,e){return _.call(this,t<0?(t=this.length+t)<0?0:t:t,e)}},te);var ee=" \n\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var re="\u200b";var ne="["+ee+"]";var ie=new RegExp("^"+ne+ne+"*");var ae=new RegExp(ne+ne+"*$");var oe=n.trim&&(ee.trim()||!re.trim());y(n,{trim:function Je(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(ie,"").replace(ae,"")}},oe);if(parseInt(ee+"08")!==8||parseInt(ee+"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": "4.0.5", | ||
"version": "4.0.6", | ||
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", | ||
@@ -35,8 +35,11 @@ "homepage": "http://github.com/es-shims/es5-shim/", | ||
"test-native": "jasmine-node --matchall tests/spec/", | ||
"lint": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js" | ||
"lint": "npm run jscs && npm run eslint", | ||
"eslint": "eslint --reset tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js", | ||
"jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js" | ||
}, | ||
"devDependencies": { | ||
"eslint": "~0.12.0", | ||
"jasmine-node": "~1.14.5", | ||
"jscs": "~1.8.0", | ||
"uglify-js": "~2.4.15" | ||
"jscs": "~1.10.0", | ||
"uglify-js": "~2.4.16" | ||
}, | ||
@@ -43,0 +46,0 @@ "engines": { |
@@ -69,3 +69,3 @@ #es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup> | ||
:warning: The second argument is passed to Object.defineProperties | ||
which will probably fail either silently or with extreme predudice. | ||
which will probably fail either silently or with extreme prejudice. | ||
@@ -136,3 +136,3 @@ * :warning: Object.getPrototypeOf | ||
This uses the Object.defineProperty shim | ||
This uses the Object.defineProperty shim. | ||
@@ -139,0 +139,0 @@ * Object.seal |
@@ -0,18 +1,21 @@ | ||
/*global beforeEach, expect */ | ||
var has = Object.prototype.hasOwnProperty; | ||
var getKeys = function (o) { | ||
var key, a = []; | ||
for (key in o) { | ||
if (has.call(o, key)) { | ||
a.push(key); | ||
} | ||
} | ||
return a; | ||
}; | ||
beforeEach(function () { | ||
'use strict'; | ||
this.addMatchers({ | ||
toExactlyMatch: function (expected) { | ||
var a1, a2, | ||
l, i, | ||
key, | ||
actual = this.actual; | ||
var a1, a2, l, i, key; | ||
var actual = this.actual; | ||
var getKeys = function (o) { | ||
var key, a = []; | ||
for (key in o) { | ||
if (o.hasOwnProperty(key)) { | ||
a.push(key); | ||
} | ||
} | ||
return a; | ||
}; | ||
a1 = getKeys(actual); | ||
@@ -35,2 +38,1 @@ a2 = getKeys(expected); | ||
}); | ||
@@ -0,2 +1,2 @@ | ||
/*globals require */ | ||
require('../helpers/h-matchers'); | ||
@@ -1,3 +0,5 @@ | ||
var toString = Object.prototype.toString; | ||
var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false. | ||
/*global describe, it, expect, beforeEach, jasmine, xit */ | ||
var toStr = Object.prototype.toString; | ||
// var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false. | ||
var hasStrictMode = (function () { | ||
@@ -37,3 +39,3 @@ 'use strict'; | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = [1,2,3], | ||
var arr = [1, 2, 3], | ||
i = 0; | ||
@@ -44,3 +46,3 @@ arr.forEach(function (a) { | ||
}); | ||
expect(arr).toEqual([1,2,3,4,5,6]); | ||
expect(arr).toEqual([1, 2, 3, 4, 5, 6]); | ||
expect(i).toBe(3); | ||
@@ -105,17 +107,17 @@ }); | ||
it('should have a boxed object as list argument of callback', function () { | ||
var actual; | ||
var listArg; | ||
Array.prototype.forEach.call('foo', function (item, index, list) { | ||
actual = list; | ||
listArg = list; | ||
}); | ||
expect(typeof actual).toBe('object'); | ||
expect(toString.call(actual)).toBe('[object String]'); | ||
expect(typeof listArg).toBe('object'); | ||
expect(toStr.call(listArg)).toBe('[object String]'); | ||
}); | ||
if (hasStrictMode) { | ||
it('does not autobox the content in strict mode', function () { | ||
var actual; | ||
var context; | ||
[1].forEach(function () { | ||
'use strict'; | ||
actual = this; | ||
context = this; | ||
}, 'x'); | ||
expect(typeof actual).toBe('string'); | ||
expect(typeof context).toBe('string'); | ||
}); | ||
@@ -140,3 +142,3 @@ } | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = [1,2,3], | ||
var arr = [1, 2, 3], | ||
i = 0; | ||
@@ -148,3 +150,3 @@ arr.some(function (a) { | ||
}); | ||
expect(arr).toEqual([1,2,3,4,5,6]); | ||
expect(arr).toEqual([1, 2, 3, 4, 5, 6]); | ||
expect(i).toBe(3); | ||
@@ -209,8 +211,8 @@ }); | ||
it('should have a boxed object as list argument of callback', function () { | ||
var actual; | ||
var listArg; | ||
Array.prototype.some.call('foo', function (item, index, list) { | ||
actual = list; | ||
listArg = list; | ||
}); | ||
expect(typeof actual).toBe('object'); | ||
expect(toString.call(actual)).toBe('[object String]'); | ||
expect(typeof listArg).toBe('object'); | ||
expect(toStr.call(listArg)).toBe('[object String]'); | ||
}); | ||
@@ -234,3 +236,3 @@ }); | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = [1,2,3], | ||
var arr = [1, 2, 3], | ||
i = 0; | ||
@@ -242,3 +244,3 @@ arr.every(function (a) { | ||
}); | ||
expect(arr).toEqual([1,2,3,4,5,6]); | ||
expect(arr).toEqual([1, 2, 3, 4, 5, 6]); | ||
expect(i).toBe(3); | ||
@@ -260,7 +262,7 @@ }); | ||
it('should return true if it runs to the end', function () { | ||
actual = [1,2,3].every(function () { return true; }); | ||
actual = [1, 2, 3].every(function () { return true; }); | ||
expect(actual).toBeTruthy(); | ||
}); | ||
it('should return false if it is stopped before the end', function () { | ||
actual = [1,2,3].every(function () { return false; }); | ||
actual = [1, 2, 3].every(function () { return false; }); | ||
expect(actual).toBeFalsy(); | ||
@@ -307,8 +309,8 @@ }); | ||
it('should have a boxed object as list argument of callback', function () { | ||
var actual; | ||
var listArg; | ||
Array.prototype.every.call('foo', function (item, index, list) { | ||
actual = list; | ||
listArg = list; | ||
}); | ||
expect(typeof actual).toBe('object'); | ||
expect(toString.call(actual)).toBe('[object String]'); | ||
expect(typeof listArg).toBe('object'); | ||
expect(toStr.call(listArg)).toBe('[object String]'); | ||
}); | ||
@@ -319,3 +321,3 @@ }); | ||
'use strict'; | ||
var actual, expected, testSubject; | ||
var actual, expected; | ||
@@ -377,3 +379,3 @@ beforeEach(function () { | ||
testSubject = [2, 3, undefined, true, 'hej', null, 2, false, 0]; | ||
testSubject.forEach(function (o,i) { | ||
testSubject.forEach(function (o, i) { | ||
testAL[i] = o; | ||
@@ -429,3 +431,3 @@ }); | ||
'use strict'; | ||
var actual, expected, testSubject, testAL; | ||
var actual, expected; | ||
@@ -487,3 +489,3 @@ beforeEach(function () { | ||
testAL = {}; | ||
testSubject.forEach(function (o,i) { | ||
testSubject.forEach(function (o, i) { | ||
testAL[i] = o; | ||
@@ -540,3 +542,3 @@ }); | ||
var filteredArray, | ||
callback = function callback(o, i, arr) { | ||
callback = function callback(o, i) { | ||
return i !== 3 && i !== 5; | ||
@@ -553,10 +555,10 @@ }; | ||
it('should call the callback with the proper arguments', function () { | ||
var callback = jasmine.createSpy('callback'), | ||
arr = ['1']; | ||
arr.filter(callback); | ||
expect(callback).toHaveBeenCalledWith('1', 0, arr); | ||
var predicate = jasmine.createSpy('predicate'); | ||
var arr = ['1']; | ||
arr.filter(predicate); | ||
expect(predicate).toHaveBeenCalledWith('1', 0, arr); | ||
}); | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = [1,2,3], | ||
i = 0; | ||
var arr = [1, 2, 3]; | ||
var i = 0; | ||
arr.filter(function (a) { | ||
@@ -569,3 +571,3 @@ i++; | ||
}); | ||
expect(arr).toEqual([1,2,3,4,5,6]); | ||
expect(arr).toEqual([1, 2, 3, 4, 5, 6]); | ||
expect(i).toBe(3); | ||
@@ -575,3 +577,3 @@ }); | ||
var passedValues = {}; | ||
testSubject = [1,2,3,4]; | ||
testSubject = [1, 2, 3, 4]; | ||
delete testSubject[1]; | ||
@@ -586,3 +588,3 @@ testSubject.filter(function (o, i) { | ||
var passedValues = {}; | ||
testSubject = [1,2,3,4]; | ||
testSubject = [1, 2, 3, 4]; | ||
delete testSubject[1]; | ||
@@ -621,10 +623,10 @@ testSubject.filter(function (o, i) { | ||
}); | ||
it('should call the callback with the proper arguments', function () { | ||
var callback = jasmine.createSpy('callback'), | ||
arr = createArrayLikeFromArray(['1']); | ||
Array.prototype.filter.call(arr, callback); | ||
expect(callback).toHaveBeenCalledWith('1', 0, arr); | ||
it('should call the predicate with the proper arguments', function () { | ||
var predicate = jasmine.createSpy('predicate'); | ||
var arr = createArrayLikeFromArray(['1']); | ||
Array.prototype.filter.call(arr, predicate); | ||
expect(predicate).toHaveBeenCalledWith('1', 0, arr); | ||
}); | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = createArrayLikeFromArray([1,2,3]), | ||
var arr = createArrayLikeFromArray([1, 2, 3]), | ||
i = 0; | ||
@@ -639,3 +641,3 @@ Array.prototype.filter.call(arr, function (a) { | ||
delete arr.length; | ||
expect(arr).toExactlyMatch([1,2,3,4,5,6]); | ||
expect(arr).toExactlyMatch([1, 2, 3, 4, 5, 6]); | ||
expect(i).toBe(3); | ||
@@ -645,3 +647,3 @@ }); | ||
var passedValues = {}; | ||
testSubject = createArrayLikeFromArray([1,2,3,4]); | ||
testSubject = createArrayLikeFromArray([1, 2, 3, 4]); | ||
delete testSubject[1]; | ||
@@ -662,3 +664,3 @@ Array.prototype.filter.call(testSubject, function (o, i) { | ||
var passedValues = {}; | ||
testSubject = createArrayLikeFromArray([1,2,3,4]); | ||
testSubject = createArrayLikeFromArray([1, 2, 3, 4]); | ||
delete testSubject[1]; | ||
@@ -688,3 +690,3 @@ Array.prototype.filter.call(testSubject, function (o, i) { | ||
expect(typeof actual).toBe('object'); | ||
expect(toString.call(actual)).toBe('[object String]'); | ||
expect(toStr.call(actual)).toBe('[object String]'); | ||
}); | ||
@@ -701,11 +703,11 @@ }); | ||
describe('Array object', function () { | ||
it('should call callback with the right parameters', function () { | ||
var callback = jasmine.createSpy('callback'), | ||
array = [1]; | ||
array.map(callback); | ||
expect(callback).toHaveBeenCalledWith(1, 0, array); | ||
it('should call mapper with the right parameters', function () { | ||
var mapper = jasmine.createSpy('mapper'); | ||
var array = [1]; | ||
array.map(mapper); | ||
expect(mapper).toHaveBeenCalledWith(1, 0, array); | ||
}); | ||
it('should set the context correctly', function () { | ||
var context = {}; | ||
testSubject.map(function (o,i) { | ||
testSubject.map(function (o, i) { | ||
this[i] = o; | ||
@@ -717,3 +719,3 @@ }, context); | ||
var context; | ||
[1].map(function () {context = this;}); | ||
[1].map(function () { context = this; }); | ||
expect(context).toBe(function () { return this; }.call()); | ||
@@ -727,3 +729,3 @@ }); | ||
it('should only run for the number of objects in the array when it started', function () { | ||
var arr = [1,2,3], | ||
var arr = [1, 2, 3], | ||
i = 0; | ||
@@ -758,11 +760,11 @@ arr.map(function (o) { | ||
}); | ||
it('should call callback with the right parameters', function () { | ||
var callback = jasmine.createSpy('callback'), | ||
array = createArrayLikeFromArray([1]); | ||
Array.prototype.map.call(array, callback); | ||
expect(callback).toHaveBeenCalledWith(1, 0, array); | ||
it('should call mapper with the right parameters', function () { | ||
var mapper = jasmine.createSpy('mapper'); | ||
var array = createArrayLikeFromArray([1]); | ||
Array.prototype.map.call(array, mapper); | ||
expect(mapper).toHaveBeenCalledWith(1, 0, array); | ||
}); | ||
it('should set the context correctly', function () { | ||
var context = {}; | ||
Array.prototype.map.call(testSubject, function (o,i) { | ||
Array.prototype.map.call(testSubject, function (o, i) { | ||
this[i] = o; | ||
@@ -792,3 +794,3 @@ }, context); | ||
delete arr.length; | ||
expect(arr).toExactlyMatch([1,2,3,4,5,6]); | ||
expect(arr).toExactlyMatch([1, 2, 3, 4, 5, 6]); | ||
expect(i).toBe(3); | ||
@@ -798,3 +800,3 @@ }); | ||
var result = Array.prototype.map.call(testSubject, callback), | ||
expected = [0,0,1,2,3,4,5,6]; | ||
expected = [0, 0, 1, 2, 3, 4, 5, 6]; | ||
delete expected[1]; | ||
@@ -804,3 +806,3 @@ expect(result).toExactlyMatch(expected); | ||
it('should skip non-existing values', function () { | ||
var array = createArrayLikeFromArray([1,2,3,4]), | ||
var array = createArrayLikeFromArray([1, 2, 3, 4]), | ||
i = 0; | ||
@@ -820,3 +822,3 @@ delete array[2]; | ||
expect(typeof actual).toBe('object'); | ||
expect(toString.call(actual)).toBe('[object String]'); | ||
expect(toStr.call(actual)).toBe('[object String]'); | ||
}); | ||
@@ -827,3 +829,3 @@ }); | ||
beforeEach(function () { | ||
testSubject = [1,2,3]; | ||
testSubject = [1, 2, 3]; | ||
}); | ||
@@ -843,3 +845,3 @@ | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = [1,2,3], | ||
var arr = [1, 2, 3], | ||
i = 0; | ||
@@ -853,3 +855,3 @@ arr.reduce(function (a, b) { | ||
}); | ||
expect(arr).toEqual([1,2,3,4,5]); | ||
expect(arr).toEqual([1, 2, 3, 4, 5]); | ||
expect(i).toBe(2); | ||
@@ -912,3 +914,3 @@ }); | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = createArrayLikeFromArray([1,2,3]), | ||
var arr = createArrayLikeFromArray([1, 2, 3]), | ||
i = 0; | ||
@@ -954,3 +956,3 @@ Array.prototype.reduce.call(arr, function (a, b) { | ||
}); | ||
delete(testSubject.reduce); | ||
delete testSubject.reduce; | ||
expect(testSubject).toEqual(copy); | ||
@@ -979,3 +981,3 @@ }); | ||
expect(typeof actual).toBe('object'); | ||
expect(toString.call(actual)).toBe('[object String]'); | ||
expect(toStr.call(actual)).toBe('[object String]'); | ||
}); | ||
@@ -985,3 +987,3 @@ }); | ||
beforeEach(function () { | ||
testSubject = [1,2,3]; | ||
testSubject = [1, 2, 3]; | ||
}); | ||
@@ -1001,3 +1003,3 @@ | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = [1,2,3], | ||
var arr = [1, 2, 3], | ||
i = 0; | ||
@@ -1011,3 +1013,3 @@ arr.reduceRight(function (a, b) { | ||
}); | ||
expect(arr).toEqual([1,2,3,6,5]); | ||
expect(arr).toEqual([1, 2, 3, 6, 5]); | ||
expect(i).toBe(2); | ||
@@ -1078,3 +1080,3 @@ }); | ||
it('should not affect elements added to the array after it has begun', function () { | ||
var arr = createArrayLikeFromArray([1,2,3]), | ||
var arr = createArrayLikeFromArray([1, 2, 3]), | ||
i = 0; | ||
@@ -1101,3 +1103,3 @@ Array.prototype.reduceRight.call(arr, function (a, b) { | ||
expect(function () { | ||
Array.prototype.reduceRight.call({length:0}, spy); | ||
Array.prototype.reduceRight.call({ length: 0 }, spy); | ||
}).toThrow(); | ||
@@ -1121,3 +1123,3 @@ expect(spy).not.toHaveBeenCalled(); | ||
}); | ||
delete(testSubject.reduceRight); | ||
delete testSubject.reduceRight; | ||
expect(testSubject).toEqual(copy); | ||
@@ -1146,3 +1148,3 @@ }); | ||
expect(typeof actual).toBe('object'); | ||
expect(toString.call(actual)).toBe('[object String]'); | ||
expect(toStr.call(actual)).toBe('[object String]'); | ||
}); | ||
@@ -1188,2 +1190,3 @@ }); | ||
/*globals document */ | ||
if (typeof document !== 'undefined') { | ||
@@ -1204,13 +1207,13 @@ it('should be false for an HTML element', function () { | ||
describe('splice', function () { | ||
var b = ['b'], | ||
a = [1, 'a', b], | ||
test; | ||
var b = ['b']; | ||
var a = [1, 'a', b]; | ||
var test; | ||
var makeArray = function (l, prefix) { | ||
prefix = prefix || ''; | ||
var a = []; | ||
var arr = []; | ||
while (l--) { | ||
a.unshift(prefix + Array(l + 1).join(' ') + l); | ||
arr.unshift(prefix + Array(l + 1).join(' ') + l); | ||
} | ||
return a; | ||
return arr; | ||
}; | ||
@@ -1293,3 +1296,3 @@ | ||
array.pop(); | ||
array.splice(3, 1, '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', 1, 23, 4, 5, 6, 7, 8); | ||
array.splice(3, 1, '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', 1, 23, 4, 5, 6, 7, 8); | ||
array.splice(4, 5, 'P', 'LLL', 'CCC', 'YYY', 'XXX'); | ||
@@ -1296,0 +1299,0 @@ |
@@ -0,2 +1,5 @@ | ||
/*global describe, it, expect, beforeEach */ | ||
describe('Date', function () { | ||
'use strict'; | ||
@@ -3,0 +6,0 @@ describe('now', function () { |
@@ -0,1 +1,3 @@ | ||
/*global describe, it, expect, beforeEach */ | ||
describe('Function', function () { | ||
@@ -8,6 +10,5 @@ 'use strict'; | ||
var expectedArray = [1, undefined, 4, true]; | ||
var actualArray; | ||
(function () { | ||
actualArray = Array.prototype.slice.apply(arguments); | ||
}).apply(null, arrayLike); | ||
var actualArray = (function () { | ||
return Array.prototype.slice.apply(arguments); | ||
}.apply(null, arrayLike)); | ||
expect(actualArray).toEqual(expectedArray); | ||
@@ -18,3 +19,3 @@ }); | ||
describe('bind', function () { | ||
var actual, expected; | ||
var actual; | ||
@@ -52,5 +53,5 @@ var testSubject = { | ||
context = this; | ||
}.bind(undefined, 1,2,3); | ||
testSubject.func(1,2,3); | ||
expect(a).toEqual([1,2,3,1,2,3]); | ||
}.bind(undefined, 1, 2, 3); | ||
testSubject.func(1, 2, 3); | ||
expect(a).toEqual([1, 2, 3, 1, 2, 3]); | ||
expect(context).toBe(function () { return this; }.call()); | ||
@@ -60,10 +61,10 @@ }); | ||
testSubject.func = func.bind(actual); | ||
testSubject.func(1,2,3); | ||
expect(actual).toEqual([1,2,3]); | ||
testSubject.func(1, 2, 3); | ||
expect(actual).toEqual([1, 2, 3]); | ||
expect(testSubject.a).toEqual([]); | ||
}); | ||
it('binds a context and supplies bound arguments', function () { | ||
testSubject.func = func.bind(actual, 1,2,3); | ||
testSubject.func(4,5,6); | ||
expect(actual).toEqual([1,2,3,4,5,6]); | ||
testSubject.func = func.bind(actual, 1, 2, 3); | ||
testSubject.func(4, 5, 6); | ||
expect(actual).toEqual([1, 2, 3, 4, 5, 6]); | ||
expect(testSubject.a).toEqual([]); | ||
@@ -84,6 +85,6 @@ }); | ||
return Array.prototype.slice.call(arguments); | ||
}.bind(undefined, 1,2,3); | ||
actual = testSubject.func(1,2,3); | ||
}.bind(undefined, 1, 2, 3); | ||
actual = testSubject.func(1, 2, 3); | ||
expect(context).toBe(function () { return this; }.call()); | ||
expect(actual).toEqual([1,2,3,1,2,3]); | ||
expect(actual).toEqual([1, 2, 3, 1, 2, 3]); | ||
}); | ||
@@ -93,3 +94,3 @@ it('returns properly while binding a context properly', function () { | ||
testSubject.func = func.bind(actual); | ||
ret = testSubject.func(1,2,3); | ||
ret = testSubject.func(1, 2, 3); | ||
expect(ret).toBe(actual); | ||
@@ -100,4 +101,4 @@ expect(ret).not.toBe(testSubject); | ||
var ret; | ||
testSubject.func = func.bind(actual, 1,2,3); | ||
ret = testSubject.func(4,5,6); | ||
testSubject.func = func.bind(actual, 1, 2, 3); | ||
ret = testSubject.func(4, 5, 6); | ||
expect(ret).toBe(actual); | ||
@@ -113,10 +114,12 @@ expect(ret).not.toBe(testSubject); | ||
var result = new testSubject.func(); | ||
expect(result).toBeTruthy(); | ||
expect(actualContext).not.toBe(expectedContext); | ||
}); | ||
it('passes the correct arguments as a constructor', function () { | ||
var ret, expected = { name: 'Correct' }; | ||
var expected = { name: 'Correct' }; | ||
testSubject.func = function (arg) { | ||
expect(this.hasOwnProperty('name')).toBe(false); | ||
return arg; | ||
}.bind({ name: 'Incorrect' }); | ||
ret = new testSubject.func(expected); | ||
var ret = new testSubject.func(expected); | ||
expect(ret).toBe(expected); | ||
@@ -127,2 +130,3 @@ }); | ||
var Subject = function () { | ||
expect(this).not.toBe(oracle); | ||
return oracle; | ||
@@ -136,2 +140,3 @@ }.bind(null); | ||
var Subject = function () { | ||
expect(this).not.toBe(oracle); | ||
return oracle; | ||
@@ -181,7 +186,7 @@ }.bind(null); | ||
it('sets a correct length with thisArg', function () { | ||
var Subject = function (a, b, c) { return a + b + c; }.bind({}); | ||
var Subject = function (a, b, c) { return a + b + c + this.d; }.bind({ d: 1 }); | ||
expect(Subject.length).toBe(3); | ||
}); | ||
it('sets a correct length with thisArg and first argument', function () { | ||
var Subject = function (a, b, c) { return a + b + c; }.bind({}, 1); | ||
var Subject = function (a, b, c) { return a + b + c + this.d; }.bind({ d: 1 }, 1); | ||
expect(Subject.length).toBe(2); | ||
@@ -188,0 +193,0 @@ }); |
@@ -0,1 +1,3 @@ | ||
/*global describe, it, expect */ | ||
describe('global methods', function () { | ||
@@ -46,2 +48,1 @@ 'use strict'; | ||
}); | ||
@@ -0,1 +1,3 @@ | ||
/*global describe, it, expect */ | ||
describe('Number', function () { | ||
@@ -2,0 +4,0 @@ 'use strict'; |
@@ -0,1 +1,3 @@ | ||
/*global describe, it, expect, beforeEach */ | ||
describe('Object', function () { | ||
@@ -60,10 +62,11 @@ 'use strict'; | ||
expect(loopedValues.indexOf(name)).toNotBe(-1); | ||
}) | ||
}); | ||
}); | ||
it('should throw error for non object', function () { | ||
// ES6 Object.keys does not require this throw | ||
xit('should throw error for non object', function () { | ||
var e = {}; | ||
expect(function () { | ||
try { | ||
Object.keys(42) | ||
Object.keys(42); | ||
} catch (err) { | ||
@@ -91,3 +94,2 @@ throw e; | ||
it('works with boxed primitives', function () { | ||
expect(Object.keys(new String('hello'))).toEqual(['0', '1', '2', '3', '4']); | ||
expect(Object.keys(Object('hello'))).toEqual(['0', '1', '2', '3', '4']); | ||
@@ -97,3 +99,3 @@ }); | ||
it('works with boxed primitives with extra properties', function () { | ||
var x = new String('x'); | ||
var x = Object('x'); | ||
x.y = 1; | ||
@@ -131,3 +133,3 @@ var actual = Object.keys(x); | ||
try { | ||
Object.isExtensible(42) | ||
Object.isExtensible(42); | ||
} catch (err) { | ||
@@ -193,3 +195,3 @@ throw e1; | ||
expect(descr).toBeUndefined() | ||
expect(descr).toBeUndefined(); | ||
}); | ||
@@ -210,3 +212,3 @@ | ||
expect(descr).toBeUndefined() | ||
expect(descr).toBeUndefined(); | ||
}); | ||
@@ -213,0 +215,0 @@ |
@@ -0,1 +1,3 @@ | ||
/*global describe, it, expect */ | ||
describe('String', function () { | ||
@@ -20,3 +22,3 @@ 'use strict'; | ||
var groups = []; | ||
'x'.replace(/x(.)?/g,function (m, group) { | ||
'x'.replace(/x(.)?/g, function (m, group) { | ||
groups.push(group); /* "" in FF, `undefined` in CH/WK/IE */ | ||
@@ -23,0 +25,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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
339685
6904
4