@@ -242,6 +242,45 @@ if (!Array.isArray) {
242
242
return ( arg . __class__ === 'Array' ) ;
243
243
} ;
244
244
}
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
+ }
245
284
//map.js
246
285
/*
247
286
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
@@ -326,45 +365,6 @@ if (!Array.prototype.map) {
326
365
return A ;
327
366
} ;
328
367
}
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
- }
368
368
//reduce.js
369
369
/*
370
370
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
@@ -448,16 +448,6 @@ if (!Array.prototype.reduceRight) {
448
448
return value ;
449
449
} ;
450
450
}
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
- }
461
451
//some.js
462
452
/*
463
453
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
@@ -488,6 +478,48 @@ if (!Array.prototype.some) {
488
478
return false ;
489
479
} ;
490
480
}
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
+ }
491
523
//create.js
492
524
if ( ! Object . create ) {
493
525
// Production steps of ECMA-262, Edition 5, 15.2.3.5
@@ -820,37 +852,3 @@ if (!Object.seal) {
820
852
return object ;
821
853
} ;
822
854
}
823
- //.DS_Store
824
-