Alternative to Function.bind

Igor Bukanov igor at mir2.org
Fri Mar 27 11:38:18 PDT 2009


2009/3/27 Erik Arvidsson <erik.arvidsson at gmail.com>:
> Here is one way to implement object.bind.method using ES3.1
>

The provided example has a drawback that obj.bind would not work with
methods that are added to obj later. So it would not be the true
bounded-method view for obj but rather a snapshot.

I suspect that to implement such view in ES one would need something
like those catch-all proposals to implement a getter for non-existing
properties.

Igor


More information about the Es-discuss mailing list