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

es5-shim

Package Overview
Dependencies
Maintainers
2
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es5-shim - npm Package Compare versions

Comparing version 1.2.6 to 1.2.7

32

es5-shim.js

@@ -59,3 +59,3 @@ // vim:set ts=4 sts=4 sw=4 st:

var slice = Array.prototype.slice;
Function.prototype.bind = function bind(that) { // .length is 1
Function.prototype.bind = function bind() { // .length is 1
// 1. Let Target be the this value.

@@ -70,3 +70,5 @@ var target = this;

// argument values provided after thisArg (arg1, arg2 etc), in order.
var args = slice.call(arguments);
// XXX slicedArgs will stand in for "A" if used
var args = slice.call(arguments); // for normal call
var slicedArgs; // memoize later if used as constructor
// 4. Let F be a new native ECMAScript object.

@@ -101,3 +103,8 @@ // 9. Set the [[Prototype]] internal property of F to the standard

var self = Object.create(target.prototype);
return target.apply(self, args.concat(slice.call(arguments))) || self;
if (!slicedArgs) // memoize slice
slicedArgs = args.slice(1);
return target.apply(
self,
slicedArgs.concat(slice.call(arguments))
) || self;

@@ -131,17 +138,6 @@ } else {

}
// XXX this will have no effect if length is not writable.
// It will throw an exception if this is strict mode.
try {
bound.length = (
// 14. If the [[Class]] internal property of Target is "Function", then
typeof target == "function" ?
// a. Let L be the length property of Target minus the length of A.
// b. Set the length own property of F to either 0 or L, whichever is larger.
Math.max(target.length - args.length, 0) :
// 15. Else set the length own property of F to 0.
0
);
} catch (exception) {
}
};
// XXX bound.length is never writable, so don't even try
//
// 16. The length own property of F is given attributes as specified in

@@ -148,0 +144,0 @@ // 15.3.5.1.

@@ -1,16 +0,16 @@

