Created
January 13, 2010 14:13
-
-
Save addywaddy/276213 to your computer and use it in GitHub Desktop.
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
get = function(callback) { | |
print("WRONG") | |
callback() | |
} | |
var resource = function(name, callback) { | |
var get = function(callback) { | |
print("CORRECT") | |
callback() | |
} | |
// Declaring the function here gives me access to the locally defined get function | |
var func = function() { | |
get(function() { | |
print("OK") | |
}) | |
} | |
func() | |
// How can I get callback to use the locally defined function instead of the global one? | |
callback() | |
} | |
resource("foo", function() { | |
get(function() { | |
print("YEAH") | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment