|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
528 bytes
|
| Line | |
|---|
| 1 | import restArguments from './restArguments.js';
|
|---|
| 2 | import isFunction from './isFunction.js';
|
|---|
| 3 | import executeBound from './_executeBound.js';
|
|---|
| 4 |
|
|---|
| 5 | // Create a function bound to a given object (assigning `this`, and arguments,
|
|---|
| 6 | // optionally).
|
|---|
| 7 | export default restArguments(function(func, context, args) {
|
|---|
| 8 | if (!isFunction(func)) throw new TypeError('Bind must be called on a function');
|
|---|
| 9 | var bound = restArguments(function(callArgs) {
|
|---|
| 10 | return executeBound(func, bound, context, this, args.concat(callArgs));
|
|---|
| 11 | });
|
|---|
| 12 | return bound;
|
|---|
| 13 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.