Skip to content

Commit 8dbca7c

Browse files
author
fabianmoronzirfas
committed
rebundle
1 parent a0cadd3 commit 8dbca7c

File tree

1 file changed

+81
-83
lines changed

1 file changed

+81
-83
lines changed

index.js

Lines changed: 81 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,45 @@ if (!Array.isArray) {
242242
return (arg.__class__ === 'Array');
243243
};
244244
}
245+
//lastIndexOf.js
246+
/*
247+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf
248+
*/
249+
// Production steps of ECMA-262, Edition 5, 15.4.4.15
250+
// Reference: http://es5.github.io/#x15.4.4.15
251+
if (!Array.prototype.lastIndexOf) {
252+
Array.prototype.lastIndexOf = function(searchElement, fromIndex) {
253+
254+
if (this === void 0 || this === null) {
255+
throw new TypeError('Array.prototype.lastIndexOf called on null or undefined');
256+
}
257+
258+
var n, k,
259+
t = Object(this),
260+
len = t.length >>> 0;
261+
if (len === 0) {
262+
return -1;
263+
}
264+
265+
n = len - 1;
266+
if (arguments.length > 1) {
267+
n = Number(arguments[1]);
268+
if (n != n) {
269+
n = 0;
270+
}
271+
else if (n != 0 && n != Infinity && n != -Infinity) {
272+
n = (n > 0 || -1) * Math.floor(Math.abs(n));
273+
}
274+
}
275+
276+
for (k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n); k >= 0; k--) {
277+
if (k in t && t[k] === searchElement) {
278+
return k;
279+
}
280+
}
281+
return -1;
282+
};
283+
}
245284
//map.js
246285
/*
247286
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
@@ -326,45 +365,6 @@ if (!Array.prototype.map) {
326365
return A;
327366
};
328367
}
329-
//lastIndexOf.js
330-
/*
331-
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf
332-
*/
333-
// Production steps of ECMA-262, Edition 5, 15.4.4.15
334-
// Reference: http://es5.github.io/#x15.4.4.15
335-
if (!Array.prototype.lastIndexOf) {
336-
Array.prototype.lastIndexOf = function(searchElement, fromIndex) {
337-
338-
if (this === void 0 || this === null) {
339-
throw new TypeError('Array.prototype.lastIndexOf called on null or undefined');
340-
}
341-
342-
var n, k,
343-
t = Object(this),
344-
len = t.length >>> 0;
345-
if (len === 0) {
346-
return -1;
347-
}
348-
349-
n = len - 1;
350-
if (arguments.length > 1) {
351-
n = Number(arguments[1]);
352-
if (n != n) {
353-
n = 0;
354-
}
355-
else if (n != 0 && n != Infinity && n != -Infinity) {
356-
n = (n > 0 || -1) * Math.floor(Math.abs(n));
357-
}
358-
}
359-
360-
for (k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n); k >= 0; k--) {
361-
if (k in t && t[k] === searchElement) {
362-
return k;
363-
}
364-
}
365-
return -1;
366-
};
367-
}
368368
//reduce.js
369369
/*
370370
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
@@ -448,16 +448,6 @@ if (!Array.prototype.reduceRight) {
448448
return value;
449449
};
450450
}
451-
//trim.js
452-
/*
453-
https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
454-
*/
455-
if (!String.prototype.trim) {
456-
// Вырезаем BOM и неразрывный пробел
457-
String.prototype.trim = function() {
458-
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
459-
};
460-
}
461451
//some.js
462452
/*
463453
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
@@ -488,6 +478,48 @@ if (!Array.prototype.some) {
488478
return false;
489479
};
490480
}
481+
//bind.js
482+
/*
483+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Polyfill
484+
485+
WARNING! Bound functions used as constructors NOT supported by this polyfill!
486+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Bound_functions_used_as_constructors
487+
*/
488+
if (!Function.prototype.bind) {
489+
Function.prototype.bind = function(oThis) {
490+
if (this.__class__ !== 'Function') {
491+
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
492+
}
493+
494+
var aArgs = Array.prototype.slice.call(arguments, 1),
495+
fToBind = this,
496+
fNOP = function() {},
497+
fBound = function() {
498+
return fToBind.apply(this instanceof fNOP
499+
? this
500+
: oThis,
501+
aArgs.concat(Array.prototype.slice.call(arguments)));
502+
};
503+
504+
if (this.prototype) {
505+
// Function.prototype doesn't have a prototype property
506+
fNOP.prototype = this.prototype;
507+
}
508+
fBound.prototype = new fNOP();
509+
510+
return fBound;
511+
};
512+
}
513+
//trim.js
514+
/*
515+
https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/String/Trim
516+
*/
517+
if (!String.prototype.trim) {
518+
// Вырезаем BOM и неразрывный пробел
519+
String.prototype.trim = function() {
520+
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
521+
};
522+
}
491523
//create.js
492524
if (!Object.create) {
493525
// Production steps of ECMA-262, Edition 5, 15.2.3.5
@@ -820,37 +852,3 @@ if (!Object.seal) {
820852
return object;
821853
};
822854
}
823-
//.DS_Store
824-
Bud1%  @ @ @ @ E%DSDB` @ @ @
825-
//bind.js
826-
/*
827-
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Polyfill
828-
829-
WARNING! Bound functions used as constructors NOT supported by this polyfill!
830-
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Bound_functions_used_as_constructors
831-
*/
832-
if (!Function.prototype.bind) {
833-
Function.prototype.bind = function(oThis) {
834-
if (this.__class__ !== 'Function') {
835-
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
836-
}
837-
838-
var aArgs = Array.prototype.slice.call(arguments, 1),
839-
fToBind = this,
840-
fNOP = function() {},
841-
fBound = function() {
842-
return fToBind.apply(this instanceof fNOP
843-
? this
844-
: oThis,
845-
aArgs.concat(Array.prototype.slice.call(arguments)));
846-
};
847-
848-
if (this.prototype) {
849-
// Function.prototype doesn't have a prototype property
850-
fNOP.prototype = this.prototype;
851-
}
852-
fBound.prototype = new fNOP();
853-
854-
return fBound;
855-
};
856-
}

0 commit comments

Comments
 (0)