Created
March 14, 2014 20:46
-
-
Save benmj/9556491 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
#!/usr/local/bin/node | |
var not = {}; | |
function printCatch (name) { | |
try { | |
console.log(eval(name)); | |
} catch (e) { | |
console.log("whoops, that isn't defined yet"); | |
setTimeout(printCatch.bind(undefined, name), 0); | |
} | |
} | |
printCatch('not.def.yet'); | |
not = { | |
def: { | |
yet: "boo yah" | |
} | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment