1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 09:24:25 +03:00
ifhub.club/application/frontend/skin/developer/components/ls-core/polyfills.js
Denis Shakhov 42321428f8 Компоненты ls-core и ls-vendor
* Перенесены либы из фреймворка
2014-10-24 20:26:11 +07:00

23 lines
628 B
JavaScript

/**
* Bind
*/
if ( ! Function.prototype.bind ) {
Function.prototype.bind = function ( obj ) {
if ( typeof this !== "function" ) {
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var slice = [].slice,
args = slice.call(arguments, 1),
self = this,
nop = function () {},
bound = function () {
return self.apply( this instanceof nop ? this : ( obj || {} ), args.concat( slice.call( arguments ) ) );
};
nop.prototype = this.prototype;
bound.prototype = new nop();
return bound;
};
}