* Simple bind, faster than native
(fn, ctx)
| 122 | * Simple bind, faster than native |
| 123 | */ |
| 124 | function bind (fn, ctx) { |
| 125 | function boundFn (a) { |
| 126 | var l = arguments.length; |
| 127 | return l |
| 128 | ? l > 1 |
| 129 | ? fn.apply(ctx, arguments) |
| 130 | : fn.call(ctx, a) |
| 131 | : fn.call(ctx) |
| 132 | } |
| 133 | // record original fn length |
| 134 | boundFn._length = fn.length; |
| 135 | return boundFn |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Convert an Array-like object to a real Array. |
no outgoing calls
no test coverage detected