Skip to content

Commit a7be710

Browse files
committed
tests: bind polyfill as described in angular/angular.js#13794
1 parent b90efc8 commit a7be710

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/angular_spec.js

+18
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
/* eslint-env mocha, jasmine */
44

5+
if (typeof Function.prototype.bind != 'function') {
6+
Function.prototype.bind = function bind(obj) {
7+
var args = Array.prototype.slice.call(arguments, 1),
8+
self = this,
9+
nop = function() {
10+
},
11+
bound = function() {
12+
return self.apply(
13+
this instanceof nop ? this : (obj || {}), args.concat(
14+
Array.prototype.slice.call(arguments)
15+
)
16+
);
17+
};
18+
nop.prototype = this.prototype || {};
19+
bound.prototype = new nop();
20+
return bound;
21+
};
22+
}
523

624
describe('autocomplete directive', function() {
725
global.jQuery = require('jquery');

0 commit comments

Comments
 (0)