(function(m){typeof define=="function"?define(function(){m()}):m()})(function(m){function k(c){return c<10?"0"+c:c}if(!Function.prototype.bind){var o=Array.prototype.slice;Function.prototype.bind=function(c){var b=this;if(typeof b.apply!="function"||typeof b.call!="function")return new TypeError;var a=o.call(arguments),d=function(){if(this instanceof d){var c=Object.create(b.prototype);return b.apply(c,a.concat(o.call(arguments)))||c}else return b.call.apply(b,a.concat(o.call(arguments)))};try{d.length=
typeof b=="function"?Math.max(b.length-a.length,0):0}catch(e){}return d}}var f=Function.prototype.call,g=Object.prototype,h=f.bind(g.hasOwnProperty),s,t,p,q,n;if(n=h(g,"__defineGetter__"))s=f.bind(g.__defineGetter__),t=f.bind(g.__defineSetter__),p=f.bind(g.__lookupGetter__),q=f.bind(g.__lookupSetter__);if(!Array.isArray)Array.isArray=function(c){return Object.prototype.toString.call(c)=="[object Array]"};if(!Array.prototype.forEach)Array.prototype.forEach=function(c,b){var a=Object(this),d=0,e=a.length>>>
0;if(!c||!c.call)throw new TypeError;for(;d<e;)d in a&&c.call(b,a[d],d,a),d++};if(!Array.prototype.map)Array.prototype.map=function(c,b){var a=Object(this),d=a.length>>>0;if(typeof c!="function")throw new TypeError;for(var e=Array(d),j=0;j<d;j++)j in a&&(e[j]=c.call(b,a[j],j,a));return e};if(!Array.prototype.filter)Array.prototype.filter=function(c,b){for(var a=Object(this),d=a.length>>>0,e=0;e<d;e++)e in a&&c.call(b,a[e],e,a)&&values.push(a[e]);return values};if(!Array.prototype.every)Array.prototype.every=
function(c,b){if(this===void 0||this===null)throw new TypeError;if(typeof c!=="function")throw new TypeError;for(var a=Object(this),d=a.length>>>0,e=0;e<d;e++)if(e in a&&!c.call(b,a[e],e,a))return!1;return!0};if(!Array.prototype.some)Array.prototype.some=function(c,b){if(this===void 0||this===null)throw new TypeError;if(typeof c!=="function")throw new TypeError;for(var a=Object(this),d=a.length>>>0,e=0;e<d;e++)if(e in a&&c.call(b,a[e],e,a))return!0;return!1};if(!Array.prototype.reduce)Array.prototype.reduce=
function(c){var b=Object(this),a=b.length>>>0;if(Object.prototype.toString.call(c)!="[object Function]")throw new TypeError;if(!a&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else{do{if(d in b){e=b[d++];break}if(++d>=a)throw new TypeError;}while(1)}for(;d<a;d++)d in b&&(e=c.call(null,e,b[d],d,b));return e};if(!Array.prototype.reduceRight)Array.prototype.reduceRight=function(c){var b=Object(this),a=b.length>>>0;if(Object.prototype.toString.call(c)!="[object Function]")throw new TypeError;
if(!a&&arguments.length==1)throw new TypeError;var d;a-=1;if(arguments.length>=2)d=arguments[1];else{do{if(a in b){d=b[a--];break}if(--a<0)throw new TypeError;}while(1)}do a in this&&(d=c.call(null,d,b[a],a,b));while(a--);return d};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(c){if(this===void 0||this===null)throw new TypeError;var b=Object(this),a=b.length>>>0;if(!a)return-1;var d=0;arguments.length>0&&(d=u(arguments[1]));for(d=d>=0?d:Math.max(a-Math.abs(d),0);d<a;d++)if(d in b&&
b[d]===c)return d;return-1};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(c){if(this===void 0||this===null)throw new TypeError;var b=Object(this),a=b.length>>>0;if(!a)return-1;var d=a-1;arguments.length>0&&(d=u(arguments[1]));for(d=d>=0?d:Math.max(a-Math.abs(d),0);d>=0;d--)if(d in b&&c===b[d])return d;return-1};if(!Object.getPrototypeOf)Object.getPrototypeOf=function(c){return c.__proto__||c.constructor.prototype};if(!Object.getOwnPropertyDescriptor)Object.getOwnPropertyDescriptor=
function(c,b){if(typeof c!="object"&&typeof c!="function"||c===null)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+c);if(!h(c,b))return m;var a,d,e;a={enumerable:!0,configurable:!0};if(n){var j=c.__proto__;c.__proto__=g;d=p(c,b);e=q(c,b);c.__proto__=j;if(d||e){if(d)a.get=d;if(e)a.set=e;return a}}a.value=c[b];return a};if(!Object.getOwnPropertyNames)Object.getOwnPropertyNames=function(c){return Object.keys(c)};if(!Object.create)Object.create=function(c,b){var a;if(c===
null)a={__proto__:null};else{if(typeof c!="object")throw new TypeError("typeof prototype["+typeof c+"] != 'object'");a=function(){};a.prototype=c;a=new a;a.__proto__=c}typeof b!="undefined"&&Object.defineProperties(a,b);return a};var r=Object.defineProperty;if(f=!!r)f={},Object.defineProperty(f,"",{}),f=""in f;if(!f)Object.defineProperty=function(c,b,a){if(typeof c!="object"&&typeof c!="function")throw new TypeError("Object.defineProperty called on non-object: "+c);if(typeof a!="object"||a===null)throw new TypeError("Property description must be an object: "+
a);if(r&&c.nodeType)return r(c,b,a);if(h(a,"value"))if(n&&(p(c,b)||q(c,b))){var d=c.__proto__;c.__proto__=g;delete c[b];c[b]=a.value;c.__proto__=d}else c[b]=a.value;else{if(!n)throw new TypeError("getters & setters can not be defined on this javascript engine");h(a,"get")&&s(c,b,a.get);h(a,"set")&&t(c,b,a.set)}return c};if(!Object.defineProperties)Object.defineProperties=function(c,b){for(var a in b)h(b,a)&&Object.defineProperty(c,a,b[a]);return c};if(!Object.seal)Object.seal=function(c){return c};
if(!Object.freeze)Object.freeze=function(c){return c};try{Object.freeze(function(){})}catch(B){Object.freeze=function(c){return function(b){return typeof b=="function"?b:c(b)}}(Object.freeze)}if(!Object.preventExtensions)Object.preventExtensions=function(c){return c};if(!Object.isSealed)Object.isSealed=function(){return!1};if(!Object.isFrozen)Object.isFrozen=function(){return!1};if(!Object.isExtensible)Object.isExtensible=function(){return!0};if(!Object.keys){var v=!0,w="toString,toLocaleString,valueOf,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,constructor".split(","),
x=w.length,y;for(y in{toString:null})v=!1;Object.keys=function b(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var b=[],d;for(d in a)h(a,d)&&b.push(d);if(v)for(d=0;d<x;d++){var e=w[d];h(a,e)&&b.push(e)}return b}}if(!Date.prototype.toISOString)Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+
"Z"};if(!Date.now)Date.now=function(){return(new Date).getTime()};if(!Date.prototype.toJSON)Date.prototype.toJSON=function(){if(typeof this.toISOString.call!="function")throw new TypeError;return this.toISOString.call(this)};isNaN(Date.parse("2011-06-15T21:40:05+06:00"))&&(Date=function(b){var a=function(d,e,l,f,g,h,k){var i=arguments.length;return this instanceof b?(i=i==1&&String(d)===d?new b(a.parse(d)):i>=7?new b(d,e,l,f,g,h,k):i>=6?new b(d,e,l,f,g,h):i>=5?new b(d,e,l,f,g):i>=4?new b(d,e,l,f):
i>=3?new b(d,e,l):i>=2?new b(d,e):i>=1?new b(d):new b,i.constructor=a,i):b.apply(this,arguments)},d=RegExp("^(d{4})(?:-(d{2})(?:-(d{2})(?:T(d{2}):(d{2})(?::(d{2})(?:.(d{3}))?)?(?:Z|(?:([-+])(d{2}):(d{2})))?)?)?)?$"),e;for(e in b)a[e]=b[e];a.now=b.now;a.UTC=b.UTC;a.prototype=b.prototype;a.prototype.constructor=a;a.parse=function(a){var e=d.exec(a);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;e.pop();var f=+e.pop(),g=e.pop(),h=0;if(g){if(f>23||minuteOffset>59)return NaN;
h=(f*60+minuteOffset)*6E4*(g=="+"?-1:1)}return b.UTC.apply(this,e)+h}return b.parse.apply(this,arguments)};return a}(Date));if(!String.prototype.trim){var z=RegExp("^[\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff][\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff]*"),A=RegExp("[\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff][\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff]*$");String.prototype.trim=
function(){return String(this).replace(z,"").replace(A,"")}}var u=function(b){b=+b;b!==b?b=-1:b!==0&&b!==1/0&&b!==-(1/0)&&(b=(b>0||-1)*Math.floor(Math.abs(b)));return b}});
(function(m){typeof define=="function"?define(function(){m()}):m()})(function(m){function k(c){return c<10?"0"+c:c}if(!Function.prototype.bind){var o=Array.prototype.slice;Function.prototype.bind=function(){var c=this;if(typeof c.apply!="function"||typeof c.call!="function")return new TypeError;var b=o.call(arguments),a,d=function(){if(this instanceof d){var e=Object.create(c.prototype);a||(a=b.slice(1));return c.apply(e,a.concat(o.call(arguments)))||e}else return c.call.apply(c,b.concat(o.call(arguments)))};
return d}}var f=Function.prototype.call,g=Object.prototype,h=f.bind(g.hasOwnProperty),s,t,p,q,n;if(n=h(g,"__defineGetter__"))s=f.bind(g.__defineGetter__),t=f.bind(g.__defineSetter__),p=f.bind(g.__lookupGetter__),q=f.bind(g.__lookupSetter__);if(!Array.isArray)Array.isArray=function(c){return Object.prototype.toString.call(c)=="[object Array]"};if(!Array.prototype.forEach)Array.prototype.forEach=function(c,b){var a=Object(this),d=0,e=a.length>>>0;if(!c||!c.call)throw new TypeError;for(;d<e;)d in a&&
c.call(b,a[d],d,a),d++};if(!Array.prototype.map)Array.prototype.map=function(c,b){var a=Object(this),d=a.length>>>0;if(typeof c!="function")throw new TypeError;for(var e=Array(d),j=0;j<d;j++)j in a&&(e[j]=c.call(b,a[j],j,a));return e};if(!Array.prototype.filter)Array.prototype.filter=function(c,b){for(var a=Object(this),d=a.length>>>0,e=0;e<d;e++)e in a&&c.call(b,a[e],e,a)&&values.push(a[e]);return values};if(!Array.prototype.every)Array.prototype.every=function(c,b){if(this===void 0||this===null)throw new TypeError;
if(typeof c!=="function")throw new TypeError;for(var a=Object(this),d=a.length>>>0,e=0;e<d;e++)if(e in a&&!c.call(b,a[e],e,a))return!1;return!0};if(!Array.prototype.some)Array.prototype.some=function(c,b){if(this===void 0||this===null)throw new TypeError;if(typeof c!=="function")throw new TypeError;for(var a=Object(this),d=a.length>>>0,e=0;e<d;e++)if(e in a&&c.call(b,a[e],e,a))return!0;return!1};if(!Array.prototype.reduce)Array.prototype.reduce=function(c){var b=Object(this),a=b.length>>>0;if(Object.prototype.toString.call(c)!=
"[object Function]")throw new TypeError;if(!a&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else{do{if(d in b){e=b[d++];break}if(++d>=a)throw new TypeError;}while(1)}for(;d<a;d++)d in b&&(e=c.call(null,e,b[d],d,b));return e};if(!Array.prototype.reduceRight)Array.prototype.reduceRight=function(c){var b=Object(this),a=b.length>>>0;if(Object.prototype.toString.call(c)!="[object Function]")throw new TypeError;if(!a&&arguments.length==1)throw new TypeError;var d;
a-=1;if(arguments.length>=2)d=arguments[1];else{do{if(a in b){d=b[a--];break}if(--a<0)throw new TypeError;}while(1)}do a in this&&(d=c.call(null,d,b[a],a,b));while(a--);return d};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(c){if(this===void 0||this===null)throw new TypeError;var b=Object(this),a=b.length>>>0;if(!a)return-1;var d=0;arguments.length>0&&(d=u(arguments[1]));for(d=d>=0?d:Math.max(a-Math.abs(d),0);d<a;d++)if(d in b&&b[d]===c)return d;return-1};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=
function(c){if(this===void 0||this===null)throw new TypeError;var b=Object(this),a=b.length>>>0;if(!a)return-1;var d=a-1;arguments.length>0&&(d=u(arguments[1]));for(d=d>=0?d:Math.max(a-Math.abs(d),0);d>=0;d--)if(d in b&&c===b[d])return d;return-1};if(!Object.getPrototypeOf)Object.getPrototypeOf=function(c){return c.__proto__||c.constructor.prototype};if(!Object.getOwnPropertyDescriptor)Object.getOwnPropertyDescriptor=function(c,b){if(typeof c!="object"&&typeof c!="function"||c===null)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+
c);if(!h(c,b))return m;var a,d,e;a={enumerable:!0,configurable:!0};if(n){var j=c.__proto__;c.__proto__=g;d=p(c,b);e=q(c,b);c.__proto__=j;if(d||e){if(d)a.get=d;if(e)a.set=e;return a}}a.value=c[b];return a};if(!Object.getOwnPropertyNames)Object.getOwnPropertyNames=function(c){return Object.keys(c)};if(!Object.create)Object.create=function(c,b){var a;if(c===null)a={__proto__:null};else{if(typeof c!="object")throw new TypeError("typeof prototype["+typeof c+"] != 'object'");a=function(){};a.prototype=
c;a=new a;a.__proto__=c}typeof b!="undefined"&&Object.defineProperties(a,b);return a};var r=Object.defineProperty;if(f=!!r)f={},Object.defineProperty(f,"",{}),f=""in f;if(!f)Object.defineProperty=function(c,b,a){if(typeof c!="object"&&typeof c!="function")throw new TypeError("Object.defineProperty called on non-object: "+c);if(typeof a!="object"||a===null)throw new TypeError("Property description must be an object: "+a);if(r&&c.nodeType)return r(c,b,a);if(h(a,"value"))if(n&&(p(c,b)||q(c,b))){var d=
c.__proto__;c.__proto__=g;delete c[b];c[b]=a.value;c.__proto__=d}else c[b]=a.value;else{if(!n)throw new TypeError("getters & setters can not be defined on this javascript engine");h(a,"get")&&s(c,b,a.get);h(a,"set")&&t(c,b,a.set)}return c};if(!Object.defineProperties)Object.defineProperties=function(c,b){for(var a in b)h(b,a)&&Object.defineProperty(c,a,b[a]);return c};if(!Object.seal)Object.seal=function(c){return c};if(!Object.freeze)Object.freeze=function(c){return c};try{Object.freeze(function(){})}catch(B){Object.freeze=
function(c){return function(b){return typeof b=="function"?b:c(b)}}(Object.freeze)}if(!Object.preventExtensions)Object.preventExtensions=function(c){return c};if(!Object.isSealed)Object.isSealed=function(){return!1};if(!Object.isFrozen)Object.isFrozen=function(){return!1};if(!Object.isExtensible)Object.isExtensible=function(){return!0};if(!Object.keys){var v=!0,w="toString,toLocaleString,valueOf,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,constructor".split(","),x=w.length,y;for(y in{toString:null})v=
!1;Object.keys=function b(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var b=[],d;for(d in a)h(a,d)&&b.push(d);if(v)for(d=0;d<x;d++){var e=w[d];h(a,e)&&b.push(e)}return b}}if(!Date.prototype.toISOString)Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z"};if(!Date.now)Date.now=
function(){return(new Date).getTime()};if(!Date.prototype.toJSON)Date.prototype.toJSON=function(){if(typeof this.toISOString.call!="function")throw new TypeError;return this.toISOString.call(this)};isNaN(Date.parse("2011-06-15T21:40:05+06:00"))&&(Date=function(b){var a=function(d,e,l,f,g,h,k){var i=arguments.length;return this instanceof b?(i=i==1&&String(d)===d?new b(a.parse(d)):i>=7?new b(d,e,l,f,g,h,k):i>=6?new b(d,e,l,f,g,h):i>=5?new b(d,e,l,f,g):i>=4?new b(d,e,l,f):i>=3?new b(d,e,l):i>=2?new b(d,
e):i>=1?new b(d):new b,i.constructor=a,i):b.apply(this,arguments)},d=RegExp("^(d{4})(?:-(d{2})(?:-(d{2})(?:T(d{2}):(d{2})(?::(d{2})(?:.(d{3}))?)?(?:Z|(?:([-+])(d{2}):(d{2})))?)?)?)?$"),e;for(e in b)a[e]=b[e];a.now=b.now;a.UTC=b.UTC;a.prototype=b.prototype;a.prototype.constructor=a;a.parse=function(a){var e=d.exec(a);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;e.pop();var f=+e.pop(),g=e.pop(),h=0;if(g){if(f>23||minuteOffset>59)return NaN;h=(f*60+minuteOffset)*6E4*(g=="+"?
-1:1)}return b.UTC.apply(this,e)+h}return b.parse.apply(this,arguments)};return a}(Date));if(!String.prototype.trim){var z=RegExp("^[\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff][\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff]*"),A=RegExp("[\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff][\t\n-\r \u00a0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\u2028\u2029\ufeff]*$");String.prototype.trim=function(){return String(this).replace(z,
"").replace(A,"")}}var u=function(b){b=+b;b!==b?b=-1:b!==0&&b!==1/0&&b!==-(1/0)&&(b=(b>0||-1)*Math.floor(Math.abs(b)));return b}});
{
"name": "es5-shim",
"version": "1.2.6",
"version": "1.2.7",
"description": "ES5 as implementable on previous engines",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/kriskowal/es5-shim/",

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc