Created
March 23, 2012 08:40
-
-
Save garrettwilkin/2168448 to your computer and use it in GitHub Desktop.
telenode / lib / telenode.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var f in HTTP) { | |
typeof HTTP[f] === 'function' && (this.HTTP[f] = HTTP[f].bind(this)); | |
} | |
for (var member in provider) { | |
if (typeof provider[member] === 'function') { | |
if (member === 'HTTP' || member === 'provider') { | |
throw new Error('API object or function name `' + member + '` is reserved'); | |
} | |
this[member] = provider[member].bind(this); | |
} | |
else { | |
this[member] = {}; | |
for (var f in provider[member]) { | |
if (typeof provider[member][f] === 'function') { | |
this[member][f] = provider[member][f].bind(this); | |
} | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment