Raynos / function-bind

MIT License
138 stars 27 forks source link

Update index.js #1

Closed JoeChapman closed 10 years ago

JoeChapman commented 10 years ago

Have you considered defining Function.prototype.bind within the module? This implementation still returns the bind. However, like chai, by invoking require, one defines the bind, without needing to assign the return value to a target. Also, don't you like semi-colons?

Raynos commented 10 years ago

This module will not mutate globals.

JoeChapman commented 10 years ago

Ok, but you one must augment the Function prototype for this to be of any use whatsoever. You can't pretend you're not mutating Globals just because you're leaving it up to the user.

Raynos commented 10 years ago
var bind = require('function-bind')

function fn() { ... }

bind.call(fn, self, arg1)

You can use bind perfectly well without globals.