blob: 26223595fdf28e212c2e2847c13e7f18339da21e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
Function.prototype.bind = function () {
var args = Array.prototype.slice.call(arguments);
var self = this;
var bound = function () {
return self.call.apply(
self,
args.concat(
Array.prototype.slice.call(arguments)
)
);
};
bound.name = this.name;
bound.displayName = this.displayName;
bound.length = this.length;
bound.unbound = self;
return bound;
};
|